GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A loop reads 128 words at addresses 0, 64, 128, …, 8128 and repeats this whole sweep three times. The cache is 4 KB, 2-way set-associative with LRU and 32-byte blocks. How many misses occur in total?

  1. A. 256
  2. B. 384
  3. C. 192
  4. D. 128

Correct answer: B. 384

The 128 addresses are in 128 different blocks (4 KB of cache holds 128 blocks), but with stride 64 only the even-numbered sets (index = 2i mod 64) are used, so 32 sets × 2 ways = 64 blocks fit; cyclic LRU thrashes every sweep, giving 128 misses per sweep and 3 × 128 = 384 in all.

More Computer Organization and Architecture questions

Exams that ask this topic