For Direct Cache Mapping
TAG Bits =14 |
Cache Line offset = log(N/B) |
Word offset = log(B) |
For 4 Way Set Associative Cache Mapping
TAG Bits |
Set Line offset= log(N/4B) |
Word Offset = log(B) |
Suppose tag bits be x for 4 way set associative cache
Since the number of bits to represent physical address space will remain same, hence
14 + log(N/B) + log(B) = x + log(N/4B) + log(B)
On solving above we will get x = 16 bits
So, the length of the TAG field is 16 bits.