Question

Assignment Consider the following program $s4,1648(Ss2) L1 w L2: addi $s4,$t3,-12 L3 beq $s4,St6,L5 $s4,8t6,L1 L1 L4: bne L5:

0 0
Add a comment Improve this question Transcribed image text
Answer #1

lw $s4,1648($s2)

Format : opcode(6-bit)     rs(5-bit)     rt(5-bit)            offset(16-bit)

              10011(lw)        10010($s2)    10100 ($s4)    0000 0110 0111 0000(1648)

Convert to hex:0X8E540670

------------------------------------------------------------------------------------------------------------       
addi $s4,$t3,-12

Format: opcode(6-bit)               rt(5-bit)                rs(5-bit)         immediate(16-bit)

             001000(addi)            01011($t3)            10100($s4)     1111 1111 1111 0100(-12)

Hex: 0X2174FFF4

-----------------------------------------------------------------------------------------------------------
beq $s4,$t6,L5

Format: Opcode(6-bit)           rs(5-bit)             rt(5-bit)          Offset

              000100(beq)          10100($s4)          01110($t6)      0000 0000 0000 0001(L5->After 1 instruction)

Hex: 0X128E0001

----------------------------------------------------------------------------------------------------------------------------
bne $s4,$t6,L1

Format: Opcode(6-bit)           rs(5-bit)             rt(5-bit)            Offset

              000101(beq)          10100($s4)          01110($t6)      1111 1111 1111 1110(L1>2 instruction before , so become negative)

Hex: 0X168EFFFC

--------------------------------------------------------------------------------------------------------------------------------
j L1

Format: Opcode(6-bit)            Target(26-bit)

              000010(j)                 11 0011 0011 0101 0101 1001 1110(L1 address and right shift 2)

       Hex: 0X0B333559E

Add a comment
Know the answer?
Add Answer to:
Assignment Consider the following program $s4,1648(Ss2) L1 w L2: addi $s4,$t3,-12 L3 beq $s4,St6,L5 $s4,8t6,L1 L1...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT