作者luckyburgess (the one)
看板Grad-ProbAsk
标题[理工] [计组]-计忆体管理
时间Sat Oct 10 23:50:02 2009
题目:A set-assocative has a block size of four 32-bit words and a set size
of 2. The cache can accommodate a total of 128K Bytes from main memory.
The main memory size that is cacheable 4M * 32bits.
(1) Design and draw the block diagram of the cache structure.
高铭书上的解答:
2
1 block = 4 * 32bit = 4 word = 2 word
128k Byte 13
cache block 数 = ---------- = 2 block
4 word
13
2
set 数 = -------- = 4096 set
2
------------------------------
M.M 位址: | TAG | SET | WORD |
------------------------------
\ 8bit / \ 12bit /\ 2bit /
以下省略(图的部份)
---------------------------------------------------------------------------
问题:
想问一下就是它这题是用word来当block的单位,
那假如我现在用bytes来当block的单位这样可以吗??
也就是offset= 4 bit, set仍是12 bit
TAG变成 24 bit (4M*32bit = 2 ^ 24 byte) - 4bit - 12bit
= 8 bit
感谢!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.134.213.201
1F:推 gsrr:要以word做为block的单位,因为Cpu一次存取就是一个word. 10/11 02:03
2F:→ luckyburgess:可是有些题目的OFFSET不是都以BYTE为单位吗?? 10/11 14:02
3F:→ luckyburgess:好混乱呀!! 10/11 14:03