[理工] [計組]-幾個疑問

看板Grad-ProbAsk作者 (2010)時間14年前 (2010/01/18 08:35), 編輯推噓0(005)
留言5則, 2人參與, 最新討論串1/1
一、如果題目給 cache line size is XX bytes,是代表一個 block size 大小,還是 一整列的 cache 大小? 二、sra $s0, $t0, 4, if $t0 = 0x87654321 ^^^ 請問式 shift right 然後全部補1嗎? 另外,有一題是這樣的: 1. sll $t2, $t0, 4 // $t0 = 0x11111111 andi $t2, $t2, -1 2. srl $t2, $t0, 3 // $t0 = 0x11111111 andi $t2, $t2, 0xFFFF 做出來好奇怪,可否講述一下做法。 三、A page fault occurs when the page table entry cannot be found in the translation lookaside buffer. 答案是給 T,但我覺得是 F。請問該怎麼解釋,這應該只是 TLB miss 不是嗎? 應該是再看 page 是否有再 memory 內,才是 page fault 吧? 感謝~ -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.57.78.219

01/18 10:04, , 1F
sra:shift right arithmetic,右移補sign bit,這裡是1
01/18 10:04, 1F

01/18 10:04, , 2F
srl,sll 為shift right(left) logical,移完補0
01/18 10:04, 2F

01/18 10:16, , 3F
是沒錯,我式卡再 andi $t2, $t2, -1 這個
01/18 10:16, 3F

01/18 10:17, , 4F
假設是第一題好了→00010001000100010001000100010000
01/18 10:17, 4F

01/18 10:18, , 5F
andi $t2,$t2,-1 該怎放?補到32bit還是放右半部就好?
01/18 10:18, 5F
文章代碼(AID): #1BKwo-2Q (Grad-ProbAsk)