In: Computer Science
We want to improve program performance by %5, we can increase clock rate but doing so will require 1.25 times as many clock cycles. Calculate the new clock rate? Calculate what the new clock rate needs to be to accomplish this performance improvement. Current CPU Time is 18.8 and clock rate is 3.5 GHz. CPI = 1.4 and Instruction count = 47
My answer is:
New Clock Cycles = 0.357
New Clock Rate = 17.86/47*1.4 = 0.2712
Is my answer correct?
GIVEN-
CPU time = 18.8 nano seconds
Clock Rate = 3.5 Ghz OR 3.5 x 109 Hz
Clock cycles are the reciprocal of clock rate and vice versa. So,
Clock cycles = 1/3.5 = 0.285714 ns
CPI( cycles per instruction) = 1.4
Instruction Count = 47
We are taking CPU time as 18.8 nano seconds because clock rate given is 3.5 GHz which when converted into hertz during the calculation of CPU time gives a multiple of 10 to the power 9 seconds which is taken as nano seconds.
Now,
Computer performance needs to be improved by 5%, and performance depends on the execution time or CPU time. So, the new CPU time needs to increase by 0.05 times. Then,
Value by which CPU time needs to be incremented = 0.05 x 18.8 = 0.94 ns
Required CPU time = 18.8 + 0.94 = 19.74 ns
Now, as given in the question for this CPU time the clock rate can be increased which will require 1.25 times clock cycles. So,
New Clock cycles = 1.25 x 0.285714 = 0.3571425 ns
New Clock Rate = 1/New Clock cycles = 1/0.3571425 ns = 2.8 GHz
But this is not the required rate as if CPU time is calculated with this clock rate then it won't give the CPU time to be 19.74 ns which is required to be increase the performance by 5%.
-> CPU time = Instruction count x CPI x clock cycle time
-> CPU time = Instruction count x CPI / clock rate
New CPU Time with clock rate 2.8 = (Instruction count * CPI)/clock rate => (47*1.4)/2.8 => 23.5 ns
Now the CPU time much more than the required CPU time. So,
Required clock rate needs to be to accomplish this performance improvement = (Instruction count * CPI)/CPU time
=> (47*1.4)/19.74 Ghz => 3.33 GHz