作者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
推 ymsmart:感覺應該要 a slot(=entry)=18+(8*16)=146 bits 05/21 01:52
→ bernachom:18是不是TAG在加上valid bit呢? 謝謝 05/21 02:00
→ uminchu185:block是放data的, 如果cache hit, cpu就直接存取data了 05/22 15:48
→ uminchu185:所以block size要包含在entry裡面 05/22 15:50