Consider a system with 32bit addresses with a cache that has
Consider a system with 32-bit addresses with a cache that has line size of 64 bytes.
Assume 1 word = 1 byte.
If the cache is set-associative with each set size of 4 lines, and total capacity 4096 bytes, calculate:
1) Max RAM possible
2) Total number of cache lines in the cache
3) Total number of sets in cache
4) format of the 32 bit address to enable set associative mapping (tag, set, word)
Show your work.
Solution
Given data
Set lines = 4bits
Word is 6 since = 26 = 64
Set will be = (32 - 4-6) = 32-10 = 22 bits
1)
Max RAM possible is 232 bytes. Since system is 32 bit address.
-----------------------------------------------------------------------------------------------------------------------------------------------------------
2) Total number of cache lines are is equal to = number of lines x 2set bits == 22 x 222 == 224
------------------------------------------------------------------------------------------------------------------------------------------------------------
3) Number of sets = 2set bits = 222
----------------------------------------------------------------------------------------------------------------------------------------------------------
4)
Set lines = 4bits
Word is 6 since = 26 = 64 == 6 bits
Tag Set will be = (32 - 4-6) = 32-10 = 22 bits
