GATE Computer ScienceVery hardGATE CS

A write-back, write-allocate cache is direct mapped with 4 lines of one word (line = address mod 4). Starting empty, it serves these (operation, word address) pairs: R0, W4, R0, W1, R5, W5, R2, W6, R1, W2, R3, R7, W0, R4. Count one memory transaction for every line fill and for every write-back of a dirty line that is evicted (do not flush the cache at the end). How many memory transactions occur?

  1. A. 12
  2. B. 19
  3. C. 13
  4. D. 17

Correct answer: D. 17

Simulation shows 12 of the 14 accesses miss (12 line fills) and 5 dirty lines are evicted, so 12 + 5 = 17. A write-through no-allocate cache would need 13.

More Computer Organization and Architecture questions

Exams that ask this topic