[理工] [計組]Set Associative

看板Grad-ProbAsk作者 (將將(搖滾月亮))時間14年前 (2012/02/03 19:54), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
A cache has 8 blocks with 4-word block size (1 word has 4 bytes) and is two-way set associative. Given the following word address references: 1, 4, 8, 5, 17, 32, 19, 1, 56, 9, 25, 58. Please list if each reference is a hit or a miss, assuming the cache is initially empty. (Note: The first word address of each block is a multiple of 4 and the LRU policy is used.) 一、請問這樣寫是否正確呢? 項次 Word Address Block Address Tag Index/Set Hit/Miss 1 1 0 0 0 M 2 4 1 0 1 M 3 8 2 0 2 M 4 5 1 0 1 Hit 5 17 4 1 0 M 6 32 8 2 0 M 7 19 4 1 0 Hit 8 1 0 0 0 M 9 56 14 3 2 M 10 9 2 0 2 Hit 11 25 6 1 2 M 12 58 14 3 2 M //二、Mem Block Address = Word Address div 4(word/block) 三、(第6項)32是不是替換掉(第1項)1了? 四、題目的4-word block size還代表著 如果有數個set相同且tag相同的項目,中途沒有被替換掉, 而這同一個set、同一個block內的可以放四個項目的意思嗎? 麻請各位大大明示,謝謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 111.255.141.173 ※ 編輯: rockmanexe24 來自: 111.255.141.173 (02/03 19:56) ※ 編輯: rockmanexe24 來自: 111.255.141.173 (02/03 19:57)

02/03 19:58, , 1F
block要是除以四的商吧
02/03 19:58, 1F

02/03 20:09, , 2F
所以應該是word address div 4(word/block)嗎?
02/03 20:09, 2F

02/03 20:24, , 3F
對阿
02/03 20:24, 3F
※ 編輯: rockmanexe24 來自: 111.255.141.173 (02/03 20:43)
文章代碼(AID): #1FAyiB-f (Grad-ProbAsk)