(MIPS) A branch could access addresses that were -8191...8192 distance from the current $pc. However the 2's complement integer has values from -8192..8191. Why the discrepancy between the value of the 2's complement integer and the size of the branch?
The value of a 2's complement integer is in the range -8192 ... 8191 while a branch can access addresses -8191 to 8192 distance from the current pc.
This is because the 2's complement address is added to the next instruction pc and not the current one.
That means from pc + 1 we can access addresses in the range -8192 to 8191.
Thus from pc we can access addresses in the range -8192 + 1 = -8191 to 8191 + 1 = 8192.
You can comment below the answer in case of any doubts and I will be happy to help.
Please give a thumbs up if the answer could be of help!
All the best!
Get Answers For Free
Most questions answered within 1 hours.