Given the 32bit pattern 1010 1101 0001 0000 0000 0000 0000 0
Given the 32-bit pattern: 1010 1101 0001 0000 0000 0000 0000 0110 What does it represent, assuming it is:
a) A 2\'s complement signed integer?
b) A MIPS instruction?
Solution
a) A 2\'s complement signed integer:
The given number in hexadecimal is 0xAD100006
It\'s first (leftmost) bit is 1, which means that this represents a number that is negative. To see what this number is a negative of, we reverse the sign of this number. The inversion of the given binary number is, obviously:
0101 0010 1110 1111 1111 1111 1111 1001
Then we add one to the above number.
0101 0010 1110 1111 1111 1111 1111 1010
So the negative of 0xAD100006 is 0x52EFFFFA which in decimal is 1391460346.
So 0xAD100006 is -1391460346
b) A MIPS instruction:
The given number is 0xAD100006. Since the opcode that is the first 6 bits are not 000000, the above MIPS instruction falls in to I-type of MIPS. Thus the MIPS instruction is
101011 sw rt immediate (rs)
