-
A cache memory unit with capacity of N words and block size of B words is to be designed. If it is designed as a direct mapped cache, the length of the TAG field is 10 bits. If the cache unit is now designed as a 16-way set-associative cache, the length of the TAG field is______ bits.
-
- 5
- 28
- 14
- 7
Correct Option: C
In Direct Mapped :
No. of line in direct mapped cache = | bits | |||
B |
For No. of line = log | ||||
B |
In Set Associative :
TAG1 + log | + log(B) = TAG2 + log | + log(B) | ||||||
B | 16 B |
By cancelling the same terms
As given that
TAG1 = 10 bits for Direct Mapping.
TAG2 let say X bits.
Then , 10 + log | = X + log | |||||||
B | 16 B |
By taking exponentation both side w.r.t 2.
(2^10)* | = (2^X)* | |||||||
B | 16 B |
(2^10) = (2^X) | ||||
16 |
(2^10) = (2^X) | ||||
2^4 |
(2^14) = (2^X)
X = 14 |
So, the required length of TAG field in Set Associative mapped is = 14.