Consider two cache organizations. First one is 32 kb 2-way set associa...
Cache Organizations
First Cache Organization:
- Size: 32 kb
- Associativity: 2-way set associative
- Block size: 32 bytes
Second Cache Organization:
- Size: 32 kb
- Associativity: Direct mapped
- Block size: 32 bytes
Latency of Components
Latency of 2-to-1 Multiplexer:
Latency of k-bit Comparator:
Hit Latency
Hit Latency of First Cache Organization:
Hit Latency of Second Cache Organization:
Solution
The formula for calculating hit latency of a cache is:
hit latency = access time of cache + (hit rate * (access time of memory - access time of cache))
As both cache organizations have the same size and block size, the only difference is in their associativity, we can compare their hit latencies using the above formula.
For the first cache organization, as it is 2-way set associative, we need to compare the two sets for a hit, which requires a 2-to-1 multiplexer. Therefore, the access time of cache for this organization is 0.6 ns.
For the second cache organization, as it is direct mapped, we only need to compare one block for a hit, which requires a k-bit comparator. Therefore, the access time of cache for this organization is k/10 ns.
Assuming the same hit rate for both cache organizations, we can set the hit latencies equal to each other and solve for h1:
h1 = h2 + (hit rate * (k/10 - 0.6))
As h2 is not given in the question, we cannot solve for h1 directly. However, we can make some assumptions and estimate h1.
Assuming a hit rate of 90%, and k = 32 (as the address size is 32 bits), we can estimate h2 as follows:
h2 = access time of cache = k/10 = 3.2 ns
Substituting the values in the hit latency formula, we get:
h1 = 3.2 + (0.9 * (0.32 - 0.6))
= 2.4 ns
Therefore, the value of h1 is 2.4 ns, which is option A.