看板 Grad-ProbAsk 關於我們 聯絡資訊
題目: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
gsrr:要以word做為block的單位,因為Cpu一次存取就是一個word. 10/11 02:03
luckyburgess:可是有些題目的OFFSET不是都以BYTE為單位嗎?? 10/11 14:02
luckyburgess:好混亂呀!! 10/11 14:03