Question
An 8-way set associative cache of size 64 KB () is used in a system with 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET.
The number of bits in the TAG is _______.
Official answer and solution
- Official answer
- 19
- From
- Official GATE 2023 answer key
Solution
Express total cache size in terms of tag, index, and block offset bits in a 32-bit address space.
-
The 32-bit physical address is partitioned into:
-
Let block size be bytes (so bits) and number of sets be (so bits).
-
Cache capacity with 8-way set associativity is:
Dividing by the associativity 8 ():
Therefore, .
-
Thus, the sum of INDEX and BLOCK OFFSET bits is always 13, independent of the individual block size!
-
The number of bits in the TAG is:
19
Thinking the question is missing block size; the product of sets and block size is fixed by total cache capacity divided by set associativity.
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2023 Computer Science and Information Technology (CS)
- Question
- 64 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.