Consider a memory system with bytes of main memory and bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the values? [Assume memory is byte addressable, , .]
GATE CSE 2025CO & Architecture › Memory Hierarchy & Cache OrganizationVerified
GATE CSE 2025 PYQ: Consider a memory system with 1 M 1 \mathrm{M} 1 M bytes of main memory and 16 K 16 \mathrm{~K} 16 K bytes…
- ACorrect answer
- B
- C
- D
Answer
(A) 6 × 2 10 6 \times 2^{10} 6 × 2 10
Approach
For a direct-mapped cache, split the physical address into tag, index, and offset fields. The offset is determined by the block size, the index by the number of cache blocks/lines, and the tag is whatever remains. Then multiply the tag width by the number of cache lines to get the total tag storage.
The address is 20 bits. With 16-byte blocks, 4 bits are used for the byte offset. Since the cache has 16K bytes = $2^14$ bytes and each block is 16 bytes = $2^4$ bytes, it contains $2^10$ lines. Thus 10 bits are used for the index. The remaining tag width is 20 - 10 - 4 = 6 bits. Across all $2^10$ lines, total tag storage is 6 * $2^10$ bits, which is option A.
Reviewed by GateIQ Editorial Team: IIT & IISc Alumni.