[理工] 張凡計組上 p25

看板Grad-ProbAsk作者 (黑炭)時間10年前 (2014/01/16 13:15), 編輯推噓6(608)
留言14則, 3人參與, 最新討論串1/1
題目是轉成MIPS 我不太懂sll的用途 如圖 https://www.dropbox.com/s/01olslaykeo21t1/2014-01-16%2013.11.27.jpg
請問為什麼這裡要用sll左移呢? 不好意思小弟資質愚鈍,大三以前的只記得pipeline怎麼做... 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 36.231.54.219

01/16 13:23, , 1F
因為要乘4
01/16 13:23, 1F

01/16 13:27, , 2F
乘以4做甚麼?
01/16 13:27, 2F

01/16 13:28, , 3F
0->4就是向左shift 2bits
01/16 13:28, 3F

01/16 13:29, , 4F
那你知道為什麼上一行是16($s7)而不是4($s7)嗎
01/16 13:29, 4F

01/16 13:29, , 5F
二進制數字系統左移兩bits就是乘四
01/16 13:29, 5F

01/16 13:31, , 6F
1byte is 8bits 1word is4 bytes
01/16 13:31, 6F

01/16 13:31, , 7F
Memory stored unit is called a block .. a block is on
01/16 13:31, 7F

01/16 13:32, , 8F
e word
01/16 13:32, 8F

01/16 13:33, , 9F
So the [ ] index 1presents a word for 4 bytes=1 word
01/16 13:33, 9F

01/16 13:35, , 10F
Increasing 1 index in[ ] means go by a block=1word=4
01/16 13:35, 10F

01/16 13:38, , 11F
bytes and which in memory address usually call byte ad
01/16 13:38, 11F

01/16 13:48, , 12F
dress 以上是based on MIPS ISA
01/16 13:48, 12F
ken1325:假設B[4]取出的值是7,你要取A[7]是不是要先把7乘4 01/16 13:34 謝謝conbanwa與ken1325 我懂了....好慚愧Q_Q

01/16 13:49, , 13F
幹我這砲灰味濃郁的竟然可以教人
01/16 13:49, 13F

01/16 13:49, , 14F
我是砲灰底下的灰塵..
01/16 13:49, 14F
※ 編輯: asadman1523 來自: 36.231.54.219 (01/16 13:51)
文章代碼(AID): #1Irshz0T (Grad-ProbAsk)