305 views
0 votes
0 votes
Consider a machine with 4-way set associative data cache of size 32KB and block size of 8B. The cache is managed using 32 bit Virtual Address and page size is 5KB. What is the total size of tags in cache directory?

1 Answer

Best answer
1 votes
1 votes

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

selected by

No related questions found