Here is the problem, how many "blocks" in this cache.
24 words / 2 words-per-block = 12 blocks.
Blocks per way
One way of one set is one cache line, aka 1 block, which we're told is 2 words for this cache. One of the 3 ways across all sets is 24 words / 3 ways = 8 words = 4 blocks
. You're correct.
That's an odd way to describe the total number of sets, but it is the same thing. You could also calculate it as 12 blocks / 3 blocks-per-set = 4 sets
. Each way is by definition 1 block, so 3-way set associative means 3 blocks / set. So 24 words / (2 words/block * 3 blocks/set) = 24/6 blocks/set = 4 blocks/set
.
What textbook is this? It's not CS:APP 3e global edition, is it? The practice problems in that edition of the textbook were replaced by incompetent people hired by the publisher, see CS:APP example uses idivq with two operands?
8 words per way (size of each set) is the distance between word addresses that index the same set, so accesses that far apart will alias each other and potentially generate a lot more conflict misses.