A given program has 25% load/store instructions. Suppose the ideal CPI (cycles…

2024

A given program has 25% load/store instructions. Suppose the ideal CPI (cycles per instruction) without any memory stalls is 2. The program exhibits 2% miss rate on instruction cache and 8% miss rate on data cache. The miss penalty is 100 cycles. The speedup (rounded off to two decimal places) achieved with a perfect cache (i.e., with NO data or instruction cache misses) is _________

Attempted by 81 students.

Show answer & explanation

Correct answer: 3

Key idea: compute the extra memory stall cycles per instruction from instruction and data cache misses, add that to the ideal CPI, and compare with the perfect-cache CPI.

  • Instruction misses per instruction = instruction miss rate = 0.02.

  • Data misses per instruction = fraction of load/store instructions × data miss rate = 0.25 × 0.08 = 0.02.

  • Total misses per instruction = 0.02 + 0.02 = 0.04, so memory stall cycles per instruction = 0.04 × 100 = 4 cycles.

  • CPI with misses = ideal CPI + stall = 2 + 4 = 6. CPI with a perfect cache (no misses) = 2.

  • Speedup (old time / new time) = CPI with misses / CPI with perfect cache = 6 / 2 = 3.00.

Answer: 3.00

A video solution is available for this question — log in and enroll to watch it.

Explore the full course: Gate Guidance By Sanchit Sir