MIPS Relative Addressing

mips

Can somebody please help me answer these three questions?:

Two identified here:
http://s11.postimage.org/lrb0exx5v/Capture2.png
When we multiply the immediate operand by 4, do we multiply the binary or the decimal by 2^2? Is the addition sign for concatenation?

What is the maximum offset from $s?:
http://s11.postimage.org/emt75wpwj/Capture.png

Thank you in advance!

Best Answer

Addition sign is for relative addressing not concatenation. $PC=$PC +I*4; means that program counter will point from itself by I*4 locations.

"What is maximum branch distance?" If we look beq or bne instruction, OP, RS, RT, OFFSET = 32bits. For offset is reserved 16bits so the maximum branch distance is 2^16=65535. Sometimes 2^16 is not enough to reach location jump and than you may use unconditional jump.

"What is the maximum offset from $s" I beleive the answer is the same 2^16.