GATE Computer ScienceHardGATE CSE · NIELIT

A 2-way set-associative cache with 4 sets (set = address mod 4), LRU replacement and one word per line starts empty. The word addresses 0, 4, 8, 0, 4, 1, 5, 0, 8, 4, 1, 9, 5, 0, 4 are accessed in order. How many hits occur?

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

Correct answer: D. 3

Addresses 0, 4, 8 compete for the 2 ways of set 0 and 1, 5, 9 for set 1; an LRU simulation gives 3 hits.

More Computer Organization and Architecture questions

Exams that ask this topic