Computer Sciences > GATE 2026 SET-1 > Cache Memory
The size of the physical address space of a processor is 232 bytes. The capacity of a cache memory unit is 223 bytes. The cache block size is 128 bytes. The cache memory unit can be built as a direct mapped cache or as a K-way set-associative cache, where K = 2L and L ∈ {1, 2, 3}. Let the length of the TAG field be M bits for the direct mapped cache, and N bits for the set-associative cache.

Which one of the following options is true?
A
N = M + L
B
N = M − L
C
N = M + K
D
N = M − K

Correct : a

Physical address is 32 bits. Block size = 128 = 27 bytes → 7 offset bits. Cache capacity = 223 bytes → total cache lines = 223/27 = 216.
Direct Mapped Cache — TAG bits M
In a direct mapped cache every cache line maps to exactly one set, so number of sets = number of lines = 216. Index bits = 16. TAG bits M = 32 − 16 − 7 = 9.
K-way Set Associative Cache — TAG bits N
With K = 2L ways, each set holds K lines. Number of sets = 216 / 2L = 216−L. Set index bits = 16 − L. TAG bits N = 32 − (16−L) − 7 = 9 + L = M + L.
The intuition is clear — going from direct mapped to K-way set associative reduces the number of sets by a factor of K = 2L, so the index field shrinks by L bits. Those L bits move into the TAG field, making the TAG L bits longer. Hence N = M + L.
Correct answer: A — N = M + L ✓

Similar Questions

Consider a machine with a byte addressable main memory of 220 bytes, block size of 16 bytes and a direct mapped cache having 212 cache lines. Let the addresses...
#33 MCQ
The read access times and the hit ratios for different caches in a memory hierarchy are as given below: Cache Read Access Time(In Nano...
#584 Fill in the Blanks
A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as direct mapped cache, the length of the TAG field...
#592 Fill in the Blanks

Related Topics

cache TAG bits direct mapped set associative GATE 2026 GATE CS 2026 Set-1 Q44 N=M+L cache TAG field GATE K-way set associative TAG bits GATE direct mapped cache TAG index offset 32-bit computer organization GATE 2026

Unique Visitor Count

Total Unique Visitors

Loading......