# Comprehension A computer has a 256 KByte, 4-way set associative, write back data cache with block size of 32 Bytes. The processor sends 32 bit address

0 votes
361 views
in Computer
closed
The size of the cache tag directory is
1. 160 Kbits
2. 136 Kbits
3. 40 Kbits
4. 32 Kbits

## 1 Answer

0 votes
by (46.1k points)
selected

Best answer
Correct Answer - Option 1 : 160 Kbits

The correct answer is option 1

Data:

Physical address space = 232 bytes

Block size = 32 B = 2B

Number of bits for block size = 5

cache size =256 KByte = 218 B

set associative = 4 -way

Calculation:

number of bits = ⌈log2 n⌉

Number of blocks = $\frac{cache\;size}{block\; size}$ =${2^{18} B\over 2^5B}=2^{13}$

Number of sets in cache = ${\frac{number\; of\; blocks}{set\; associativity}} = {2^{13}\over 2^2}=2^{11}$

Number of bits in set =11

Virtual address = tag + set + Byte offset (in bits)

32 = tag + 11+ 5

∴ tag = 16 bits

16 bit address 2 valid bits, 1 modified bit and 1 replacement bit

So, total bits =20

So, Each cache tag directory entry contains = 20 × Number of blocks = 20 × 213 bits

213 = 8 K bits

So, Each cache tag directory entry contains = 20 × 8 K bits=160 Kbits

So, the size of the cache tag directory is 160 Kbits

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer