In: Computer Science
Convert these machine codes to MIPS instructions:
Ox29210003, and Ox8e460002
1)
Hexadecimal Binary
0 0000
1 0001
2 0010
3 0011
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
A 1010
B 1011
C 1100
D 1101
E 1110
F 1111
Use this table to convert from hexadecimal to binary
Converting 29210003 to binary
2 => 0010
9 => 1001
2 => 0010
1 => 0001
0 => 0000
0 => 0000
0 => 0000
3 => 0011
So, in binary 29210003 is 00101001001000010000000000000011
=> 00101001001000010000000000000011
=> 001010 01001 00001 0000000000000011
=> SLTI $t1 $at immediate
=> SLTI rs rt immediate
so, instruction is slti $at, $t1, 3
Answer:
--------
slti $at, $t1, 3
2)
Converting 8E460002 to binary
8 => 1000
E => 1110
4 => 0100
6 => 0110
0 => 0000
0 => 0000
0 => 0000
2 => 0010
So, in binary 8E460002 is 10001110010001100000000000000010
=> 10001110010001100000000000000010
=> 100011 10010 00110 0000000000000010
=> LW $s2 $a2 offset
=> LW base rt offset
so, instruction is lw $a2, 2($s2)
Answer:
---------
lw $a2, 2($s2)