GATE / CS ARCHIVE

GATE CSE 2014 SET 1 / QUESTION 44

GATE CSE 2014 Set 1 Q44

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

GATE 2014 Set 1, Q44 2 marks · MCQ
Report issue

Cache Memory

Question 44, GATE 2014: A cache-block reference sequence has length N and n distinct block addresses. At most k distinct block addresses occur between two consecutive references to the same address. What is the miss ratio for an LRU cache with associativity A≥k? A: n/N. B: 1/N. C: 1/A. D: k/n. The printed inequality is non-strict, and the initial cache state is not specified.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Our answer: A requires strict A>k and an initially empty cache

1. Method and setup. LRU evicts a block after A other distinct blocks mapped to its set have been accessed. Therefore a guaranteed hit requires the intervening distinct-block count for that set to be strictly less than A. Counting one compulsory miss per distinct address is valid only after establishing that all subsequent references hit and that first references begin uncached.

2. Work through the result and its assumptions. An LRU hit requires fewer than A distinct intervening blocks mapping to the same set. The stated bound k suffices when A>k, but not at A=k. For example, let a direct-mapped cache have A=k=1 and let distinct x, y map to the same set. The sequence x, y, x, y has N=4, n=2 and one distinct intervening block on each reuse, yet all four accesses miss, giving 1 rather than n/N=1/2. Thus the official cold-miss-only answer A needs a strict inequality (or a reuse-distance definition including the reused block) and an initially empty cache.

Original paper, page 19 · Answer key