1. Here is a series of address references given as word addresses: 3, 3, 11, 11,
ID: 3844676 • Letter: 1
Question
1. Here is a series of address references given as word addresses: 3, 3, 11, 11, 12, 15, 16, 12, 23, 1, 2, 3, 46, 47, 19, 11, 3, 22, 4, 27, 26, and 11.
-Assuming a direct mapped cache with 16 one-word blocks that is initially empty, please do the following: (1) label each reference in the list as a hit or a miss, (2) clearly show the final contents of the cache, and (3) show the total number of hits and misses.
-Repeat the above (1), (2), and (3) assuming now we use a direct mapped cache with 4 four-word blocks (i.e. each block contains 4 words and total we have four blocks so the total size of cache remains as16 words.)
Explanation / Answer
Cache size: 16 blocks
Block size: 1 word
So
offset: 0bit
index : 4bits
tag : 4bits (considering 8bit addressing system)
address tag index offset hit/Miss
3 0000 0011 Miss
3 0000 0011 Hit
11 0000 1011 Miss
11 0000 1011 Hit
12 0000 1100 Miss
15 0000 1111 Miss
16 0001 0000 Miss
12 0000 1100 Hit
23 0001 0111 Miss
1 0000 0001 Miss
2 0000 0010 Miss
3 0000 0011 Hit
46 0010 1110 Miss
47 0010 1111 Miss
19 0001 0011 Miss
11 0000 1011 Hit
3 0000 0011 Miss
22 0001 0110 Miss
4 0000 0100 Miss
27 0001 1011 Miss
26 0001 1010 Miss
11 0000 1011 Miss
Misses: 17
Hits: 5
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Cache size: 4 blocks
Block size: 4 words
So
offset: 2bits
index : 2bits
tag : 4bits (considering 8bit addressing system)
address tag index offset hit/Miss
3 0000 00 11 Miss
3 0000 00 11 Hit
11 0000 10 11 Miss
11 0000 10 11 Hit
12 0000 11 00 Miss
15 0000 11 11 Miss
16 0001 00 00 Miss
12 0000 11 00 Hit
23 0001 01 11 Miss
1 0000 00 01 Hit
2 0000 00 10 Hit
3 0000 00 11 Hit
46 0010 11 10 Miss
47 0010 11 11 Hit
19 0001 00 11 Miss
11 0000 10 11 Hit
3 0000 00 11 Miss
22 0001 01 10 Hit
4 0000 01 00 Miss
27 0001 10 11 Miss
26 0001 10 10 Hit
11 0000 10 11 Miss
Miss: 12
Hit: 10
Here you go champ. I have kept things simple and and tried my best to explain to the point. If incase you are still facing problem with the answer, please feel free to comment below. I shall be glad to help you.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.