GATE CSE
First time here? Checkout the FAQ!
x
0 votes
147 views
Consider below code written in C  
         Loop A
sum = 0;
 for (i = 0; i < 128; i++)
for (j = 0; j < 64; j++)
        sum += A[i][j];
         Loop B
sum = 0;
for (j = 0; j < 64; j++)
for (i = 0; i < 128; i++)
                                    sum += A[i][j];
The matrix A is stored contiguously in memory in row-major order. Consider a 4KB direct-mapped data cache with 8-word (32-byte) cache lines.

Calculate the number of cache misses that will occur when running Loop A.

i)1392 misses

ii) 1024 misses

iii)1020 misses

iv)1323 misses
asked in CO & Architecture by Boss (6.4k points)  
retagged by | 147 views
array element size is not given...

if we take as one word than 1024 misses are there ....

plz confirm...

1 Answer

0 votes
what is the size of array elements???
answered by (55 points)  

Related questions



Top Users Sep 2017
  1. Habibkhan

    8796 Points

  2. rishu_darkshadow

    3588 Points

  3. Warrior

    2914 Points

  4. Arjun

    2840 Points

  5. A_i_$_h

    2550 Points

  6. manu00x

    2268 Points

  7. nikunj

    1990 Points

  8. Bikram

    1874 Points

  9. makhdoom ghaya

    1820 Points

  10. SiddharthMahapatra

    1718 Points


26,346 questions
33,929 answers
80,525 comments
31,231 users