Question

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 _________

Official answer and solution
Official answer
3
From
Official GATE 2024 answer key

Solution

Compute the average memory stall cycles per instruction from both I-cache and D-cache misses, add to the ideal CPI, and divide by the ideal CPI.

  1. Instruction cache stall cycles per instruction:
    Every instruction (100%100\%) is fetched from the instruction cache:
    I-cache stalls=1.00×0.02×100=2 cycles/instruction\text{I-cache stalls} = 1.00 \times 0.02 \times 100 = 2\text{ cycles/instruction}
  2. Data cache stall cycles per instruction:
    Only load/store instructions (25%25\%) access the data cache:
    D-cache stalls=0.25×0.08×100=2 cycles/instruction\text{D-cache stalls} = 0.25 \times 0.08 \times 100 = 2\text{ cycles/instruction}
  3. Effective CPI with cache misses:
    CPIactual=CPIideal+2+2=2+4=6\text{CPI}_{\text{actual}} = \text{CPI}_{\text{ideal}} + 2 + 2 = 2 + 4 = 6
  4. Speedup with a perfect cache:
    Speedup=CPIactualCPIideal=62=3\text{Speedup} = \frac{\text{CPI}_{\text{actual}}}{\text{CPI}_{\text{ideal}}} = \frac{6}{2} = 3
Final answer

3

Common trap

Applying the 8% D-cache miss rate to all instructions instead of only the 25% load/store instructions.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2024 Computer Science and Information Technology - Set 1 (CS1)
Question
56 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.