看板 Grad-ProbAsk 關於我們 聯絡資訊
題目是轉成MIPS 我不太懂sll的用途 如圖 https://www.dropbox.com/s/01olslaykeo21t1/2014-01-16%2013.11.27.jpg
請問為什麼這裡要用sll左移呢? 不好意思小弟資質愚鈍,大三以前的只記得pipeline怎麼做... 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 36.231.54.219
ken1325:因為要乘4 01/16 13:23
asadman1523:乘以4做甚麼? 01/16 13:27
conbanwa:0->4就是向左shift 2bits 01/16 13:28
ken1325:那你知道為什麼上一行是16($s7)而不是4($s7)嗎 01/16 13:29
conbanwa:二進制數字系統左移兩bits就是乘四 01/16 13:29
conbanwa:1byte is 8bits 1word is4 bytes 01/16 13:31
conbanwa:Memory stored unit is called a block .. a block is on 01/16 13:31
conbanwa:e word 01/16 13:32
conbanwa:So the [ ] index 1presents a word for 4 bytes=1 word 01/16 13:33
conbanwa: Increasing 1 index in[ ] means go by a block=1word=4 01/16 13:35
conbanwa:bytes and which in memory address usually call byte ad 01/16 13:38
conbanwa:dress 以上是based on MIPS ISA01/16 13:48
ken1325:假設B[4]取出的值是7,你要取A[7]是不是要先把7乘4 01/16 13:34 謝謝conbanwa與ken1325 我懂了....好慚愧Q_Q
conbanwa:幹我這砲灰味濃郁的竟然可以教人 01/16 13:49
asadman1523:我是砲灰底下的灰塵.. 01/16 13:49
※ 編輯: asadman1523 來自: 36.231.54.219 (01/16 13:51)