GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A memory has 8 low-order interleaved banks (bank = word address mod 8). An access started in cycle t keeps its bank busy in cycles t … t+5 (6 cycles) and completes at the end of cycle t+5. The processor starts at most one access per cycle, in program order, the first in cycle 1, and waits whenever the next access's bank is busy. How many cycles are needed to complete 64 accesses with stride 3 (addresses 0, 3, 6, …), and with stride 6 (addresses 0, 6, 12, …)?

  1. A. 69 and 69
  2. B. 69 and 193
  3. C. 69 and 99
  4. D. 99 and 99

Correct answer: C. 69 and 99

Stride 3 is coprime to 8, so the accesses cycle through all 8 banks and a bank is revisited after 8 > 6 cycles: one access per cycle, last starts in cycle 64, done at 69. Stride 6 shares the factor 2 with 8, so only 8/gcd(6,8) = 4 banks are used (0, 6, 4, 2); each bank is reused every 4 accesses but needs 6 cycles, so 4 accesses per 6 cycles: simulation gives 99. (193 would be stride 4, which uses only 2 banks.)

More Computer Organization and Architecture questions

Exams that ask this topic