GateAI
Cache Memory and Hierarchy

GATE CSE 2021 Set 1 · Q22

NAT1 markMedium

Time

Consider a computer system with a byte-addressable primary memory of size 2322^{32} bytes. Assume the computer system has a direct-mapped cache of size 32 KB (1 KB=2101\text{ KB} = 2^{10} bytes), and each cache block is of size 64 bytes. The size of the tag field is ________ bits.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 17 (±0)

Cache Memory and Hierarchy
  1. Physical Address bits:

    • Primary memory size = 2322^{32} bytes.

    • Physical address space requires $\log_2(2^{32}) = 32$ bits.

  2. Block Offset (Word Offset) bits:

    • Cache block (line) size = 64 bytes=2664\text{ bytes} = 2^6 bytes.

    • Number of block offset bits = log⁡2(26)=6\log_2(2^6) = 6 bits.

  3. Cache Line (Index) bits:

    • Total cache size = 32 KB=32×210 bytes=21532\text{ KB} = 32 \times 2^{10}\text{ bytes} = 2^{15} bytes.

    • Number of cache lines = Cache SizeBlock Size=21526=29=512\frac{\text{Cache Size}}{\text{Block Size}} = \frac{2^{15}}{2^6} = 2^9 = 512 lines.

    • Number of index bits = log⁡2(29)=9\log_2(2^9) = 9 bits.

  4. Tag bits:

    • In a direct-mapped cache:

      Tag bits=Address bits−(Index bits+Block offset bits)\text{Tag bits} = \text{Address bits} - (\text{Index bits} + \text{Block offset bits})
      Tag bits=32−(9+6)=32−15=17 bits\text{Tag bits} = 32 - (9 + 6) = 32 - 15 = 17\text{ bits}

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 Q22 of the GATE CSE 2021 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. 7 of them are 1-mark NAT questions like this one, and it is the only one in GATE CSE 2021 Set 1.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2021 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2021 Set 1 · Q22 · NAT

Consider a computer system with a byte-addressable primary memory of size 232 bytes. Assume the computer system has a direct-mapped cache of size 32 KB (1 KB = 210 bytes), and each cache block is of size 64 bytes. The size of the tag field is … bits.

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.