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:

  1. A.

    2.4 ns

  2. B.

    2.3

  3. C.

    1.8

  4. D.

    1.7

Attempted by 170 students.

Show answer & explanation

Correct answer: A

Answer: 2.4 ns

  • Compute cache parameters: 32 KB / 32 B = 1024 blocks.

  • With 2-way associativity: 1024 / 2 = 512 sets → index = log2(512) = 9 bits.

  • Block offset = log2(32) = 5 bits.

  • Tag bits = 32 - index - offset = 32 - 9 - 5 = 18 bits.

  • Comparator latency = tag bits/10 = 18/10 = 1.8 ns.

  • For 2-way set associative, add the 2-to-1 multiplexer latency = 0.6 ns.

  • Total hit latency for set associative (h1) = 1.8 + 0.6 = 2.4 ns.

  • For reference, hit latency for direct mapped (h2) = comparator latency = 1.8 ns.

Explore the full course: Gate Guidance By Sanchit Sir