Let’s see what is given to us :
32 bit architecture
Cache size = 16 KB = $2^{14}$ B
set associativity = 4
It is given that line size is of four 32 bit words so we have to consider it as word addressable.
Block offset = log2(4) = 2bits
Line size = 4*32bits = 128bits = 16B
#cache lines = $\frac{cache size}{line size} = $ $\frac{2^{14}}{2^{4}}$ = $2^{10}$
#sets = $\frac{no. of lines}{set associativity}$ = $\frac{2^{10}}{4}$ = $2^8$
Tag (32-(8+2) = 22 bits) |
Set no. (8bits) |
Block offset (2bits) |
Now given address is (ABCDE888) → 1010 1011 1100 1101 1110 1000 1000 1000 in binary
Set number bits are 00100010 and its decimal equivalent is 34.
Answer : 34