GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A 4-way set holds blocks A, B, C, D in ways 0, 1, 2, 3; A is the least and D the most recently used. Tree pseudo-LRU uses three bits, all 0 initially: 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 (0 = left); every access, including the fill after a miss, sets the bits on its path to point away from the accessed way. The set then sees B, E, A, E, C, D, C, D. How many misses occur under tree-PLRU, and how many under true LRU?

  1. A. 4 under PLRU; 2 under true LRU
  2. B. 2 under PLRU; 4 under true LRU
  3. C. 2 under PLRU; 2 under true LRU
  4. D. 4 under PLRU; 4 under true LRU

Correct answer: B. 2 under PLRU; 4 under true LRU

PLRU: B (way 1) sets root → right pair, left bit → way 0; E misses and replaces way 2 (C), pointing the root back left; A hits; E hits; C misses and replaces B; D hits, C and D hit: 2 misses. True LRU evicts A, C, D, B in turn — it throws out C and D just before they are needed: 4 misses. PLRU is only an approximation and can beat or lose to LRU.

More Computer Organization and Architecture questions

Exams that ask this topic