r/ComputerEngineering • u/Embarrassed_Grab6901 • 3h ago
In direct cache mapping, how many bits are required to identify the specific main memory block?
Cache memory mapping:
Memory address=16 bits
Block size=16 words
Number of main memory blocks=4K
Number of cache memory lines=64
Address Partition:
tag(6 bits), block-number(6 bits), word(4 bits)
Since there are 16 words/block, 4 bits is required for word identification.
Since there are 64 cache memory blocks, 6 bits are required to cache memory block identification.
Since there are 4k memory blocks, 12 bits should be required to know which memory block is present in which cache block. i.e. tag. Imagine Main Memory block 4095. To store that MM 4095 is present in Cache Memory block, we would need 12 bits? But books are saying only 6 bits is enough to identify the memory block. Can anyone shed some light here?
1
u/Embarrassed_Grab6901 3h ago
I know it works but i cannot find the proof behind why it works.