Skip to content
Official PYQ · 2025

GATE CS 2025 Set 2 Q29 — Memory Hierarchy: Cache, Main Memory and Secondary Storage

Explain with AI

​​​​For a direct-mapped cache, 44 bits are used for the tag field and 1212 bits are used to index into a cache block. The size of each cache block is one byte. Assume that there is no other information stored for each cache block.

Which ONE of the following is the CORRECT option for the sizes of the main memory and the cache memory in this system (byte addressable), respectively?

Choose one option
View worked solution

Answer: A

To find the sizes of the main memory and the cache memory, we analyze the fields of the physical address in a direct-mapped cache system.

1. Physical Address Format

For a direct-mapped cache, the physical address is divided into three fields:

Physical Address=Tag+Index+Block Offset\text{Physical Address} = \text{Tag} + \text{Index} + \text{Block Offset}

2. Calculating the Fields

  • Block Offset: The system is byte-addressable, and the size of each cache block is 11 byte. Block Offset bits=log⁡2(Block Size)=log⁡2(1)=0 bits\text{Block Offset bits} = \log_2(\text{Block Size}) = \log_2(1) = 0 \text{ bits}
  • Index Field: Given as 1212 bits (used to select/index the cache block).
  • Tag Field: Given as 44 bits.

3. Main Memory Size

The total number of bits in the physical address is:

Physical Address Size=4 (Tag)+12 (Index)+0 (Block Offset)=16 bits\text{Physical Address Size} = 4 \text{ (Tag)} + 12 \text{ (Index)} + 0 \text{ (Block Offset)} = 16 \text{ bits}

Since the system is byte-addressable, the Main Memory size is:

Main Memory Size=216 bytes=64 KB\text{Main Memory Size} = 2^{16} \text{ bytes} = 64 \text{ KB}

4. Cache Memory Size

The number of lines (or blocks) in the cache is determined by the index bits:

Number of Cache Lines=212=4096\text{Number of Cache Lines} = 2^{12} = 4096

The cache memory size (data capacity) is:

Cache Size=Number of Cache Lines×Block Size=4096×1 byte=4 KB\text{Cache Size} = \text{Number of Cache Lines} \times \text{Block Size} = 4096 \times 1 \text{ byte} = 4 \text{ KB}

Thus, the main memory size is 6464 KB and the cache memory size is 44 KB, which corresponds to Option A.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Memory Hierarchy: Cache, Main Memory and Secondary Storage questions