324,504 views
19 votes
19 votes
Consider two different implementations, M1 and M2, of the same instruction set. There are three classes of instructions (A, B, and C) in the instruction set. M1 has a clock rate of 60MHz and M2 has a clock rate of 80MHz. The average number of cycles of each instruction class and their frequencies (for a typical program) are as follows:

Instruction Class M1-cycles M2-cycles/ Frequency
/instruction class instruction class
A 1 2 50%
B 2 3 20%
C 3 4 30%
a. Calculate the average CPI for each machine, M1 and M2.
b. Calculate the CPU execution time of M1 and M2.

User Rishabh Jhalani
by
2.9k points

1 Answer

22 votes
22 votes

Step-by-step explanation:

A.)

we have two machines M1 and M2

cpi stands for clocks per instruction.

to get cpi for machine 1:

= we multiply frequencies with their corresponding M1 cycles and add everything up

50/100 x 1 = 0.5

20/100 x 2 = 0.4

30/100 x 3 = 0.9

CPI for M1 = 0.5 + 0.4 + 0.9 = 1.8

We find CPI for machine 2

we use the same formula we used for 1 above

50/100 x 2 = 1

20/100 x 3 = 0.6

30/100 x 4 = 1.2

CPI for m2 = 1 + 0.6 + 1.2 = 2.8

B.)

CPU execution time for m1 and m2

this is calculated by using the formula;

I * CPI/clock cycle time

execution time for A:

= I * 1.8/60X10⁶

= I x 30 nsec

execution time b:

I x 2.8/80x10⁶

= I x 35 nsec

User Scheien
by
3.4k points