Computer Sciences > GATE 2025 SET-1 > Cache Memory
Consider a memory system with 1M bytes of main memory and 16K bytes of cache memory. Assume that the processor generates 20-bit memory address, and the cache block size is 16 bytes. If the cache uses direct mapping, how many bits will be required to store all the tag values? [Assume memory is byte addressable, 1K=210, 1M=220.]
A
6×210
B
8×210
C
212
D
214

Correct : a

Explanation:
To find the total number of bits required to store all tag values in a direct-mapped cache, we first need to break down the structure of the physical address and determine how many tags (lines) the cache contains.
1. Analyze the Physical Address Structure:
The processor generates a 20-bit memory address. In a direct-mapped cache, this address is split into three fields:

[ Tag Bits | Index (Line) Bits | Block (Byte) Offset Bits ] = 20 bits total

Block Offset Bits:
    The cache block size is 16 bytes = 24 bytes.
    Since the memory is byte-addressable, the number of bits needed for the block offset = 4 bits.

Index (Line) Bits:
    To find the number of lines (slots) in the cache:
    Number of Cache Lines = Cache Size / Block Size
    Number of Cache Lines = 16K bytes / 16 bytes = 1K lines = 210 lines.
    Therefore, the number of bits needed to index these lines = 10 bits.

Tag Bits:
    Tag Bits = Total Address Bits - (Index Bits + Block Offset Bits)
    Tag Bits = 20 - (10 + 4) = 20 - 14 = 6 bits per cache line.

2. Calculate Total Bits Required for All Tags:
Each of the cache lines requires its own tag store.
    Total Tag Bits = Number of Cache Lines × Tag Bits per Line
    Total Tag Bits = 210 × 6 bits = 6 × 210 bits.

3. Conclusion:
The total storage capacity needed to hold all tag structures is exactly 6×210 bits, which perfectly matches option (a).

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

No tags found

Unique Visitor Count

Total Unique Visitors

Loading......