看板 Grad-ProbAsk 關於我們 聯絡資訊
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