GateAI
Cache Memory and Hierarchy

GATE CSE 2026 Set 2 · Q56

NAT2 marksHard

Time

Consider a system with 1 MB physical memory and a word length of 1 byte. The system uses a direct mapped cache, with block numbers starting from 0. The word with physical address 0xA2C28 is mapped to the cache block number 17610176_{10}. The maximum possible size of the cache (in KB) for this configuration is ________. (answer in integer) Note: 1K=2102^{10} and 1M=2202^{20}

Your answerNumerical answer

Enter a value to check

Solution

Step-by-step verified solution

Official answer: 128

Cache Memory and Hierarchy
  1. Physical Address Representation:

    • Physical memory = 1 MB=220 bytes  ⟹  20-bit1\text{ MB} = 2^{20}\text{ bytes} \implies 20\text{-bit} physical address.

    • Given physical address: 0xA2C2816\text{0xA2C28}_{16}.

    • In 20-bit binary:

      1010⏟A  0010⏟2  1100⏟C  0010⏟2  1000⏟8\underbrace{1010}_{\text{A}} \; \underbrace{0010}_{\text{2}} \; \underbrace{1100}_{\text{C}} \; \underbrace{0010}_{\text{2}} \; \underbrace{1000}_{\text{8}}

      Writing bit-by-bit from b19b_{19} to b0b_0:

      b19..0=1010 0010 1100 0010 1000b_{19..0} = 1010\,0010\,1100\,0010\,1000
  2. Direct Mapped Cache Addressing:

    • Physical Address format: [Tag∣Line Index∣Block Offset][\text{Tag} \mid \text{Line Index} \mid \text{Block Offset}]

    • Let the block offset have ww bits and line index have cc bits.

    • Given cache block number is 17610=101100002176_{10} = 10110000_2.

  3. Locating the Index Bits:

    • Looking at the bit string of the physical address:

      • Bits b13..6=101100002=17610b_{13..6} = 10110000_2 = 176_{10}.

    • Thus, the block offset must end at bit 5, giving w=6w = 6 bits (Block size =26=64 bytes= 2^6 = 64\text{ bytes}).

    • To maximize the cache size, the number of index bits cc must be maximized.

    • Notice that bits b14,b15,b16b_{14}, b_{15}, b_{16} are all 00, so including them in the index still keeps the value as 000101100002=1761000010110000_2 = 176_{10}.

    • However, bit b17=1b_{17} = 1; including b17b_{17} would add 2112^{11} to the index value, changing it from 176.

    • Therefore, the maximum number of index bits is c=11c = 11 (spanning bits b16..6b_{16..6}).

  4. Maximum Cache Size:

    • Maximum number of blocks =211=2048= 2^{11} = 2048.

    • Maximum cache capacity =211×26 bytes=217 bytes=128 KB= 2^{11} \times 2^6\text{ bytes} = 2^{17}\text{ bytes} = 128\text{ KB}.

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 Q56 of the GATE CSE 2026 Set 2 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 2026 Set 2 has 2.

How GATE tests Cache Memory and Hierarchy

More from GATE CSE 2026 Set 2

Share this solution

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

GateAI solution cardGATE CSE 2026 Set 2 · Q56 · NAT

Consider a system with 1 MB physical memory and a word length of 1 byte. The system uses a direct mapped cache, with block numbers starting from 0. The word with physical address 0xA2C28 is mapped to the cache block number 17610. The maximum possible size of the cache (in KB) for this configuration is … (answer in integer) Note: 1K=210 and 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.