Consider a machine with a byte addressable main memory of 216 bytes and block size of 8 bytes. Assume that a direct mapped cache consisting of 32 lines used with this machine. How many bits will be there in Tag. line and word field of format of main memory addresses ?
Consider a machine with a byte addressable main memory of 216 bytes and block size of 8 bytes. Assume that a direct mapped cache consisting of 32 lines used with this machine. How many bits will be there in Tag. line and word field of format of main memory addresses ? Correct Answer 8, 5, 3
The correct answer is option 1.
Key Points
Direct Mapping:
Given Data,
Main memory size =216 bytes
No of blocks in Main memory (M)=216 ÷ 23
Block Size (P)= 23 bytes
No of blocks in the cache memory (N) =25 bytes
Tag=28=Tag bits= log2(M/N)
line or cache block= 25 =cache block bits= log2N
word field or word offset= 23=word offset bits=log2P
∴ Hence the correct answer is (8,5,3).
Important Points
N = No of blocks in cache memory =(cache memory size)/Block size
M= No of blocks in main memory = (main memory size)/Block size
P=Block size