A CPU has a 32 KB direct mapped cache with 128 byte block size. Suppose A is a…

ISRO Scientist/Engineer SC · December 2017 · Computer Science

A CPU has a 32 KB direct mapped cache with 128 byte block size. Suppose A is a 2 dimensional array of size 512×512 with elements that occupy 8 bytes each. Consider the code segment

for (i =0; i < 512; i++) {
  for (j =0; j < 512; j++) {
    x += A[i][j];
  }
} 

Assuming that array is stored in order A[0][0], A[0][1], A[0][2]……, the number of cache misses is

  1. A.

    16384

  2. B.

    512

  3. C.

    2048

  4. D.

    1024

Attempted by 460 students.

Show answer

Correct answer: A

The worked solution is available to enrolled students.

Video solution available to enrolled students.

Explore the full course: Iocl Engineers Officers Grade A Paper 2

Loading lesson…