How to translate I-type instruction to its 32-bit representation?

140 views Asked by At

Given the following instruction:

addi $s0, $0, −10

I need to compute it's 32-bit representation. Since addi is I-type instruction

the opcode for addi is 001000.

Rs is $0, which is 00000

Rt os $s0, which is 10000

how do i compute the remaining 16 bit for -10? I converted 10 to binary and found its one's and two's complement and added a 1 (negative bit) to the leftmost side.

I got 001000 00000 10000 1000000011110110 which translates to 0x201080F6, but it is incorrect.

What am i doing wrong?

0

There are 0 answers