Memory Hierarchy

What changes when a cache is switched from direct-mapped to set-associative?

  1. AConflict misses decrease, but tag comparison and way selection tend to lengthen hit time
  2. BConflict misses increase, but simpler circuits shorten hit time
  3. CNeither miss rate nor hit time changes at all, regardless of associativity
Show answer and explanation

Answer: A. Conflict misses decrease, but tag comparison and way selection tend to lengthen hit time

A set-associative cache has several ways per set, so multiple blocks mapping to the same set can coexist, reducing conflict misses compared with a direct-mapped cache. The cost is circuitry that compares several tags in parallel and selects the matching way, which tends to increase hit time and power. More conflict misses and simpler circuits describe the direct-mapped side. Both miss rate and hit time change with associativity.

  • A. Correct. Conflict misses drop, but hit time tends to increase.
  • B. This is reversed and describes a direct-mapped cache.
  • C. Miss rate and hit time both change with associativity.
Practice this topic Back to topic

More Memory Hierarchy questions

  1. In an 8-way set-associative cache, how many tags are compared in parallel on each access?
  2. In a cache with 64-byte lines and 64 sets, which set holds the data at address 0x1234?
  3. For code that writes to the same line many times, why is a write-back cache more advantageous than write-through?
  4. In contrast to LRU, which evicts the least recently used block, optimal replacement (OPT) evicts the block that will not be used for the longest time. Which statement about OPT is correct?
  5. What generally happens to hit time as cache capacity increases, and why?