GATE Computer ScienceHardGATE CS (PYQ pattern)

A 64-byte, 2-way set-associative cache with 16-byte blocks and LRU replacement is empty. The processor reads these byte addresses in order: [20, 0, 20, 140, 0, 220, 20, 160, 160, 140, 100, 40]. How many of the 12 reads hit?

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

Correct answer: B. 4

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

More Computer Organization and Architecture questions

Exams that ask this topic