577 views
0 0 votes
Computer uses a fully associative write-back data cache
Block size is 64 bytes,

Consider following code,

for(i=1;i<1024;i++)    {
              x[i] = b[i] * y;    // S1
              c[i] = x[i] + z;    // S2
            }

Assume x[1024], b[1024] and c[1024] are all double precision floating point arrays with arrays b and c already in cache,
moving x into the cache does not conflict with b or c
x[0] is stored at the beginning of a block

1)how many misses arise with respect to accessing x if the cache uses a no-write allocate policy?(Ans :256)
2)how many misses arise with respect to accessing x if the cache uses a write allocate policy?(Ans :128)

Are the answers correct?

Since the cache is write back first x[i] (S1) is write miss and second read miss will happen because of no write-allocate policy.

But on read miss ,block will be brought in, for other 7 elements it will be hit,so 2 misses for 1 block

Number of blocks=(1024*8)/64=128 hence 2*128=256 misses.

Am I  wrong somewhere?

Please log in or register to answer this question.

Position:
Show:

Related questions

1 1 vote
1 1 answer
3.8k
3.8k views
Raj_Choudhary asked Dec 4, 2017
3,760 views
a direct-mapped cache of the size of 4 blocks. The main memory block access sequences are 0,1,2,3,4,1,2,3,0,4,0 No. of compulsory misses, conflict misses and capacity mis...
1 1 vote
0 0 answers
687
687 views
KISHALAY DAS asked Oct 26, 2016
687 views