821 views

1 Answer

Best answer
1 votes
1 votes
Q 1  A

Size of element= 4 word

size of Block= 8 word

Number of Block= 4

When A[0] is loaded int wold be a cache miss and along with A[0] A[1] will also be loaded, so for A[1] it would be hit

Similar for A{2] cache miss and for A[3] cache hit

So for half of elements there would be Hit and for Half There Would be Miss

Hit Rate-Miss Rate=50%

Q 2 A

Here block size, number of block, and element size is same as above question

Only difference is we are loading element in Column Major Order

so when A[0][0] is cache miss along with it A[0][1] will be also loaded in block 1

but in next iteration A[1][0] is called so cache miss and along with A[1][1] will be loaded in block 2

similarly block 3 will have A[2][0] and A[2][1]

block 4 will have A[3][0] and A[3][1]

now for A[4][0] cache miss will occur it will loaded in block 1

in short for every element we will have cache miss

cache miss= 100%, cache hit = 0%
selected by

Related questions

0 votes
0 votes
0 answers
3
amitqy asked Mar 16, 2019
305 views
Can someone please provide a link to an article or a video explaining cache and arrays concept. Im having a hard time understanding that concept.