retagged by
508 views
1 votes
1 votes

Suppose in a system we store data using arrays, we have $2$ arrays A1 and A2.  Array A1 contains $256$ elements of size $4$ bytes each. The first element is stored at physical address $4096$. Another array A2 contains $512$ elements of size $4$ bytes each,  stored from physical address location $8192$.

Assume that only arrays A1 and A2 can be cached in an initially empty, physically addressed, physically tagged, direct mapped cache whose size is $2$ KB with $8$ byte block size. Now we run below loop in the system:

for( p=0; p<256; p++)
{
A[p] = A[p] + B[2*p]
}

If the cache use write back policy, the number of bytes that will be written to memory during execution of the loop is :

  1. $256$
  2. $1$
  3. $0$
  4. $2048$
retagged by

1 Answer

Best answer
1 votes
1 votes
Here Write Back policy is used , in write back the information is written only to the block in the cache. The modified cache block is written to main memory only when it is replaced.

Only Cache is updated so no bytes is written in memory during execution of the loop which gives answer 0 .
selected
Answer:

Related questions