Encode the following instruction
(1) identify the instruction format that will be used,
(2) indicate the values of each of the fields for that format in decimal,
(3) convert each of these decimal val- ues to binary
4) represent the entire instruction as one hexadecimal value.
subu $t3,$v1,$s2
subu $t3,$v1,$s2 1) subu $t3,$v1,$s2 This is an R-type instruction 2) opcode -> 000000 rs -> $v1 -> 3 rt -> $s2 -> 18 rd -> $t3 -> 11 shamt/shift -> 0 funct -> SUBU -> 19 3) 3 in binary is 00011 18 in binary is 10010 11 in binary is 01011 19 in binary is 100011 so, instruction in binary is 000000 00011 10010 01011 00000 100011 Instruction in binary: 00000000011100100101100000100011 4) Converting 00000000011100100101100000100011 to hexadecimal 0000 => 0 0000 => 0 0111 => 7 0010 => 2 0101 => 5 1000 => 8 0010 => 2 0011 => 3 So, in hexadecimal 00000000011100100101100000100011 is 0x00725823 Instruction in hexadecimal: 0x00725823
Get Answers For Free
Most questions answered within 1 hours.