retagged by
381 views
0 votes
0 votes

A two-dimensional array int $a [32] [32]$ where each element takes $2$ byte, cache size $2^{12}$  bytes and line size is $2^6$  bytes. The following program segment is stored in the direct mapped cache.

for ( i= 1; i<= 32; ++ i)
for (j= 0; j<= 31; ++ j)
a[i][ j] = 0

If initially cache is empty then total number of compulsory cache miss for storing above array is ________

retagged by

1 Answer

Best answer
1 votes
1 votes

It is due total array element size occupy 32*32*2 bytes=$2^{11}$ bytes

where the cache size is $2^{12}$ bytes

Now each cache word size is $2^6$ bytes

so in first $2^{11}$/  $2^6$ references all array items in cache so compulsory misses are = $2^5$ = 32

edited by
Answer:

Related questions