Memory Hierarchy
A processor has an average CPI of 1.0 with a perfect cache. Each instruction makes 1.3 memory accesses on average, with a 2% miss rate and a 100-cycle miss penalty. What is the actual average CPI?
- A3.0
- B3.6
- C1.3
Show answer and explanation
Answer: B. 3.6
Memory stall cycles per instruction are 1.3 accesses × 0.02 × 100 cycles = 2.6 cycles. Adding them to the ideal CPI gives 1.0 + 2.6 = 3.6, so performance falls to 1/3.6 of ideal. 3.0 wrongly assumes one access per instruction (1.0 + 1 × 0.02 × 100). 1.3 is the number of accesses per instruction, not the CPI. Even a small miss rate badly hurts performance when the miss penalty is large.
- A. 3.0 wrongly assumes one access per instruction.
- B. Correct. 1.0 + 1.3 × 0.02 × 100 = 3.6.
- C. 1.3 is the number of accesses per instruction.