[理工] [計組]Set Associative
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
02/03 19:58, 1F
→
02/03 20:09, , 2F
02/03 20:09, 2F
→
02/03 20:24, , 3F
02/03 20:24, 3F
※ 編輯: rockmanexe24 來自: 111.255.141.173 (02/03 20:43)