[理工] 計組 TLB

看板Grad-ProbAsk作者 (鍵盤007)時間10年前 (2014/01/04 02:49), 編輯推噓4(407)
留言11則, 4人參與, 最新討論串3/4 (看更多)
A virtual memory system often implements a TLB to speed up the virtual-to-physical address translation. A TLB has the following characteristics. Assume each TLB entry has a valid bit, a dirty bit, a tag, and the page number. Determine the exact total number of bits to implement this TLB. -It is direct-mapped. -It has 16 entries. -The page size is 4K bytes. -The virtual address space is 4G bytes. -The physical memory is 1G bytes. 求解 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 220.136.111.245

01/04 09:54, , 1F
(1+1+16+18)*16
01/04 09:54, 1F

01/04 13:29, , 2F
我的答案跟你一樣,但解答給(1+1+18+20)*16
01/04 13:29, 2F
※ 編輯: PTT007 來自: 220.136.111.245 (01/04 13:30)

01/04 15:18, , 3F
VA是32bit PA是30bit offset是12bit 減下來不是18.20嗎
01/04 15:18, 3F

01/04 15:18, , 4F
還是我想法錯了 @@
01/04 15:18, 4F

01/04 15:33, , 5F
direct代表都有固定地方,所以需要index,才會覺得需要
01/04 15:33, 5F

01/04 15:33, , 6F
把20在扣4,剩下當tag,因為TLB通常都是用full associate
01/04 15:33, 6F

01/04 15:33, , 7F
的,所以才平常的tag就是全部的虛擬頁碼,換成這樣應該要
01/04 15:33, 7F

01/04 15:33, , 8F
扣。
01/04 15:33, 8F

01/04 16:04, , 9F
感謝樓上解釋,看到TLB都會想到直接用full associative
01/04 16:04, 9F

01/04 16:05, , 10F
有指定direct-mapped那的確要扣Index才合理 xd
01/04 16:05, 10F

01/07 11:05, , 11F
一樓正解 :)
01/07 11:05, 11F
文章代碼(AID): #1InmOUq2 (Grad-ProbAsk)
討論串 (同標題文章)
文章代碼(AID): #1InmOUq2 (Grad-ProbAsk)