Final answer:
In a 36-bit memory address for a 16M-byte 16-way set-associative cache with 128 bytes per block, the Tag field is 16 bits, the Set field is 13 bits, and the Word field is 7 bits because we need to cover cache blocks and set sizes as well as the byte offset within a block.
Step-by-step explanation:
To calculate the number of bits in each of the Tag, Set, and Word fields of a 36-bit memory address for a 16M-byte 16-way set-associative cache with 128 bytes per cache block, we need to understand the structure of the memory address.
The cache size is 16M bytes, which equals 16 x 1024 x 1024 bytes, or 16777216 bytes. Therefore, the size of the cache is 224 bytes because 224 is the same as 16M. With 128 bytes per cache block, we have 224 / 128 = 217 blocks in the cache.
Since the cache is 16-way set-associative, the number of sets is 217 / 16 = 213 sets, which means we need 13 bits for the Set field.
The Word field refers to the byte offset within a block. Since each block is 128 bytes (27 bytes), we need 7 bits to represent each byte within a block.
For the Tag field, we subtract the Set bits and Word bits from the total address bits: 36 - (13 + 7) = 36 - 20 = 16 bits for the Tag field.
Therefore, the correct answer is B) Tag: 16 bits, Set: 13 bits, Word: 7 bits.