edited by
8,836 views
32 votes
32 votes

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 = 0; i < 1024; i++)
    for(j = 0; j < 1024; j++)
        ARR[i][j] = 0.0;


The size of double is $8$ bytes. Array $\text{ARR}$ is located in memory starting at the beginning of virtual page $\textsf{0xFF000}$ 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 $\text{ARR}$.

The cache hit ratio for this initialization loop is:

  1. $0\%$
  2. $25\%$
  3. $50\%$
  4. $75\%$
edited by

6 Answers

0 votes
0 votes

It brings 16 bytes(1 block = 16 bytes) at once, which is equal to 2 array elements(each element 8 bytes). Thus every alternate access will be a hit. 50%

0 votes
0 votes

……………………………………………………..

Answer:

Related questions

16.2k
views
6 answers
62 votes
go_editor asked Apr 23, 2016
16,220 views
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 ... }$\text{ARR[4][0]}$\text{ARR[0][5]}$\text{ARR[5][0]}$
19.4k
views
4 answers
61 votes
Kathleen asked Sep 12, 2014
19,425 views
Consider a machine with a $2$-way set associative data cache of size $64\text{Kbytes}$ and block size $16\text{bytes}$ ... $34\text{Kbits}$64\text{Kbits}$68\text{Kbits}$
25.1k
views
3 answers
61 votes
Kathleen asked Sep 12, 2014
25,081 views
For inclusion to hold between two cache levels $L_1$ and $L_2$ in a multi-level cache hierarchy, which of the following are necessary?$L_1$ ... $L_1$ cacheIV onlyI and IV onlyI, II and IV onlyI, II, III and IV
15.9k
views
7 answers
50 votes
go_editor asked Apr 23, 2016
15,876 views
Delayed branching can help in the handling of control hazardsThe following code is to run on a pipelined processor with one branch delay slot:I1: ... or I4 can legitimately occupy the delay slot without any program modification?I1I2I3I4