For this question only assume that the CPI for instruction C for Ml is 3.0+0.f a
ID: 3728396 • Letter: F
Question
For this question only assume that the CPI for instruction C for Ml is 3.0+0.f and the CPIfor instruction C for M is 4.0+0.g Consider two different implementations M1 and M2 of the same instruction set. M1 has a clock rate of 2 GHz and M2 has a clock rate of 3 GHz. There are 3 classes of instructions with the following CPIs CPI for MI CPI for M2 Class 3 a) What are the peak performances in terms of MIPS for both machines? b) Show that if half the instructions executed in a certain program are from class A and the rest are divided equally among classes B and C, then M2 is faster than M1 (note that you may have to prove the opposite depending on your ID) Show that the second assumption in part b above is redundant. In other words, if half the instructions executed in a certain program are from class A, then M2 will always be faster than M1, regardless of the distribution of the remaining instructions among classes B and C. You need to prove this using an equation, for example if percentage of class B is x then percentage of class C is 0.5-x and solve for x. c)Explanation / Answer
f and g will depend on your ID .I'm assuming f=2 and g=1.
a) FOR M1:
The peak performer of M1 is instruction class B which has a CPI of 2.
Now clock rate of M1= 2 GHz = 2 x 109 Hz
Therefore clock cycle time = 1/( 2 x 109) second = 0.5 x 10-9 second
As CPI is 2 therefore for 1 instruction time needed is = 2 x 0.5 x 10-9 second = 10-9 second.
Therefore in 10-9 second it computes 1 instruction.
Therefore in 1 second it computes 109 instructions = 1000 MIPS.
FOR M2:
The peak performer of M2 is instruction class A which has a CPI of 3.
Now clock rate of M2= 3 GHz = 3 x 109 Hz
Therefore clock cycle time = 1/( 3 x 109) second = (1/3)x 10-9 second
As CPI is 3 therefore for 1 instruction time needed is = 3 x (1/3) x 10-9 second = 10-9 second.
Therefore in 10-9 second it computes 1 instruction.
Therefore in 1 second it computes 109 instructions = 1000 MIPS.
b) Average CPI of M1 = 0.5*3 + 0.25*2 + 0.25*3.2 = 1.5 + 0.5 + 0.8 = 2.8
Therefore average execution time M1 = 2.8*0.5*10-9 = 1.4*10-9 second.
Average CPI of M2 = 0.5*3 + 0.25*4 + 0.25*4.1 = 1.5 + 1 + 1.025 = 3.525
Therefore average execution time M2 = 3.525*(1/3)*10-9 =1.175*10-9 second.
As, average execution time of M2 is less than M1 so, M2 is faster than M1.
c) Let the distribution of remaining instructions be :- x for class B and (0.5-x) for class C.
Average CPI of M1 = 0.5*3 + x*2 + (0.5-x)*3.2 = 1.5 + 2x + 1.6 - 3.2x = 3.1 - 1.2x .
Therefore average execution time M1 = (3.1 - 1.2x )*0.5*10-9 = (1.55 - 0.6x)*10-9 second.
Average CPI of M2 = 0.5*3 + x*4 + (0.5 - x)*4.1 = 1.5 + 4x + 2.05 - 4.1x = 3.55 - 0.1x
Therefore average execution time M2 = (3.55 - 0.1x)*(1/3)*10-9 =(1.1834 - 0.034x)*10-9 second.
Clearly from above M2 is always faster than M1 if half of the instructions are of class A.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.