Here is an example of table with 32 bit addresses and their respective indexes and tags. The cache has a total of 8 blocks and 2-word blocks.

enter image description here

So since we have 2 word blocks, that means that the offset is 1 and we use the least most significant bit as the offset. So in the first row, it not only brings 3 but it also brings 2 into the cache because the offset bit is 1(why not 4 if the offset bit is 1). Now I understand that the importance of this is to reinforce the idea of spatial locality, I just want to understand more about the procedure and what kinds of conflict it would cause if it was the other way around. If you can show it with an example that would be great.

  • $\begingroup$ I have a fairly large monitor and it's almost impossible for me to read your image. I can only imagine what it would be like on a phone. It would be helpful if you transcribed the image into text. $\endgroup$ – Rick Decker Jan 28 '16 at 1:48

The two-word blocks are always aligned, and you can find where they start by zeroing the LSB. So the two blocks are always of the form $x0,x1$. So if you fetch $x1$ you also fetch $x0$, and vice versa. This makes indexing the block easy, since to find what block a word belongs to, you just need to drop the LSB.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.