# GATE | GATE-CS-2014-(Set-2) | Question 65

A 4-way set-associative cache memory unit with a capacity of 16 KB is built using a block size of 8 words. The word length is 32 bits. The size of the physical address space is 4 GB. The number of bits for the TAG field is _____

(A)

5

(B)

15

(C)

20

(D)

25

Explanation:

In a k-way set associate mapping, cache memory is divided into sets, each of size k blocks. Size of Cache memory = 16 KB As it is 4-way set associative,K = 4 Block size B = 8 words The word length is 32 bits. size of Physical address space = 4 GB. ————————————————— No of blocks in Cache Memory(N) = (size of cache memory / size of a block) = (16*1024 bytes / 8*4 bytes) = 512 (as 1 word = 4 bytes) No of sets(S) = (No of blocks in cache memory/ no of blocks in a set) = N/K = 512/4 = 128 Now,size of physical address = 4GB = 4*(2^30) Bytes = 2^32 Bytes These physical addresses are divided equally among the sets. Hence, each set can access ((2^32)/128) bytes = 2^25 bytes = 2^23 words = 2^20 blocks So, each set can access total of 2^20 blocks. So to identify these 2^20 blocks, each set needs TAG bits of length 20 bits. Hence option C.

Quiz of this Question
Please comment below if you find anything wrong in the above post