Convert the following MIPS assembly code into machine language. Write the instru
ID: 3684324 • Letter: C
Question
Convert the following MIPS assembly code into machine language. Write the instructions in hexadecimal.
add $t0. $s0. $s1
lw $t0. 0x20($t7)
addf $s0. $0. -10
(a) write down the hexadecimal representation of the first instruction from the set of 3 instructions in this question
(b) write down the hexadecimal representation of the second instruction from the set of 3 instructions in this question
(c) write down the hexadecimal representation of the third instruction from the set of 3 instructions in this question
Explanation / Answer
add $t0 $s0 $s1:
SPECIAL $s0 $s1 $t0 0 ADD
000000 10000 10001 01000 00000 100000
Binary: 00000010000100010100000000100000
Hex: 0x02114020
------------------------------------------------
lw $t0, 0x20($t7):
LW $t7 $t0 offset
100011 01111 01000 0000000000100000
Binary: 10001101111010000000000000100000
Hex: 0x8DE80020
------------------------------------------------
addf $s0. $0. -10:
This instruction is not in correct format. No register mention
near $0