The set for block position contents of data cache 0 0 1 2 3 1 0 1 2 3 is as follows:
Step-by-step explanation:
Total number of blocks = 8
The cache mapping used is 4 way set associative.
Number of sets = 8 by 4 = 2 that is set 0 and set 1.
The mapping in a set associative takes place as:
Location for a memory block in cache = Memory block mod number of sets in the cache.
The first address is 4.
Location of the block with address 4 = 4 mod 2 = Set 0.