# 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

1.1k views
in Computer
closed

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 _____

by (48.1k points)
selected

Data:

1 W = 4 B (word length is 32 bits)

Physical address space (PS) = 4 G B = 230 W

Cache size (CS) = =16 KB = 214 B = 212 W

Block size (BS) = 8 W = 23 W

set associativity = 4

Formula:

number of bits = log2 n

Number of lines in cache $= \frac{{{\rm{CS}}}}{{{\rm{BS}}}}$

Number of sets in cache $= \frac{{number\;of\;lines}}{{set\;associativity}}$

PAS = tag + set + block offset .....(in bits)

Calculation:

Number of lines in cache $= \frac{{{2^{12}}}}{{{2^3}}} = {2^{9}}$

Number of sets in cache $= \frac{{{2^{9}}}}{4} = {2^7}$

 Tag Set Block Offset x bits 7 bits 3 bits

30 = x + 7 + 3

x = 20

tag = 20 bits

The number of bits for the TAG field is 20.