[問題] 計組-一題記憶體

看板Grad-ProbAsk作者 (Terry)時間16年前 (2009/05/21 01:24), 編輯推噓1(103)
留言4則, 3人參與, 最新討論串1/1
請教一下 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

05/21 01:52, , 1F
感覺應該要 a slot(=entry)=18+(8*16)=146 bits
05/21 01:52, 1F

05/21 02:00, , 2F
18是不是TAG在加上valid bit呢? 謝謝
05/21 02:00, 2F

05/22 15:48, , 3F
block是放data的, 如果cache hit, cpu就直接存取data了
05/22 15:48, 3F

05/22 15:50, , 4F
所以block size要包含在entry裡面
05/22 15:50, 4F
文章代碼(AID): #1A53ovDp (Grad-ProbAsk)