Question

For a direct-mapped cache, 4 bits are used for the tag field and 12 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
Official answer and solution
Official answer
A
From
Official GATE 2025 answer key

Solution

Sum the tag, index, and byte-offset bits to find the main memory size, and multiply the number of cache lines (2122^{12}) by the block size (11 byte) for the cache size.

  1. Since the cache block size is 1 byte=20 bytes1\text{ byte} = 2^0\text{ bytes} in a byte-addressable system, the block offset field requires 0 bits0\text{ bits}.
  2. Total physical address length =Tag+Index+Offset=4+12+0=16 bits= \text{Tag} + \text{Index} + \text{Offset} = 4 + 12 + 0 = 16\text{ bits}.
    • Main memory size =216 bytes=64 KB= 2^{16}\text{ bytes} = 64\text{ KB}.
  3. Number of cache blocks =212=4096= 2^{12} = 4096, each of size 1 byte1\text{ byte} (with no extra tag/status bits stored per the problem statement, or counting data capacity):
    • Cache memory size =212×1 byte=4 KB= 2^{12} \times 1\text{ byte} = 4\text{ KB}.
Final answer

Option (A)

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2025 Computer Science and Information Technology - Session 2 (CS2)
Question
39 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.