GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Three caches with 4 one-word lines each see the word-address trace [0, 4, 0, 8, 4, 0, 12, 4, 0, 8]: (i) direct-mapped, (ii) 2-way set-associative with LRU, (iii) fully associative with LRU. How many hits does each get, written as (i, ii, iii)?

  1. A. (0, 1, 6)
  2. B. (1, 1, 6)
  3. C. (6, 1, 0)
  4. D. (0, 6, 1)

Correct answer: A. (0, 1, 6)

All of 0,4,8,12 are multiples of 4, so they fight for one line in (i) and one 2-line set in (ii); in (iii) they share all 4 lines. Simulating: (i) never hits because consecutive references differ, (ii) hits once, (iii) hits 6 times.

More Computer Organization and Architecture questions

Exams that ask this topic