Determining Tag,set,offset, and hits/misses in Cache block

0

Hello I have this problem on my homework and I wanted to check to make sure I was doing it right?

Consider a 16B direct-mapped cache with 8B blocks and 2 sets for an 8-bit architecture (i.e., 256 bytes of memory):

a. How many address bits are used to represent the cache set?

b. How many address bits are used to represent the cache tag?

c. Consider the following sequence of memory accesses. For each address, show the tag, set, offset, whether it resulted in hit or miss, and the state of all valid lines in the cache following the access:

0x00

0x08

0x04

0x0a

0x00

So in order to determine the set I am guessing that it's just 1 bit since you use log base of 2 on the number of sets you have (given is 2) and then you only get 1 bit for the set

For the tag the formula would be tag = total bits - set - offset and the offset is 3 because its a 8 bit architecture and log base of 8 would be 3 so the tag is 4 bits

Now I know that if I split up a 8 bit address the first 4 would be the tag, 5th would be the set, and 6-8 is the offset.

so the given addresess in 8-bit form would be

0x00000000

0x00001000

0x00000100

0x00001010

0x00000000

And for these 5 it would be a miss,miss,hit,miss,hit. Can anyone confirm if my line of thinking is correct here?

caching
tags
set
block
offset

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0