Correct Answer - Option 3 : 16
The correct answer is option 3
Data:
Physical address (PA) = 232 bytes
Block size = 32 B = 25 B
Number of bits for block size = 5
cache size =256 KByte = 218 B
set associative = 4 -way
Calculation:
number of bits = ⌈log2 n⌉
Number of blocks = \(\frac{cache\;size}{block\; size}\) =\({2^{18} B\over 2^5B}=2^{13}\)
Number of sets in cache = \({\frac{number\; of\; blocks}{set\; associativity}} = {2^{13}\over 2^2}=2^{11}\)
Number of bits in set =11
PA = tag + set + offset
32 = tag + 11+ 5
∴ tag = 16 bits
So, the number of bits in the tag field of an address is 16 bits