A computer has a , 4-way set associative, write back data cache with block size of . The processor sends addresses to the cache controller. Each cache tag directory entry contains, in addition to address tag, valid bits, modified bit and replacement bit.
The number of bits in the tag field of an address is
View worked solution
Answer: C
To find the number of bits in the tag field of the address, we analyze the structure of the physical address for a set-associative cache.
The -bit physical address is divided into three fields:
[ Tag ] [ Set Index ] [ Block Offset ]
Step 1: Calculate the Block Offset
The block size is given as .
Step 2: Calculate the Set Index
First, find the total number of blocks in the cache:
Since the cache is -way set associative ( blocks per set), the number of sets is:
Thus, the number of bits required for the set index is:
Step 3: Calculate the Tag Bits
The total address size is . Therefore:
Note: The extra bits (valid, modified, and replacement bits) are stored in the cache tag directory entry alongside the tag, but they do not affect the address division.
Hence, the correct option is C.
Free practice · Your answers on this page are not saved.
