Assume a program requires the execution of 50 x 106 fp instructions, 110 x 106 int instructions, 80 x 106 l/s instructions, and 16 x 106 branch instructions. The cpi for each type of instruction is 1, 1, 4, and 2, respectively. Assume that the processor has a 2 ghz clock rate. By how much must we improve the cpi of fp instructions if we want the program to run two times faster?
Answers
Answer :-
FP - 50 x 10^6 , CPI - 1
INT - 110 x 10^6 , CPI - 1
I/S - 80 x 10^6 , CPI - 4
Branch - 16 x 10^ 6 , CPI - 2
Clock Speed - 2 x 10^9
Time(old) = [50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)] / [2 x 10^9]
Time(old) = 256 x 10^-3
Time(new) = 256 x 10^-3 /2 = 128 x 10^-3
CPI(new) x [50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)] / [2 x 10^9] = 128 x 10^-3
CPI(new) = -206 / 50 = -4.12
Answer:
FP - 50 x 10^6 , CPI - 1
INT - 110 x 10^6 , CPI - 1
I/S - 80 x 10^6 , CPI - 4
Branch - 16 x 10^ 6 , CPI - 2
Clock Speed - 2 x 10^9
Time(old) = [50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)] / [2 x 10^9]
Time(old) = 256 x 10^-3
Time(new) = 256 x 10^-3 /2 = 128 x 10^-3
CPI(new) x [50 x 10^6 + 110 x 10^6 + 4 x ( 80 x 10^6) + 2 x (16 x 10^ 6)] / [2 x 10^9] = 128 x 10^-3
CPI(new) = -206 / 50 = -4.12
Explanation:
So, we can conclude that we must improve the cpi of fp instructions at about - 4.12, if we want the program to run two times faster.