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 :
- $256$
- $1$
- $0$
- $2048$