Caching 处理多字块直接映射缓存

Caching 处理多字块直接映射缓存,caching,Caching,我完全理解直接映射、关联和集合关联缓存,但当我发现多字块直接映射缓存时,我被难住了 以下是Patterson的Q7.9和Q7.10: 7.9[10] <§7.2> Here is a series of address references given as word addresses: 2, 3, 11, 16, 21, 13, 64, 48, 19, 11, 3, 22, 4, 27, 6, and 11. Assuming a direct-mapped cache with

我完全理解直接映射、关联和集合关联缓存,但当我发现多字块直接映射缓存时,我被难住了

以下是Patterson的Q7.9和Q7.10:

7.9[10] <§7.2> Here is a series of address references given as word addresses: 2,
3, 11, 16, 21, 13, 64, 48, 19, 11, 3, 22, 4, 27, 6, and 11. Assuming a direct-mapped
cache with 16 one-word blocks that is initially empty, label each reference in the
list as a hit or a miss and show the final contents of the cache.

7.10[10] <§7.2> Using the series of references given in Exercise 7.9, show the hits
and misses and final cache contents for a direct-mapped cache with four-word
blocks and a total sizeof 16 words. 
7.9[10]这里有一系列地址引用,作为单词地址给出:2,
3、11、16、21、13、64、48、19、11、3、22、4、27、6和11。假设直接映射
缓存16个最初为空的单字块,在
按命中或未命中列出,并显示缓存的最终内容。
7.10[10]使用练习7.9中给出的一系列参考资料,显示点击次数
以及具有四个字的直接映射缓存的未命中和最终缓存内容
块,总大小为16个字。
7.9很好,很简单。但我不明白7.10是怎么工作的。它将有4个4字大小的块。这与4路集关联缓存有何不同


如果可能的话,有人能指导我解决7.10问题吗?我有答案,但我不明白。在7.10中,你必须是缓存。 为每个缓存块绘制框(4个字)。对于顺序中的每个单词地址,计算出它将进入哪个框。如果盒子里已经有地址,那就是成功了。否则将丢失,您必须在当前参考地址处按缓存线大小对齐,在框中填入4个单词

例如,当您访问word 2时,您将填写单词0,1,2,3。单词3的下一个引用将会很成功,因为它已经在缓存中了。访问word 16将逐出其中包含0,1,2,3的块,并将其填充为16,17,18,19