GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Compare cache widths after changing associativity

3 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Hold total cache capacity and block size fixed while changing associativity: the set count changes inversely, set-index width loses log2 of the factor, and tag width gains it. The 2017 and 2026 variants request numeric/symbolic tag relationships;

2 marks · MCQ
Report issue

How associativity changes cache tag length

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

2 marks · NAT
Report issue

Cache Memory

Question 54, GATE 2017: A cache has capacity N words, blocks of B words, and a 10-bit tag when directly mapped. With unchanged capacity and block size, redesign as 16-way set associative. Find tag width.
Tap to enlarge
Answer & solution

Official answer: 14.0

Our answer: 14

1. Address bits are partitioned into tag, set index, and block offset. Keeping B fixed leaves offset width unchanged.

2. A direct-mapped cache has N/B sets. A 16-way cache of the same total capacity has N/(16B) sets, requiring log₂16=4 fewer index bits.

3. The address width has not changed, so those four bits move to the tag. New tag width=10+4=14 bits. Associativity changes the set count, not the number of offset bits.

Original paper, page 24 · Answer key

2 marks · MCQ
Report issue

Cache Memory

Question 44, GATE 2014: A cache's associativity doubles while its total capacity and block size stay fixed. Which is guaranteed not to be affected? A tag-comparator width; B set-index-decoder width; C way-selection-multiplexor width; D processor-to-main-memory data-bus width.
Tap to enlarge
Your answer
Answer & solution

Official answer: D

1. Set up the reasoning. Let capacity be C, line size B, and associativity A. The set count is C/(AB), so doubling A halves the number of sets without changing the line-offset field.

2. Derive the result. With capacity C and block size B fixed, doubling associativity halves the set count C/(AB). The set index loses one bit and the tag gains one. The way-selection fan-in doubles, while the processor-to-main-memory data-bus width need not change. Therefore D. Here multiplexor width means its way-selection configuration/fan-in, not the unchanged data-word output width.

3. Check the interpretation. The index loses a bit and the tag gains a bit. More ways require greater selection fan-in, but internal cache organization does not dictate a new external data-bus width. The keyed interpretation of multiplexor “width” is its selection configuration, not its unchanged output-word width.

Original paper, page 41 · Answer key