【发布时间】:2015-08-20 10:13:08
【问题描述】:
最近,我参加了有关缓存的讲座,并尝试解决教科书上的练习。
教科书中有关于直接映射缓存的问题。
给定条件:
all with a total of 8 words of data:
C1 has 1-word blocks,
C2 has 2-word blocks,
C3 has 4-word blocks
给定单词地址:
3, 180, 43, 2, 191, 88, 190, 14, 181, 44, 186, 253
下图是我的答案。
Tag= QUOTIENT(Word Address,8) // total 8 word
Cache 1 index = MOD(QUOTIENT(Word Address,1),8) // 1 word per block, 8 block
Cache 2 index = MOD(QUOTIENT(Word Address,2),4) // 2 word per block, 4 block
Cache 3 index = MOD(QUOTIENT(Word Address,4),2) // 4 word per block, 2 block
我用上面的公式回答了tag,index。
命中/未命中:如果相同的tag,index 已在表中显示。然后打 else 错过
这一个给出了解决方案。
我错过了什么吗? 请帮助我理解这一点...
【问题讨论】: