1. Suppose we have a 32KB direct-mapped data cache with 32-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?
2. Suppose we have a 8KB direct-mapped data cache with 64-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?
1. Given-
Number of Bits in Block Offset-
we have,
Block size
=32 byte
= bytes
Thus, Number of bits in block offset= 5 bits
Number of bits in index number-
Total number of the lines in cache
= Cache size/ Line size
=32 KB/32 bytes
= bytes/ bytes
= lines
Thus, Number of bits in index number= 10 bits
Number of bits in tag
= Number of bits in physical address – (Number of bits in index number + Number of bits in block offset)
=32 bits -(10 bits + 5 bits)
=32 bits - 15 bits
=17 bits
Thus, number of bits in tag= 17 bits
b. Size of cache memory
=32 KB
= bytes
Thus, total number of bits in cache= 15.
Get Answers For Free
Most questions answered within 1 hours.