A computer has 16 MB RAM with each memory word of 32 bits. It has cache memory having 512 blocks having a size of 128 bits (4 memory words). Show how the main memory address (CA30FB)h will be mapped to cache address, if
(i) Direct cache mapping is used
(ii) Associative cache mapping is used
(iii)Two way set associative cache mapping is used.
You should show the size of tag, index, main memory block address and offset in your answer.
Main memory size =16 MB"=2^{16}B"
Cache memory size"=128B=2^{7}B"
Block size "=512" block"=2^{9}"
Number of sets"=2^9\/2^2=2^7"
Here 7 would be the required for index
Number of bits for tag=256
Blocks can be anywhere in the cache.
Size of cache =7
Location of block 12 in cache = 12 mod 8=4
Number of blocks in set =2
Number of sets =256
Number of bits for tag =24-(7+8)=9
Comments
Leave a comment