GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A fully associative cache (block = one word) sees the block reference string 1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5, starting empty. How many misses occur with FIFO replacement and 3 lines, with FIFO and 4 lines, and with LRU and 4 lines?

  1. A. 9, 10 and 8
  2. B. 9, 8 and 8
  3. C. 10, 9 and 8
  4. D. 9, 10 and 10

Correct answer: A. 9, 10 and 8

FIFO with 3 lines: 9 misses; with 4 lines: 10 — more lines, more misses (Belady's anomaly), because FIFO is not a stack algorithm. LRU is a stack algorithm and can never get worse with more lines: 4 lines give 8 (3 lines give 10).

More Computer Organization and Architecture questions

Exams that ask this topic