GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A 128-byte, 2-way set-associative cache with 16-byte blocks and LRU replacement is empty. The processor reads these byte addresses in order: [4, 36, 68, 100, 4, 132, 36, 68, 164, 4, 196, 36]. How many of the 12 reads hit?

  1. A. 5
  2. B. 4
  3. C. 2
  4. D. 3

Correct answer: D. 3

Block = ⌊addr/16⌋, set = block mod 4. Tracking each set's LRU order gives 3 hits (FIFO would give 3; direct-mapped 3).

More Computer Organization and Architecture questions

Exams that ask this topic