Assume that for a program compiler C1 results in a dynamic instruction count of
ID: 662240 • Letter: A
Question
Assume that for a program compiler C1 results in a dynamic instruction count of 4.2E9 and has an execution time of 1.9 s, while compiler C2 results in a dynamic instruction count of 3.8E9 and execution time of 1.6 s.
1) Find the average CPI for each program given that the processor has a clock cycle time of 800 ps.
2) Assume the compiler programs run on two different processors. If the execution times on the two processors are the same, how much fatser is the clock of the processor running C1's code, vs. the clock of processor running C2's code?
Explanation / Answer
CPU time = (Instruction count x CPI) / clock rate
Given ,
clock rate = 800 ps = 800 * 10^-12,(picoseconds (ps))
C1's Instruction count = 4.2E9
C1's CPU time = 1.9s
C2's Instruction count = 3.9E9
C2's CPU time = 1.6s
1)
CPI for C1 :
1.9 = (4.2 * 10^9 * CPI) / (800 * 10^-12)
CPI for C1 = (1.9 * 800 * 10^-12) / (4.2 * 10^9) = 361.9 * 10^-21
CPI for C2 :
CPI = (1.6 *800 * 10^-12) / (3.8 * 10^9) = 336.8 * 10^-21
2)
Clock = (Inst * CPI) / ExeTime
Using 1 sec for ExeTime (given same)
Clock for C1 = (4.2 * 10^9 * 361.9 * 10^-21 ) / 1 = 1519.98 * 10^-12 = 1.51 ns
Clock for C2 = (3.8 *10^9 * 336.8 * 10^-21 ) / 1 = 1279.84 * 10^-12 = 1.27 ns
so, Clock for C1 .25 ns greater than Clock for C2