GATE Computer ScienceVery hardGATE CS (PYQ pattern)

A loop computes y[i] += A[i][j] × x[j] for a 64×64 matrix of 4-byte floats (A in row-major order at address 0, x at 16384, y at 17024); for each (i, j) it reads A[i][j] and x[j], and y[i] is read once per row. The data cache is 2 KB direct-mapped with 32-byte blocks. How many misses occur in total, and how many in a 2-way LRU cache of the same size, as (direct, 2-way)?

  1. A. (528, 528)
  2. B. (528, 1488)
  3. C. (1488, 1488)
  4. D. (1488, 528)

Correct answer: D. (1488, 528)

Simulate every reference. The compulsory minimum is 528; in the direct-mapped cache blocks of A and of x map to the same lines and keep evicting x, giving 1488, while 2-way LRU gives 528.

More Computer Organization and Architecture questions

Exams that ask this topic