GateAI
Cache Memory and Hierarchy

GATE CSE 2023 · Q64

NAT2 marksEasy

Time

An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET. The number of bits in the TAG is __________.

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 19

Cache Memory and Hierarchy

To determine the number of bits in the TAG, let:

  • Total address bits = 3232

  • Cache size C=64 KB=216 bytesC = 64\text{ KB} = 2^{16}\text{ bytes}

  • Set associativity P=8=23 lines per setP = 8 = 2^3\text{ lines per set}

  • Block size B=2b bytesB = 2^b\text{ bytes}, which means the block offset requires bb bits.

The total number of cache lines is:

Number of Lines=Cache SizeBlock Size=2162b=216−b\text{Number of Lines} = \frac{\text{Cache Size}}{\text{Block Size}} = \frac{2^{16}}{2^b} = 2^{16-b}

The number of sets in the cache is:

Number of Sets=Number of LinesAssociativity=216−b23=213−b\text{Number of Sets} = \frac{\text{Number of Lines}}{\text{Associativity}} = \frac{2^{16-b}}{2^3} = 2^{13-b}

Thus, the number of index bits is:

INDEX bits=log⁡2(213−b)=13−b\text{INDEX bits} = \log_2(2^{13-b}) = 13 - b

In a 32-bit address architecture, the address is divided as:

Total Address Bits=TAG bits+INDEX bits+BLOCK OFFSET bits\text{Total Address Bits} = \text{TAG bits} + \text{INDEX bits} + \text{BLOCK OFFSET bits}
32=TAG bits+(13−b)+b32 = \text{TAG bits} + (13 - b) + b
32=TAG bits+1332 = \text{TAG bits} + 13
TAG bits=32−13=19\text{TAG bits} = 32 - 13 = 19

Hence, the number of bits in the TAG is 19.

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 Q64 of the GATE CSE 2023 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 NAT questions like this one, and GATE CSE 2023 has 2.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2023

Share this solution

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

GateAI solution cardGATE CSE 2023 · Q64 · NAT

An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET. The number of bits in the TAG is …

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.