GATE Computer ScienceVery hardGATE CSE · UGC NET

A 256×256 array of 4-byte integers is stored in row-major order starting at address 0. A 16 KB direct-mapped cache has 32-byte lines (512 lines). The array is traversed column by column (for each column i, for each row j, read A[j][i]). How many cache misses occur in total?

  1. A. 8192
  2. B. 32768
  3. C. 65536
  4. D. 16384

Correct answer: C. 65536

A column step is 1024 bytes = 32 lines, so only 16 distinct sets are used by a column and rows j and j+16 conflict; every access misses: 65536 (= 256×256), versus 8192 for row-major order.

More Computer Organization and Architecture questions

Exams that ask this topic