Gate CS-2008 Question Paper With Solutions

Q. 35 Consider a machine with a 2-way set associative data cache of size 64 Kbytes and block size 16 bytes. The cache is managed using 32 bit virtual addresses and the page size is 4 Kbytes. A program to be run on this machine begins as follows:

double ARR[1024][1024];
int i, j;
/*Initialize array ARR to 0.0 */
for(i = ; i < 1024; i++)
    for(j = ; j < 1024; j++)
        ARR[i][j] = 0.0;

The size of double is 8 bytes. Array ARR is located in memory starting at the beginning of virtual page xFF000 and stored in row major order. The cache is initially empty and no pre-fetching is done. The only data memory references made by the program are those to array ARR.

Which of the following array elements have the same cache index as ARR[][]?

(A) APR[0][4]

(B) APR[4][0]

(C) APR[0][5]

(D) APR[5][0]

Answer: (B)

Explanation:

Gate CS-2008 Question Paper With Solutions

 

Learn More:   Gate ME-2017-1 Question Paper With Solutions

LEAVE A REPLY

Please enter your comment!
Please enter your name here