Instruction Class Frequency Cycles load 20% 3 store 20% 3 ALU op 40% 1 branch 10
ID: 3610968 • Letter: I
Question
Instruction Class
Frequency
Cycles
load
20%
3
store
20%
3
ALU op
40%
1
branch
10%
2
As a designer you consider an alternative implementation M2, byadding a new instruction that
could have up to three memory operands. The CPI for this newinstruction is 4, and its
implementation would increase the clock cycle period by a factorof 1.5. However, the new
instruction would effectively replace half of the loadinstructions and half of the store
instructions.
a. What is the average CPI for M1?
(.2)* 3 = .6
(.2)* 3 = .6
(.4)* 1 = .4
(.1)* 2 = .2
Total CPI for M1 = 1.8/.9 = 2
Which machine is faster and by how much?
Instruction Class
Frequency
Cycles
load
20%
3
store
20%
3
ALU op
40%
1
branch
10%
2
Explanation / Answer
Dear,
First of all we have to know the total number ofinstructions execute and time for M1 and M2, then only we can findout which machine is faster.
= # of cycles / time
= (# of instruction x CPI) /time
= (2000*106 * 2) / 10
= 400MHz
Clock rate M2 = Cycles per second
= # of cycles / time
= (# of instruction x CPI) /time
= (2300*106 * .16) / 10
= 36.8MHz
Time of execution of M1 = CPI * insr.count /clock rate of M1
= 2 * 2000*106 / 400 MHz = 10sec
Time of execution of M2 = CPI * insr.count / clockrate of M2