GATE Computer ScienceHardGATE CS (PYQ pattern)

A direct-mapped cache has 2 lines of 4 words each. The word-address trace is ['W0', 'W1', 'W2', 'W3', 'R0', 'R1', 'W8', 'W9', 'R8', 'R0'] (R = read, W = write). Count memory transactions as block fetches + single-word writes + dirty-block write-backs, and do not flush dirty blocks at the end. How many transactions occur under (i) write-back with write-allocate and (ii) write-through with no-write-allocate, as (i, ii)?

  1. A. (6, 9)
  2. B. (9, 5)
  3. C. (5, 11)
  4. D. (5, 9)

Correct answer: D. (5, 9)

(i) WB+WA: block fetches, plus dirty write-backs on eviction (fetch, ww, wb) = (3, 0, 2); (ii) WT+NWA: write misses go straight to memory and every write sends a word: (fetch, ww, wb) = (3, 6, 0). Simulate the two lines block by block.

More Computer Organization and Architecture questions

Exams that ask this topic