GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A 4-way set uses tree pseudo-LRU with three bits: the root bit says which pair (ways 0-1 or 2-3) holds the next victim, and each pair bit says which way of that pair. On every access to way w, the bits on its path are set to point away from w. All bits start at 0 (0 = left). After hits to ways [2, 1, 0, 1, 3, 3] in that order, which way does the next miss replace?

  1. A. Way 2
  2. B. Way 0
  3. C. Way 1
  4. D. Way 3

Correct answer: B. Way 0

Simulating the three bits gives victim way 0; true LRU would evict way 2. Tree-PLRU only approximates LRU because it remembers one bit per node, not the full order.

More Computer Organization and Architecture questions

Exams that ask this topic