Please convert the following bit pattern to a MIPS instruction.
0000 0001 0110 0110 0100 1000 0010 0000
1000 1101 1001 1010 0000 0000 0001 1100
Converting bit patterns to a MIPS instruction.
bit pattern 1:
0000 0001 0110 0110 0100 1000 0010 0000
The first 6 digits 000000
The given code is for ADD instruction.
Splitting the opcodes:
000000|01011|00110|01001|00000|100000
Instruction:
ADD rd,rs,rt
opcode | rs | rt | rd | shift amt | function |
6 bits | 5 bits | 5bits | 5bits | 5bits | 6 bits |
000000 | 01011 | 00110 | 01001 | 00000 | 100000 |
Registers for codes
01011 --->$t3
00110 --->$a2
01001 --->$t1
Complete Final instruction :
add $t1,$t3,$a2.
bit pattern
2:
1000 1101 1001 1010 0000 0000 0001 1100
The first 6 digits 100011
The given instruction is for LW instruction.
Splitting the opcodes:
100011|01100|11010|0000 0000 0001 1100
Instruction:
LW rt,offset(rs)
opcode | rs | rt | address |
6bits | 5bits | 5bits | 16bits |
1000011 | 01100 | 11010 |
0000 0000 0001 1100 |
Registers for codes
01100 --->$t4
11010 --->$k0
Offset address in the code must be hexadecimal
0000 0000 0001 1100 into hexa is
0000-->0
0000-->0
0001-->1
1100-->C
Therfore hexa code:
0x001C
Complete Final instruction :
lw $k0,0x001C($t4)
Get Answers For Free
Most questions answered within 1 hours.