I have a MIPS reference sheet if you could explain the solution that would be much appreciated.
Convert the following MIPS code to hexadecimal machine code:
sub $10, $8, $6
slt $1, $9, 2
1) sub $10, $8, $6 => SPECIAL rs rt rd 0 SUB => SPECIAL $8 $6 $10 0 SUB => 000000 01000 00110 01010 00000 100010 let's convert 00000001000001100101000000100010 to hexadecimal Converting 00000001000001100101000000100010 to hexadecimal 0000 => 0 0001 => 1 0000 => 0 0110 => 6 0101 => 5 0000 => 0 0010 => 2 0010 => 2 So, in hexadecimal 00000001000001100101000000100010 is 0x01065022 Answer: 0x01065022 2) slt $1, $9, $2 => SPECIAL rs rt rd 0 SLT => SPECIAL $9 $2 $1 0 SLT => 000000 01001 00010 00001 00000 101010 Converting 00000001001000100000100000101010 to hexadecimal 0000 => 0 0001 => 1 0010 => 2 0010 => 2 0000 => 0 1000 => 8 0010 => 2 1010 => A So, in hexadecimal 00000001001000100000100000101010 is 0x0122082A Answer: 0x0122082A
Get Answers For Free
Most questions answered within 1 hours.