Memory Hierarchy
With a cache hit time of 2 cycles, a miss rate of 4% and a miss penalty of 150 cycles, what is the average memory access time in cycles?
- A8 cycles
- B6 cycles
- C152 cycles
Show answer and explanation
Answer: A. 8 cycles
Average memory access time = hit time + miss rate × miss penalty = 2 + 0.04 × 150 = 2 + 6 = 8 cycles. The hit time applies to every access, and the miss penalty is added only on misses. 6 cycles omits the hit time, counting only the misses. 152 cycles is the time for a single access that misses, not the average. Even a 4% miss rate quadruples the average.
- A. Correct. 2 + 0.04 × 150 = 8 cycles.
- B. 6 cycles forgets to add the hit time.
- C. 152 cycles is the time for one access that misses.