作者RoyalCh (不想當小螺絲釘!)
看板Grad-ProbAsk
標題[理工] 計組 98台聯大
時間Wed Jan 4 10:45:07 2012
A MIPS branch instruction performs a modification of PC+4
if the condition is true.The maximum range of the jump is PC+4-A to
PC+4+B where both A and B are positive numbers.
What are A and B?
I type的 instruction裡面
address的欄位是16個bits
所以我寫了 B=2^16-4 A=2^16
可是答案是17次
想問一下為什麼
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.113.67.165
推 qqoil:(PC+4)單位是Byte,instruction address單位是word 01/04 10:51
→ RoyalCh:為什麼不是*4? 一個word 不是4byte嗎 01/04 10:53
→ RoyalCh:(2^16-1)*4 這樣 01/04 10:54
推 JiDung:可跳的範圍的確是2^16 * 4 沒錯 01/04 10:57
→ qqoil:分支區間 -2^15~2^15-1 word 01/04 10:57
→ JiDung:所以範圍大小是2^18 bytes 而範圍起點終點是 01/04 10:57
→ JiDung:-2^17 ~ 2^17 -1 01/04 10:57
→ RoyalCh:阿 我知道了...謝謝 01/04 10:58