Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Memory / Cache 1) Supposed we have a 1KB direct-mapped data cache with 4 byte bl

ID: 3843260 • Letter: M

Question

Memory / Cache

1)    Supposed we have a 1KB direct-mapped data cache with 4 byte blocks.

a.     Show how a 32-bit memory address is divided into tag, index and offset. Show clearly how many bits are in each field.

b.     How many total bits are there in this cache?

c.     Consider this address trace:

0x807bfc4

0x807b1dc

0x907bfc4

0x806ce04

0x807b1e0

0x806ce0c

0x807b1e4

0x806ce0c

0x807bfc4

0x806ce14

For this cache, for each address in the above trace, show the tag, index and offset in binary. Indicate whether each reference is a hit or a miss. What is the miss rate?

Explanation / Answer

a.     Show how a 32-bit memory address is divided into tag, index and offset. Show clearly how many bits are in each field.

b.     How many total bits are there in this cache?

2offset = 22 bytes
=> offset = 2

Total cache size = 4 bytes 2index

=> 1KB / 4 =  2index
=> 2index = 210 / 4 = 28
index = 8 bits

=> Tag = 32 - 8 - 2 = 22

Tag : 22
Offset : 2
Index: 8



Total bits in Cache means the size which is 1KB = 210 => 10 bits


Thanks