Memory Mapping Formula Cheatsheet

1. Physical Address (in bits):

$$ Physical Address Bits=log⁡2(Main Memory Size in Bytes)\text{Physical Address Bits} = \log_2(\text{Main Memory Size in Bytes}) $$


2. Number of Blocks:


3. Block Offset (Word Offset):

$$ Block Offset Bits=log⁡2(Block Size in Bytes)\text{Block Offset Bits} = \log_2(\text{Block Size in Bytes}) $$


4. Cache Index (Direct Mapping Only):

$$ Cache Block Index Bits=log⁡2(Number of Blocks in Cache)\text{Cache Block Index Bits} = \log_2(\text{Number of Blocks in Cache}) $$


5. Tag Bits:


6. Set Offset (Set Associative Mapping Only):