Question:medium

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: Feb 3, 2026
Show Solution

Solution and Explanation

Step 1: Cache parameters

Cache size = 64 KB = 216 bytes
Address size = 32 bits
Associativity = 8-way


Step 2: Use power-of-two representation

Assume block size = 64 bytes = 26 bytes

Total cache blocks:
216 / 26 = 210 blocks


Step 3: Determine number of sets directly

Each set contains 8 blocks = 23 blocks

Number of sets:
210 / 23 = 27 sets


Step 4: Bit allocation from address

Block offset bits = log2(64) = 6

Set index bits = log2(27) = 7

Tag bits:
32 − (6 + 7) = 19


Final Answer:

Number of tag bits = 19

Was this answer helpful?
0