Skip to main content

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…

Consider a memory system with 1M1 \mathrm{M} bytes of main memory and 16 K16 \mathrm{~K} 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 tag⁡\operatorname{tag} values? [Assume memory is byte addressable, 1 K=2101 \mathrm{~K}=2^{10}, 1M=2201 \mathrm{M}=2^{20}.]

  1. A
    6×2106 \times 2^{10}
    Correct answer
  2. B
    8×2108 \times 2^{10}
  3. C
    2122^{12}
  4. D
    2142^{14}

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.