In: Computer Science
Suppose the opcode of an MIPS instruction is 12 in decimal, and the rest of the machine code is 23483DB in hexadecimal (from high-order bit to low-order bit). What is the instruction? When showing the registers, use names (e.g. $t0, $s2) instead of indices (e.g $8, $17). For branch instructions, show offset in place of label, e.g. beq $t1, $t2, 92.
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 23483DB to binary
2 => 0010
3 => 0011
4 => 0100
8 => 1000
3 => 0011
D => 1101
B => 1011
So, in binary 23483DB is 10001101001000001111011011
opcode = 12
so, first 6 bits are 001100
instruction in binary is 001100 10001101001000001111011011
=> 00110010001101001000001111011011
=> 001100 10001 10100 1000001111011011
=> opcode rs rt immediate
=> ANDI $s1 $s4 immediate
Converting 1000001111011011 to hexadecimal
1000 => 8
0011 => 3
1101 => D
1011 => B
So, in hexadecimal 1000001111011011 is 0x83DB
so, instruction is andi $s4, $s1, 0x83DB
Answer:
--------
andi $s4, $s1, 0x83DB