Similar questions 2 more →
Cache Memory

Answer & solution
Answer: C (no official key was published)
1. Four blocks in a two-way cache means two sets. With the standard block-number modulo 2 mapping,8,12,0 all map to the same set.
2. Starting empty:8 miss gives[8];12 miss gives[8,12];0 miss evicts least-recent 8, giving[12,0];12 hits and becomes MRU;8 misses and evicts 0. Thus four misses.
3. The unused other set cannot absorb these conflicting blocks. An initially empty cache and conventional set indexing are assumed.
4. Teaching check: Only two ways are available in the even-numbered set despite four blocks existing overall. The access to 12 after inserting 0 is a hit and changes recency. That change determines which entry is evicted on the final 8 reference, although the miss count remains four.