GATE Computer ScienceHardGATE CS (PYQ pattern)

A direct-mapped cache has 2 lines of 4 words each. A program writes (once each) to word addresses 0, 4, 8, 12, 16, 20, 24, 28 and never reads or revisits them. Counting block fetches, single-word writes and dirty-block write-backs (no flush at the end), how many transactions are there under (i) write-back + write-allocate and (ii) write-through + no-write-allocate?

  1. A. (14, 16)
  2. B. (12, 8)
  3. C. (8, 14)
  4. D. (14, 8)

Correct answer: D. (14, 8)

Write-allocate fetches the block for every write miss (8) and later writes back the dirty ones (6); no-write-allocate just forwards each word write (8). Streaming writes with no reuse is the case where write-allocate loses.

More Computer Organization and Architecture questions

Exams that ask this topic