[問題] 計組

看板Grad-ProbAsk作者 (smallA)時間15年前 (2009/03/19 18:34), 編輯推噓2(2010)
留言12則, 3人參與, 最新討論串1/3 (看更多)
block address 0 2 0 2 0 0 2 0 2 0 4-one word blocks 請問一下 direct mapped 的 tag 及 index 是 block address / 4 商數放tag 餘數放index嗎? 另外two-way set associative 的tag與index fully associative 的 tag 要如何計算? 謝謝! 推文還是看不太懂 不好意思 直接寫題目好了 reference adderss 1 4 8 5 20 ...... assume that 2-way set associative cache is with 4word blocks and total size is 32 words ... 解答是寫 reference adderess(dec) (bin) tag index h/m 1 000001 0 0 m 4 000100 0 1 m 8 001000 0 2 m 5 000101 0 1 h 20 010100 1 1 m 我想要知道 他tag及index 是怎麼算出來的 謝謝! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.229.111.201

03/19 18:42, , 1F
block address/block size..商數是這個word要放置的block
03/19 18:42, 1F

03/19 18:43, , 2F
位置,餘數是它block offset
03/19 18:43, 2F

03/19 18:45, , 3F
tag是比對資料用的,inedx是尋找cache內set用的
03/19 18:45, 3F

03/19 18:48, , 4F
不知道block address是什麼進制?
03/19 18:48, 4F

03/19 18:48, , 5F
block address /set數,商數放tag,餘數放index
03/19 18:48, 5F

03/19 18:49, , 6F
block address應該不用除block size了吧,word/byte address
03/19 18:49, 6F

03/19 18:49, , 7F
才需要吧,block address指的不就是要放的block?
03/19 18:49, 7F

03/19 18:50, , 8F
block數/associativity = set數,其中full的話set = 1
03/19 18:50, 8F
※ 編輯: a12548 來自: 61.229.111.201 (03/19 19:04)

03/19 19:00, , 9F
樓上對,想錯了
03/19 19:00, 9F

03/19 19:08, , 10F
以下面那題來說,4 word-block共32 word,所以有8 blocks
03/19 19:08, 10F

03/19 19:08, , 11F
2-way,所以是4 set,題目給的address應該是word address
03/19 19:08, 11F

03/19 19:09, , 12F
所以6 bit分成 2 bit tag,2 bit index,2 bit offset
03/19 19:09, 12F
文章代碼(AID): #19mX-Wfm (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #19mX-Wfm (Grad-ProbAsk)