GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A memory has B low-order interleaved banks (bank = word address mod B, any positive integer B). A bank stays busy for 6 cycles after an access starts, and the processor issues one access per cycle in order, stalling when the target bank is busy. A program streams through an array with a stride of 6 words. What is the smallest B for which the stream never stalls?

  1. A. 8
  2. B. 12
  3. C. 16
  4. D. 7

Correct answer: D. 7

With stride s the stream visits B / gcd(s, B) distinct banks in rotation, and it never stalls if each bank is revisited no sooner than 6 accesses later: B / gcd(6, B) ≥ 6. B = 6: 1 bank; B = 7: gcd 1 → 7 banks ✓. B = 8 uses only 4 banks and 12 only 2; 16 works (8 banks) but is not the smallest. A prime bank count avoids stride conflicts.

More Computer Organization and Architecture questions

Exams that ask this topic