We need to calculate tag bits and number of lines, because tag directory size = tag bits*number of lines in cache
For set associative cache mapping virtual address is mapped as:
tag bits |
set number bits |
block offset |
now, number of lines = 32KB/8B = 2^12
number of sets = 2^12/4 = 2^10, set number bits = 10
block offset bits = 3 (8B size and assuming byte addressable)
tag bits = 32 - set number bits - block offset bits
tag bits = 32 - 3 - 10 = 19
tag bits = 19 |
set number bits = 10 |
block offset bits = 3 |
tag directory size = number of lines*tag bits = (2^12)*19 bits = 76Kbits