CS FundamentalsVery hardGATE CS (PYQ pattern)

A data TLB has 64 entries organised as 16 sets of 4 ways (set index = virtual page number mod 16, LRU within a set). A loop touches virtual pages 0, 16, 32, 48, 64, 1, 17, 33 in that order, 6 times (48 references), starting with an empty TLB. How many TLB misses occur?

  1. A. 8
  2. B. 48
  3. C. 36
  4. D. 33

Correct answer: D. 33

Pages 0, 16, 32, 48 and 64 all map to set 0, so a cyclic walk over 5 pages with 4 ways under LRU misses every time (30 misses); pages 1, 17, 33 share set 1 (3 pages fit in 4 ways): 3 cold misses. Total 33. A fully associative 64-entry TLB would miss only 8 times.

More Operating Systems questions

Exams that ask this topic