作者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