Question

Consider a memory system with 1M bytes of main memory and 16K 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 values? [Assume memory is byte addressable, 1K=210\text{1K}=2^{10}, 1M=220\text{1M}=2^{20}.]

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2025 answer key

Solution

Determine the number of cache lines and the tag width in bits for each line, then multiply them.

  1. Cache geometry:
    • Cache size =16 KB=214= 16\text{ KB} = 2^{14} bytes.
    • Block size =16 bytes=24= 16\text{ bytes} = 2^4 bytes   ⟹  \implies Byte offset =4= 4 bits.
    • Number of cache lines (blocks) =21424=210= \frac{2^{14}}{2^4} = 2^{10} lines   ⟹  \implies Line index =10= 10 bits.
  2. Tag size per cache line:
    • Memory address =20= 20 bits.
    • Tag bits per line =20−Index−Offset=20−10−4=6= 20 - \text{Index} - \text{Offset} = 20 - 10 - 4 = 6 bits.
  3. Total tag storage:
Total tag bits=Number of lines×Tag bits per line=6×210\text{Total tag bits} = \text{Number of lines} \times \text{Tag bits per line} = 6 \times 2^{10}
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 1 (CS1)
Question
36 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.