GateAI
Cache Memory and Hierarchy

GATE CSE 2026 Set 1 · Q38

MCQ2 marksMedium

Time

The size of the physical address space of a processor is 2322^{32} bytes. The capacity of a cache memory unit is 2232^{23} bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a KK-way set-associative cache, where K=2LK = 2^L and L∈{1,2,3}L \in \{1, 2, 3\}. Let the length of the TAG field be MM bits for the direct mapped cache, and NN bits for the set-associative cache. Which one of the following options is true?

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: A) N = M + L

Cache Memory and Hierarchy

Given:

  • Physical Address Space =232 bytes  ⟹  = 2^{32}\text{ bytes} \implies Physical Address (PA)=32 bits(\text{PA}) = 32\text{ bits}.

  • Cache Capacity =223 bytes= 2^{23}\text{ bytes}.

  • Cache Block Size =128 bytes=27 bytes  ⟹  = 128\text{ bytes} = 2^7\text{ bytes} \implies Block offset field =7 bits= 7\text{ bits}.

Total number of cache blocks / lines:

Total Blocks=Cache CapacityBlock Size=22327=216\text{Total Blocks} = \frac{\text{Cache Capacity}}{\text{Block Size}} = \frac{2^{23}}{2^7} = 2^{16}

1. For Direct-Mapped Cache:

  • Number of lines =216  ⟹  = 2^{16} \implies Line Index field =16 bits= 16\text{ bits}.

  • TAG field length MM is given by:

M=PA−(Line Index+Block Offset)=32−(16+7)=32−23=9 bitsM = \text{PA} - (\text{Line Index} + \text{Block Offset}) = 32 - (16 + 7) = 32 - 23 = 9\text{ bits}

2. For KK-way Set-Associative Cache (K=2LK = 2^L):

  • Number of sets =Total BlocksK=2162L=216−L  ⟹  = \frac{\text{Total Blocks}}{K} = \frac{2^{16}}{2^L} = 2^{16 - L} \implies Set Index field =(16−L) bits= (16 - L)\text{ bits}.

  • TAG field length NN is given by:

N=PA−(Set Index+Block Offset)=32−(16−L+7)=9+L bitsN = \text{PA} - (\text{Set Index} + \text{Block Offset}) = 32 - (16 - L + 7) = 9 + L\text{ bits}

Substituting M=9M = 9 into the equation for NN:

N=M+LN = M + L

Thus, (A) is the correct option.

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 Q38 of the GATE CSE 2026 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 it is the only one in GATE CSE 2026 Set 1.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2026 Set 1

Share this solution

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

GateAI solution cardGATE CSE 2026 Set 1 · Q38 · MCQ

The size of the physical address space of a processor is 232 bytes. The capacity of a cache memory unit is 223 bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a K-way set-associative cache, where K = 2L and L ∈ {1, 2, 3}. Let the length of the TAG field be M bits for the direct mapped cache, and N bits for the set-associative cache. Which one of the following options is true?

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.