Consider two cache organizations. First one is -way set associative with block size, the second is of same size but direct mapped. The size of an address is in both cases . A -to- multiplexer has latency of while a bit comparator has latency of . The hit latency of the set associative organization is while that of direct mapped is .
The value of is:
View worked solution
Answer: D
To find the hit latency of the direct-mapped cache, we first need to determine the number of tag bits used in its address translation.
1. Address Division for the Direct-Mapped Cache
- Total Cache Size:
- Block Size:
- Number of Cache Blocks (Lines):
For a -bit physical address, the division of bits is as follows:
- Block Offset:
- Index Bits:
- Tag Bits:
2. Calculating Hit Latency
In a direct-mapped cache:
- A single tag comparison is performed to determine a hit.
- The size of the comparator required is equal to the number of tag bits ().
- The latency of a -bit comparator is given as .
- Since there is only one way (direct-mapped), no multiplexer is needed to select between multiple ways.
Note: Calculating (for 2-way Set Associative Cache)
For completeness, let's calculate :
- Number of sets = .
- Tag bits = .
- Comparator latency = .
- A 2-to-1 multiplexer () is required to select the correct way.
- .
Free practice · Your answers on this page are not saved.
