作者SiriusCloud (古月小楓)
看板Grad-ProbAsk
標題[理工] 計組 cache size
時間Thu Jan 12 00:57:20 2012
For a 32- bit address, determine the total number of bits (including
the tag bits ,data , dirty bits ) to implement a 2-way set associative
cache with 128 KB of data and 2-word(64bits)
<anwser >
(張凡)
(1 + 1 + 16 + 64) * 2 * 16 K
^^^^^^<--- why?
我算的答案是
(1 + 1 + 16 + 64 ) * 2 * 8 K
算了好久 都不對 = = 麻煩了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.41.132.85
1F:推 RichLowkey56:2-word=8byte=2^3byte 17-3=14 , 2^14=16k 01/12 01:21
不好意思 我還是不太懂~
張凡答案如下
Two-word block -> 3 bits of offset field
Number of set = 128KB / (8B * 2) = 8K -> Index field has 14 bits
^^^^^
我是覺得寫錯..我算13
Bits of tag field = 32 - 13 - 3 = 16
Cache bits = (1 + 1 + 16 +64 ) * 2 * 16k
^^^^^^^^
不是2-way * number of set 嗎?
那為什麼不是2 * 8 K
※ 編輯: SiriusCloud 來自: 114.41.132.85 (01/12 01:41)
2F:推 pikachu123:我覺得答案寫錯了 他只有16K個block 01/12 01:48
3F:推 RichLowkey56:幹我好像錯了 我去撞牆QQ 01/12 01:50
4F:推 cpc:這題答案錯 是2 * 8K 才對 張凡上課有改 01/12 01:59
5F:→ SiriusCloud:原來是答案錯了 我還一直算 一直算><'' 01/12 02:47