GATE Computer ScienceHardGATE CS · ISRO

A write-back, write-allocate, direct-mapped cache has 4 one-block lines (line = block number mod 4) and starts empty. The block accesses in order are W0, R4, W8, R0, W4, R12, W0, R8, W12, R4 (W = write, R = read). How many dirty blocks are written back to memory during the sequence, not counting those still dirty in the cache at the end?

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

Correct answer: C. 5

All the blocks map to line 0; each replacement of a dirty block causes one write-back, and the simulation gives 5.

More Computer Organization and Architecture questions

Exams that ask this topic