作者bernachom (Terry)
看板Grad-ProbAsk
标题[问题] 计组-一题记忆体
时间Thu May 21 01:24:08 2009
请教一下
A cache is being designed for a computer with 2^32 bytes of memory.
The cache will have 2k slots and use a 16-byte block. Compute for
both an associative cache and a direct-mapped cache how many bytes
the cache will occupy.
我的疑问是在direct-mapped这边
书上写
16=2^4
index=2^11
tag=32-4-11=17
slot=11+(8*16)=139
cache size=(2K*139)/8 byte
我的疑问是,为什麽slot是11??tag不是17吗??
还有就是...为什麽block大小,会是包含在slot里面??
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.217.228.67
1F:推 ymsmart:感觉应该要 a slot(=entry)=18+(8*16)=146 bits 05/21 01:52
2F:→ bernachom:18是不是TAG在加上valid bit呢? 谢谢 05/21 02:00
3F:→ uminchu185:block是放data的, 如果cache hit, cpu就直接存取data了 05/22 15:48
4F:→ uminchu185:所以block size要包含在entry里面 05/22 15:50