Consider a system with the following cache configuration:
Block size = 128 bytes
Physical memory size = 223 bytes
Cache size = 213 bytes.
Two cache organizations are used:
1. A direct-mapped cache with tag size = m bits.
2. Ak-way set associative cache with tag size = n bits where k = 2L, L ∈ {1,2,3,....}.
Which of the following relations between n and m is / are correct?
Correct Answer :
n = m + L
Solution :
The correct option is n = m + L.
Step-by-step Explanation:
1. Determine the address bits from the physical memory and block size:
The physical memory size is given as 223 bytes. Therefore, the total number of physical address bits is 23 bits.
The cache block size is 128 bytes, which can be written as:
This means the block offset requires 7 bits.
2. Direct-Mapped Cache Configuration (Tag size = m bits):
The cache size is given as 213 bytes. The number of blocks in the cache is calculated as:
In a direct-mapped cache, the number of index bits is log2(Number of blocks) = 6 bits.
The physical address structure for a direct-mapped cache is partitioned as:
Physical Address (23 bits) = Tag (m bits) + Index (6 bits) + Block Offset (7 bits)
3. k-way Set Associative Cache Configuration (Tag size = n bits):
Here, the associativity is k = 2L. The number of sets in the cache is:
Thus, the set index requires 6 - L bits.
The physical address structure for a set-associative cache is partitioned as:
Physical Address (23 bits) = Tag (n bits) + Set Index (6 - L bits) + Block Offset (7 bits)
4. Relating n and m:
Since m = 10, we can substitute it into the expression for n:
This matches the correct relation.
Access expert-curated educational resources and study materials—completely free.
Create, conduct, and manage professional online assessments with Mindyard. Perfect for teachers and institutes.
Copyright © 2026 Mindyard. All Rights Reserved.