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?
- A. 4 under PLRU; 2 under true LRU
- B. 2 under PLRU; 4 under true LRU
- C. 2 under PLRU; 2 under true LRU
- 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.
Practise more Computer Organization and Architecture questionsComputer Organization and Architecture: notes and key points
More Computer Organization and Architecture questions
- A 16-bit unsigned integer (0..65535) is multiplied by a 16-bit two's-complement integer (−32768..32767). What is the minimum width of a…
- A loop computes y[i] += A[i][j] × x[j] for a 32×32 matrix of 4-byte floats (A in row-major order at address 0, x at 4096, y at 4224); for…
- A direct-mapped cache has a 1-cycle hit time, a 4% miss rate and a 40-cycle miss penalty on a 1.0 ns clock. A 2-way version also hits in 1…
- An interrupt is recognised only at instruction boundaries. The longest instruction takes 30 cycles; on average an interrupt arrives…
- A program has base CPI 1.2 and makes 1.4 memory references per instruction. Per memory reference, 3% miss in L1 and 1.2% miss in L2 (a…
- Design 1 is a direct-mapped cache (hit 1.0 ns, miss rate 6%) with a victim buffer that catches 25% of its misses for 1 ns extra; the other…