GATE / CS ARCHIVE

GATE CSE 2026 SET 2 / QUESTION 56

Maximum direct-mapped cache size from an address

Computer Organization & Architecture · Cache Memory · Full GATE CSE 2026 Set 2 paper

GATE 2026 Set 2, Q56 2 marks · NAT
Report issue

Cache Memory

Question 56, GATE 2026: A byte-addressed machine has 1 MB physical memory. Address 0xA2C28 maps to cache block number 176 (decimal), numbered from zero. Find the largest cache size in KB under the conventional power-of-two direct-mapped bit-field organization. K=2¹⁰,M=2²⁰.
Tap to enlarge
Answer & solution

Official answer: 128

Givens and goal

A byte-addressed machine has 1 MB physical memory. Address 0xA2C28 maps to cache block number 176 (decimal), numbered from zero. Find the largest cache size in KB under the conventional power-of-two direct-mapped bit-field organization. K=2¹⁰,M=2²⁰.

Approach

Locate the required binary index within the physical address and maximize its allowed leading zeros.

Step-by-step solution

1. A 1 MB byte-addressed space has 20-bit addresses. The given address is 1010 0010 1100 0010 1000 in binary. Let b be block-offset bits and s be index bits. The cache index is (address >> b) mod 2s and cache capacity is 2b+s bytes.
2. The required index 176 is binary 10110000, so s≥8. In the address, the eight-bit slice equal to 10110000 occurs with its low end at bit 6: shifting right by b=6 gives 0x28B0, whose low eight bits are 0xB0=176. Examining possible offsets 0 through 12 yields no other matching eight-bit slice.
3. For b=6, the low 9,10, and 11 bits of 0x28B0 also equal 176 because the added bits are zero. The low 12 bits are 0x8B0=2224, so s=12 fails; all larger widths retain that unwanted set bit and fail too.
4. The maximum feasible choice is b=6,s=11: block size 2⁶=64 bytes, line count 2¹¹=2048, and capacity 2¹⁷=131072 bytes=128 KB. As a direct check, floor(0xA2C28/64)=10416, and 10416 mod 2048=176.
5. The feasible smaller capacities with the same block size are 16,32,64 KB. This maximization relies on conventional power-of-two cache/block sizes and consecutive index bits. Arbitrary modular mappings or nonstandard capacities are not implied by the source wording; retain that model qualification with official answer 128.

Original paper, page 39 · Answer key