GATE Computer ScienceHardGATE CS (PYQ pattern)

A 64-byte, 2-way set-associative cache with 8-byte blocks and LRU replacement is empty. The processor reads these byte addresses in order: [0, 8, 64, 72, 0, 16, 64, 8, 128, 0, 72, 136, 16, 64]. How many of the 14 reads hit?

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

Correct answer: C. 5

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

More Computer Organization and Architecture questions

Exams that ask this topic