Question:

An 8-way set associative cache of size 64 KB (1 KB = 1024 bytes) is used in a system with a 32-bit address. The address is sub-divided into TAG, INDEX, and BLOCK OFFSET. Find the number of bits in the TAG.

Show Hint

In associative caches: Tag bits = (Address bits) $-$ (Index bits + Block offset bits). Index bits depend on number of sets, while block offset bits depend on block size.
Updated On: Aug 26, 2025
Hide Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Cache size.
Total cache size = 64 KB = \(64 \times 1024 = 65536\) bytes.

Step 2: Assume block size.
By default, block size = 64 bytes (standard unless otherwise mentioned).
Thus, total number of blocks in cache = \(\dfrac{65536}{64} = 1024\) blocks.

Step 3: Number of sets.
It is 8-way set associative. Hence, each set contains 8 blocks.
Number of sets = \(\dfrac{1024}{8} = 128\) sets.

Step 4: Address breakdown.
Address size = 32 bits.
- Block offset bits = \(\log_2(64) = 6\).
- Index bits = \(\log_2(128) = 7\).
- Tag bits = \(32 - (6+7) = 19\).

\[ \boxed{19} \]
Was this answer helpful?
0
0

Questions Asked in GATE CS exam

View More Questions