"In a 2-way set associative cache of 4 blocks containing 4 words each, which one of these addresses will return a hit when being read? The blocks to be retained in the cache are decided by LRU."
4 word / block means that the offset = 2 bits.
2-way means 4 blocks / 2 = 2 sets. The index then needs 1 bit.
And thus the tag is 3 bits, since we're dealing with 6 bits adresses.
What I'm not too sure about is the hit/miss part. In such a case, do we need to have an exact match for the Index, the Tag and the Offset to get a hit?
Or is a hit encountered as soon as the Index and the Tag match?
If it is the latter then what role plays the offset in such a situation?