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