1. Convert 0X8000 1C61 from the 32-bit sign and magnitude format to a decimal nu
ID: 3802879 • Letter: 1
Question
1. Convert 0X8000 1C61 from the 32-bit sign and magnitude format to a decimal number
2. Convert 0x8000 2305 from the 32-bit sign and magnitude format to a decimal number.
3. Convert 0x0000 1290 from the 32-bit one's complement format to a decimal number.
4. Convert 0xFFFF DCF0 from the 32-bit one's complement format to a decimal number.
5. Convert 0x0000 1A8E from the 32-bit two's complement format to a decimal number.
6. Convert 0xFFFF F25F from the 32-bit two's complement format to a decimal number.
Explanation / Answer
leftmost bit indicates sign which is 1 for negative numbers and 0 for positive numbers
1. Convert 0X8000 1C61 from the 32-bit sign and magnitude format to a decimal number
In sign and magnitude representation leftmost bit represents sign and rest of the bits represent magnitude. Therefore 0X8000 1C61 is a negative number as leftmost bit is 1.
Binary representation of this number is
1000 0000 0000 0000 0001 1100 0110 0001
Eq. decimal number is -7265
2. Convert 0x8000 2305 from the 32-bit sign and magnitude format to a decimal number.
0x8000 2305 is a negative number as the leftmost bit is 1.
binary representation of this number is 1000 0000 0000 0000 0010 0011 0000 0101
Eq. Decimal number is -8965
3. Convert 0x0000 1290 from the 32-bit one's complement format to a decimal number.
In one's Complement number system, positive numbers are represented as regular binary numbers while negative numbers are represented by inverting all bits of binary representation of corresponding +ve number.
0x0000 1290 is a positive number as leftmost bit is 0.
Binary representation of this number is 0000 0000 0000 0000 0001 0010 1001 0000
Eq. Decimal number is +4752
4. Convert 0xFFFF DCF0 from the 32-bit one's complement format to a decimal number.
0xFFFF DCF0 is a negative number as leftmost bit is 1.
Binary representation is 1111 1111 1111 1111 1101 1100 1111 0000
Magnitude of the Decimal number is obtained by inverting all the bits which is
0000 0000 0000 0000 0010 0011 0000 1111
Eq. Decimal number is -8975
5. Convert 0x0000 1A8E from the 32-bit two's complement format to a decimal number.
In Two's complement number system, +ve numbers are represented as regular binary numbers while negative numbers are represented by inverting all the bits of corresponding +ve binary number and then adding 1.
0x0000 1A8E is a +ve number as leftmost bit is 0.
Binary representation is 0000 0000 0000 0000 0001 1010 1000 1110
Eq. Decimal number is +6798
6. Convert 0xFFFF F25F from the 32-bit two's complement format to a decimal number.
0xFFFF F25F is a -ve number as leftmost bit is 1.
Binary representation is 1111 1111 1111 1111 1111 0010 0101 1111
We get Decimal number by flipping all the bits and then adding 1.
which is
0000 0000 0000 0000 0000 1101 1010 0000
+1
0000 0000 0000 0000 0000 1101 1010 0001
Eq. Decimal number is -3489
Please let me know in case of any doubt.
Thanks
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.