Yes. Here is an example: a2a3 = a5 Another example: 2226 = 28
Need larger spread of the 3 numbers
•Advantages-Almost as simple to build as adirect-mapped cache.-Only n comparators areneeded for an n-way setassociative cache. For 2-wayset-associative, only 2comparators are needed tocompare tags.-Supports temporal locality byhaving full associativity withina set.•Disadvantages -Not as good as fully-associative cache insupporting temporal locality.-For LRU schemes, because ofsmall associativity, actuallypossible to have 0% hit ratefor temporally local data.-E.g. If our accesses are A1 A2A3 A1 A2 A3, and if A1, A2and A3 map to the same2-way set, then hit rate is 0%as subsequent accessesreplace previous accesses inthe LRU scheme.
Disadvantage: if a program happens to reference words repeatedly from two different blocks that map into the same line, then the blocks will be continually swapped in the cache, and the hit ratio will be low. Thus, the performance isn't optimal compared to the other techniques. Advantage: It's easy to implement.