Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What value is added to the PC when the bne instruction branch is taken? What is

ID: 3729377 • Letter: W

Question

What value is added to the PC when the bne instruction branch is taken?
What is the immediate value in the 16 bit field of the bne instruction?
please explain how it's 0008 and 0002

Addressing mode Address 0x00400600 add $to, St1, t.2 bne s1, Ss2, end addi $s1, $s1,-1 immediae lw $s2, 16(St0) end top Answer the questions about the code above. Give your answers in 8 hexadecimal digits. what value is inserted into the PC when the jump instruction is executed? O XyOG7 What is the value in the 26 bit field ofthe jump statement? O-loo What is the value of the PC when the bne instruction is executed? What value is added to the PC when the bne instruction branch is taken?_000 What is the immediate value in the 16 bit field of the bne instruction?_0O 6x009D008

Explanation / Answer

Branch instructions use I instruction format which contains

Here immediate specifies the relative address from PC because PC is 32 bit and immediate is 16 bit. so we cannot store entire address in immediate field.

One instruction is 32 bit i.e 4 byte. So number of bytes needs to be added to PC will always be in multiple of 4 (because memory is byte addressable).

So if branch is taken then it will add (immediate*4) to PC+4.

Immediate value is number of instructions to skip starting from the instruction following the branch.

In our case there are 2 instructions to jump. So immdiate value is 2 and value added to PC+4 is (2*4) i.e 8

Opcode rs rt Immediate
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote