Q1. A direct-mapped cache has 64 lines, each line stores 32 bytes, and physical addresses are 24 bits. For a byte-addressable memory, how many bits are used for tag, line index, and block offset respectively?
Explanation
The block offset identifies a byte inside a 32-byte line, so it needs log2(32) = 5 bits. A direct-mapped cache with 64 possible lines needs log2(64) = 6 index bits. The physical address is 24 bits, so the remaining 24 - 5 - 6 = 13 bits form the tag used to test whether the indexed line is the requested block.
