GateAI
Cache Memory and Hierarchy

GATE CSE 2025 Set 1 · Q36

MCQ2 marksEasy

Time

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\textit{tag} values? [Assume memory is byte addressable, 1K=2102^{10}, 1M=2202^{20}.]

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) 6 × 210

Cache Memory and Hierarchy

Given parameters:

  • Main memory size =1 MB=220 bytes= 1\text{ MB} = 2^{20}\text{ bytes}, which corresponds to a 20-bit physical address.

  • Cache memory size =16 KB=16×210 bytes=214 bytes= 16\text{ KB} = 16 \times 2^{10}\text{ bytes} = 2^{14}\text{ bytes}.

  • Block size (line size) =16 bytes=24 bytes= 16\text{ bytes} = 2^4\text{ bytes}.

  1. Block/Word Offset bits:

    Offset bits=log⁡2(16)=4 bits\text{Offset bits} = \log_2(16) = 4\text{ bits}
  2. Number of lines in the cache:

    Number of lines=Cache sizeBlock size=16 KB16 B=1024=210 lines\text{Number of lines} = \frac{\text{Cache size}}{\text{Block size}} = \frac{16\text{ KB}}{16\text{ B}} = 1024 = 2^{10}\text{ lines}
  3. Cache line index bits (for direct mapping):

    Index bits=log⁡2(210)=10 bits\text{Index bits} = \log_2(2^{10}) = 10\text{ bits}
  4. Tag bits per line:

    Tag bits=Address bits−(Index bits+Block offset bits)=20−(10+4)=6 bits\text{Tag bits} = \text{Address bits} - (\text{Index bits} + \text{Block offset bits}) = 20 - (10 + 4) = 6\text{ bits}
  5. Total bits required to store all tag values in the cache:

    Total tag memory=Number of lines×Tag bits per line=210×6=6×210 bits\text{Total tag memory} = \text{Number of lines} \times \text{Tag bits per line} = 2^{10} \times 6 = 6 \times 2^{10}\text{ bits}

Therefore, option (A) is the correct answer.

Try the question first, then check your work.

Think the official key or this write-up is wrong?

Report error or challenge

Examiner trap

The misconception this question tests

This Cache Memory and Hierarchy previous year question is Q36 of the GATE CSE 2025 Set 1 paper. Find more GATE CSE PYQs on Cache Memory and Hierarchy in Computer Organization and Architecture, or browse all GATE CSE PYQs.

Free diagnostic

Where do you stand for GATE?

Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Cache Memory and Hierarchy PYQs now with no account.

One GATE CSE PYQ every morning

An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.

Cache Memory and Hierarchy in GATE CSE

Cache Memory and Hierarchy has 47 GATE CSE PYQs across 23 papers from 2011 to 2026. 16 of them are 2-mark MCQs like this one, and GATE CSE 2025 Set 1 has 2.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2025 Set 1

Share this solution

A plain-text card for WhatsApp or Telegram study groups.

GateAI solution cardGATE CSE 2025 Set 1 · Q36 · MCQ

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, 1M=220.]

Topic-wise GATE CS PYQs with verified steps

Independent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.