GateAI
Cache Memory and Hierarchy

GATE CSE 2012 · Q54

MCQ2 marksMedium

Time

Statement for Linked Answer Questions 54 and 55

A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The number of bits in the tag field of an address is

Select one answerSingle correct

Pick an option to check

Solution

Step-by-step verified solution

Official answer: C) 16

Cache Memory and Hierarchy

Given parameters:

  • Cache Size =256 KB=218 Bytes= 256\text{ KB} = 2^{18}\text{ Bytes}

  • Block Size =32 Bytes=25 Bytes= 32\text{ Bytes} = 2^5\text{ Bytes}

  • Set Associativity (PP) =4=22= 4 = 2^2

  • Physical Address =32 bits= 32\text{ bits}

  1. Block offset bits:

    Block offset=log⁡2(32)=5 bits\text{Block offset} = \log_2(32) = 5\text{ bits}
  2. Total number of cache blocks (lines):

    Total lines=256 KB32 B=21825=213=8192 lines\text{Total lines} = \frac{256\text{ KB}}{32\text{ B}} = \frac{2^{18}}{2^5} = 2^{13} = 8192\text{ lines}
  3. Number of sets:

    Number of sets=Total lines4=21322=211=2048 sets\text{Number of sets} = \frac{\text{Total lines}}{4} = \frac{2^{13}}{2^2} = 2^{11} = 2048\text{ sets}
  4. Set index bits:

    Set index=log⁡2(2048)=11 bits\text{Set index} = \log_2(2048) = 11\text{ bits}
  5. Tag bits:

    Tag bits=32−(Set index+Block offset)=32−(11+5)=16 bits\text{Tag bits} = 32 - (\text{Set index} + \text{Block offset}) = 32 - (11 + 5) = 16\text{ bits}

Thus, the number of bits in the tag field is 16 (Option C).

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 Q54 of the GATE CSE 2012 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 2012 has 2.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2012

Share this solution

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

GateAI solution cardGATE CSE 2012 · Q54 · MCQ

Statement for Linked Answer Questions 54 and 55: A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, 2 valid bits, 1 modified bit and 1 replacement bit. The number of bits in the tag field of an address 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.