Answer: A
In a direct-mapped cache, a physical address is split into three fields:
[ Tag Bits | Index Bits | Block Offset Bits ]
We are given:
- CPU Address Size: 32 bits
- Cache Size: 32 KB=32×210 bytes=215 bytes
- Block Size: 32 bytes=25 bytes
Step 1: Calculate Block Offset Bits
The number of bits required to identify a byte within a cache block is:
Block Offset Bits=log2(Block Size)=log2(25)=5 bits
Step 2: Calculate Cache Index Bits
The number of lines (blocks) in the cache is:
Number of Lines=Block SizeCache Size=25 bytes215 bytes=210Since it is a direct-mapped cache, each line corresponds to a unique index. The number of index bits is:
Index Bits=log2(Number of Lines)=log2(210)=10 bits
Step 3: Calculate Tag Bits
The total address size is the sum of the tag, index, and block offset bits:
Address Size=Tag Bits+Index Bits+Block Offset Bits32=Tag Bits+10+5Tag Bits=32−15=17 bitsThus, the number of cache indexing bits is 10 and the number of tag bits is 17.