Question

An access sequence of cache block addresses is of length NN and contains nn unique block addresses. The number of unique block addresses between two consecutive accesses to the same block address is bounded above by kk. What is the miss ratio if the access sequence is passed through a cache of associativity A≥kA \ge k exercising least-recently-used replacement policy?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2014 answer key

Solution

Classify cache misses into compulsory and capacity/conflict misses under LRU replacement.

  1. The access sequence has total length NN and contains nn unique block addresses.

  2. Every block address must be brought into the cache on its very first access. These initial accesses are compulsory (cold) misses. Since there are nn distinct block addresses, there are exactly nn compulsory misses.

  3. Now consider any re-access to an already-accessed block address BB:

    • The problem states that the number of unique block addresses accessed between two consecutive accesses to BB is at most kk.
    • Under the Least-Recently-Used (LRU) policy, a block is only evicted if at least AA other unique blocks are accessed after it, where AA is the associativity.
    • Since A≥kA \ge k, the number of intervening distinct blocks is strictly less than or equal to the cache associativity, so block BB can never be evicted before its subsequent access.
    • Therefore, every subsequent access to any block is guaranteed to be a cache HIT.
  4. Consequently, no capacity or conflict misses can occur. The total number of misses across all NN accesses is exactly nn.

  5. The miss ratio is:

    Miss Ratio=Total MissesTotal Accesses=nN\text{Miss Ratio} = \frac{\text{Total Misses}}{\text{Total Accesses}} = \frac{n}{N}

This matches option A.

Final answer

A

Common trap

Assuming the miss ratio depends on associativity AA or bound kk rather than the ratio of distinct blocks to total requests.

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

Source

Paper
GATE 2014 Computer Science and Information Technology (CS) Session 1
Question
54 of 65, printed as CS Q.44
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.