Hi,

Me and my excellent laboration partner faced a question as we were discussing how cache memories worked. Providing we have an empty cache memory (i.e. the valid bits of all sets respectively are equivalent to 0), with a block size of 2 words and an associativity of 1, to which we write 1 word to a specific address – what will happen if we try to read from the other word, in the same block?

We have considered the following realistic possibilities, but we have not yet been able to figure out which one (if any) that's the correct:

  • The cache memory reads from the RAM and copies the content of the second word upon writing to the first, setting V = 1.
  • The cache memory still has V = 0 upon reading from the second word (after we have written to the first), yielding a cache miss and hence a full block read from the RAM.

Thanks in advance!

Kind regards,
Martin Pola