Assume a 2-way set associative cache with 4 blocks.
consider the following address sequence: 0, 2, 4, 8, 10, 12, 14,16, 0
a.) Simulate a random replacement policy by flipping a coin. Forexample, “heads” means to evict the first block in a set and”tails” means to evict the second block in a set. How many hitsdoes this address sequence exhibit?
b.) Which address should be evicted at each replacment tomaximize the numer of hits? How many hits does this addresssequence exhibit if you follow this “optimal” policy?
Expert Answer
An answer will be send to you shortly. . . . .