Memory Hierarchy
In an 8-way set-associative cache, how many tags are compared in parallel on each access?
- AAs many as there are lines in the whole cache
- B8
- C1
Show answer and explanation
Answer: B. 8
A set-associative cache first selects one set with the index bits, then compares the tags of every way in that set in parallel. With 8 ways a set holds 8 lines, so 8 tags are compared, requiring 8 comparators. Comparing against every line in the cache is fully associative, and comparing just one is direct-mapped. More ways mean more comparators and power, which is why L1 associativity is often kept modest.
- A. Comparing against every line is fully associative.
- B. Correct. It compares the tags of the 8 ways in the selected set.
- C. Comparing only one tag is direct-mapped.