GATE / CS ARCHIVE

GATE CSE 2024 SET 1 / QUESTION 56

Combine instruction and data cache stall costs

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2024 Set 1 paper

GATE 2024 Set 1, Q56 2 marks · NAT
Report issue

Cache Memory

Question 56, GATE 2024: A program has 25% load/store instructions. Ideal CPI is 2; instruction-cache miss rate is 2%; data-cache miss rate is 8%; every miss costs 100 cycles. Find the speedup with perfect instruction and data caches, rounded to two decimals.
Tap to enlarge
Answer & solution

Official answer: 3.00

Approach: Express every stall contribution per executed instruction so they can be added to the base CPI.
1. Every instruction requires an instruction fetch. Instruction-cache stalls therefore contribute 0.02 misses/instruction ×100 cycles/miss=2 cycles/instruction.
2. Only 25% of instructions access data memory. Data-cache stalls contribute 0.25 accesses/instruction ×0.08 misses/access ×100 cycles/miss=2 cycles/instruction.
3. With the stated additive, nonoverlapped miss-penalty model, actual CPI=ideal CPI+instruction stalls+data stalls=2+2+2=6.
4. Perfect caches remove both stall terms and restore CPI=2. With the same instruction count and clock rate, execution time is proportional to CPI, so speedup=old time/new time=6/2=3.
Answer: 3.00. Using 8% for every instruction would overcount data misses. The reciprocal 2/6 is the new-to-old time ratio, not the speedup factor.

Original paper, page 33 · Answer key