Discussion
What is the range of instruction addresses to which conditional branches, such as beq and bne can branch in MIPS ?
Answer: A
The range is +/- \(2^{17}\) bytes.
MIPS beq and bne are I-type instructions with a 16-bit signed immediate. The offset counts words (instructions), not bytes, and is added to PC + 4 after being shifted left by 2. A 16-bit signed field spans about \(\pm 2^{15}\) words, and since each word is 4 bytes:
\[ \pm 2^{15} \times 2^{2} = \pm 2^{17} \text{ bytes} \]
\(\pm 2^{16}\) would ignore either the sign bit or the word scaling, \(2^{32}\) is the whole address space, and \(2^{8}\) is far too small for a 16-bit field.
Post your comment
Please log in or register to post a comment.
Examination Categories
- SSC Exams
- Banking Exams
- Teaching Exams
- Civil Services Exams
- Railways Exams
- Engineering Recruitment Exams
- Defence Exams
- State Government Exams
- Police Exams
- Insurance Exams
- Nursing Exams
- Other Government Exams
- NRA CET
- PG Entrance Exams
- Campus Placement
- MBA Entrance Exams
- CUET and UG Entrance
- Judiciary Exams
- Regulatory Body Exams
- Software Development