A program executes 2 billion instructions with an average CPI of 1.5 on a 3 GHz processor. What is its CPU execution time?
Correct answer D. 1.0 s
Explanation
CPU time = instruction count x CPI / clock rate = 2 x 10^9 x 1.5 / (3 x 10^9) = 1.0 second. Multiplying by the clock rate instead of dividing gives a nonsense 9 x 10^18, and dividing instruction count by CPI leads to 0.44 s. This 'iron law' shows performance depends on all three factors: instruction count, CPI and clock period.
Answer checked How we write and check questions
Discussion