GATE / CS ARCHIVE

GATE CSE 2026 SET 1 / QUESTION 38

How associativity changes cache tag length

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

GATE 2026 Set 1, Q38 2 marks · MCQ
Report issue

Cache Memory

Question 38, GATE 2026: A byte-addressed processor has a 2^32-byte physical address space. The cache holds 2^23 bytes in 128-byte blocks. Compare direct-mapped tag length M with K-way set-associative tag length N, where K=2^L and L∈{1,2,3}. Choices are N=M+L, M−L, M+K, M−K.
Tap to enlarge
Your answer
Answer & solution

Official answer: A

Givens and goal

A byte-addressed processor has a 232-byte physical address space. The cache holds 223 bytes in 128-byte blocks. Compare direct-mapped tag length M with K-way set-associative tag length N, where K=2L and L∈{1,2,3}. Choices are N=M+L, M−L, M+K, M−K.

Approach

Partition the same physical address into tag, set index, and block offset for the two organizations.

Step-by-step solution

1. Byte addresses contain 32 bits. A 128-byte block needs log2(128)=7 offset bits.
2. The cache contains 223 / 27 = 216 blocks. In a direct-mapped organization, there are 216 sets, requiring 16 index bits. Hence its tag length is M=32−16−7=9.
3. K=2L ways reduce the set count to 216−L. The set index therefore uses 16−L bits while the block offset remains 7 bits.
4. The set-associative tag length is N=32−(16−L)−7=9+L=M+L.

Common error: Associativity changes the number of sets, not the number of bytes per block. Offset bits do not grow with the number of ways.

Concrete check: for L=2, the cache is four-way. It has 214 sets, so its address fields are 11 tag bits, 14 set-index bits and 7 offset bits, totaling 32. Direct mapping used 9+16+7=32. The increase is log₂4=2 bits, not four bits; this distinguishes M+L from M+K. Subtracting L or K would move the tag in the wrong direction.

Original paper, page 27 · Answer key