edited by
593 views
1 votes
1 votes

Array A contains 256 elements of 4 bytes each. Its first element is stored at physical address 4,096. Array B contains 512 elements of 4 bytes each. Its first element is stored at physical address 8,192. Assume that only arrays A and B can be cached in an initially empty, physically addressed, physically tagged, direct-mapped, 2K-byte cache with an 8-byte block size. The following loop is then executed.
     for (i = 0; i < 256; i++)
          A[i] = A[i] + B[2 ∗ i];
During the execution of the loop, how many bytes will be written to memory if the cache has a write-through policy?

a. 0

b 256

c 1024

d 2048

edited by

2 Answers

0 votes
0 votes
their are 128 misses for A , containing 2 element each

->256 * 4 = 1024 byte
since it is write through policy(word wise write not block wise)
ans.
edited by

Related questions