[理工] [計組]-計憶體管理

看板Grad-ProbAsk作者 (the one)時間14年前 (2009/10/10 23:50), 編輯推噓1(102)
留言3則, 2人參與, 最新討論串1/1
題目: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

10/11 02:03, , 1F
要以word做為block的單位,因為Cpu一次存取就是一個word.
10/11 02:03, 1F

10/11 14:02, , 2F
可是有些題目的OFFSET不是都以BYTE為單位嗎??
10/11 14:02, 2F

10/11 14:03, , 3F
好混亂呀!!
10/11 14:03, 3F
文章代碼(AID): #1AqAqkMM (Grad-ProbAsk)