Performance Analysis
A program executing 1 billion instructions runs on a CPU with average CPI 2 and clock frequency 2 GHz. What is the execution time?
- A4 seconds
- B0.25 seconds
- C1 second
Show answer and explanation
Answer: C. 1 second
The required cycle count is instruction count × CPI = 1 billion × 2 = 2 billion cycles. A 2 GHz CPU advances 2 billion cycles per second, so execution time is 2 billion ÷ 2 billion = 1 second. If cache misses raised CPI to 3, the same program would take 1.5 seconds; raising frequency to 3 GHz would bring it to about 0.67 seconds. This formula lets improvements be estimated numerically.
- A. That multiplies by frequency instead of dividing.
- B. That divides by CPI.
- C. Correct. 10⁹ × 2 ÷ (2 × 10⁹) = 1.