Data:
Physical address (PA) = 40 bits
Cache Memory Size (CS) = 512 KB = 219 B
Block Size (BO) = 2x B
Set associativity = 8
Formula:
Formula to find number of bits in tag in set associative mapping
PA = tag + set + BO
\({\rm{number\;of\;set}} = \frac{{{\rm{CS}}}}{{{\rm{S}} \times {\rm{BO}}}}\)
Calculation:
\({\rm{number\;of\;set}} = \frac{{{2^{19}}}}{{{2^3} \times {2^{\rm{x}}}}} = {2^{19 - 3 - x}}\)
PA = tag + set + BO
40 = tag + 19 – 3 – x
∴ tag = 24 bits
Important Points:
Assume: Memory is byte addressable