Question
Consider a computer system with a byte-addressable primary memory of size bytes. Assume the computer system has a direct-mapped cache of size (), and each cache block is of size .
The size of the tag field is ___________ bits.
Official answer and solution
- Official answer
- 17
- From
- Official GATE 2021 answer key
Solution
Decompose the 32-bit physical address into Tag, Line/Index, and Block Offset fields for a direct-mapped cache.
Given parameters:
- Byte-addressable memory of size bytes Physical Address size is 32 bits.
- Cache block (line) size bytes Block offset field bits.
- Total cache size bytes.
In a direct-mapped cache, the number of cache blocks (lines) is:
Thus, the Line Index field requires bits.
The tag field size is obtained by subtracting the index and offset bits from the total address width:
17
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2021 Computer Science and Information Technology (CS, Set-1)
- Question
- 32 of 65, printed as CS Q.22
- 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.