Question

The size of the physical address space of a processor is 2322^{32} bytes. The capacity of a cache memory unit is 2232^{23} bytes. The cache block size is 128128 bytes. The cache memory unit can be built as a direct mapped cache or as a KK-way set-associative cache, where K=2LK = 2^L and L∈{1,2,3}L \in \{1, 2, 3\}. Let the length of the TAG field be MM bits for the direct mapped cache, and NN bits for the set-associative cache.

Which one of the following options is true?

Choose one option
Official answer and solution
Official answer
A
From
Official GATE 2026 answer key

Solution

Compute the number of cache lines, number of sets, index bits, and tag bits for both cache organizations.

  • Physical address length =32= 32 bits; block offset =log⁡2(128)=7= \log_2(128) = 7 bits.
  • Number of cache blocks (lines) =22327=216= \frac{2^{23}}{2^7} = 2^{16}.
  • Direct-mapped cache: Index field =16= 16 bits, so tag length M=32−16−7=9M = 32 - 16 - 7 = 9 bits.
  • KK-way set-associative cache (K=2LK = 2^L): Number of sets =2162L=216−L= \frac{2^{16}}{2^L} = 2^{16 - L}, so the set index field has 16−L16 - L bits and the tag length is:
    N=32−(16−L)−7=(32−16−7)+L=M+LN = 32 - (16 - L) - 7 = (32 - 16 - 7) + L = M + L
Final answer

Option (A)

Common trap

Subtracting LL instead of adding LL, or using KK instead of log⁡2K=L\log_2 K = L.

The answer is the one in the official GATE answer key. The solution is this site's own explanation.

Source

Paper
GATE 2026 Computer Science and Information Technology - Session 1 (CS1)
Question
38 of 65
Section
Computer Science and Information Technology

Report an error in this question

GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.