Last Updated : 02 Jan, 2019

How many tag bits are needed in a 4 set associative cache memory of 4 KB having a block size of 2 words and each word is of 32 bits. The physical memory size is 256 MB?
(A) 20
(B) 24
(C) 22
(D) None of these


Answer: (D)

Explanation: According to given data, block size,

= 2 words 
= 2 * 32 bits 
= 8 bytes 
= 23 bytes 

And, number of cache line

= 4 KB / 8B 
= 29 

So, number of sets,

= 29 / 4 
= 27 

Physical memory

= 232 bits 

Hence, Tag bits

= 28 - (7 + 3) 
= 18 bits 

So, option (D) is correct.


Quiz of this Question


Share your thoughts in the comments