Answer: 17 : 17
To find the size of the tag field, we analyze the structure of the physical address for a direct-mapped cache.
The physical address is divided into three fields:
Physical Address=Tag+Index (Line Offset)+Block Offset1. Physical Address Size
- Primary memory size = 232 bytes
- Since the memory is byte-addressable, the physical address size is log2(232)=32 bits.
2. Block Offset
- Each cache block size = 64 bytes=26 bytes
- Therefore, the block offset requires log2(26)=6 bits.
3. Index (Line Offset)
- Cache size = 32 KB=32×210 bytes=215 bytes
- Number of cache lines = Block SizeCache Size=26215=29 lines
- Therefore, the index field requires log2(29)=9 bits.
4. Tag Field Size
Tag size=Physical Address size−(Index bits+Block Offset bits)=32−(9+6)=32−15=17 bitsAlternatively, for a direct-mapped cache, the tag size can be calculated directly as:
Tag size=log2(Cache SizePrimary Memory Size)=log2(215232)=17 bits