Consider two cache organizations: The first one is 32 KB 2-way set associative…
2006
Consider two cache organizations: The first one is 32 KB 2-way set associative with 32-byte block size. The second one is of the same size but direct mapped. The size of an address is 32 bits in both cases. A 2-to-1 multiplexer has a latency of 0.6 ns while a kbit comparator has a latency of k/10 ns. The hit latency of the set associative organization is h1 while that of the direct mapped one is h2. The value of h1 is:
- A.
2.4 ns
- B.
2.3 ns
- C.
1.8 ns
- D.
1.7 ns
Attempted by 169 students.
Show answer & explanation
Correct answer: A
Answer: 2.4 ns
Number of blocks = 32 KB / 32 B = 1024 blocks. With 2-way associativity there are 1024 / 2 = 512 sets, so index = log2(512) = 9 bits.
Block offset = log2(32) = 5 bits.
Tag bits = 32 (address) - 9 (index) - 5 (offset) = 18 bits.
Comparator latency = 18 / 10 = 1.8 ns.
2-to-1 multiplexer latency = 0.6 ns.
Hit latency for the 2-way set-associative cache = comparator latency + multiplexer latency = 1.8 ns + 0.6 ns = 2.4 ns.
Therefore the correct hit latency h1 is 2.4 ns.