This question investigates certain anomaly of data types. Use the following tabl
ID: 3852881 • Letter: T
Question
This question investigates certain anomaly of data types.
Use the following table to convert the 32-bit integer value X=-2147483648 to binary form, and then compute its 2’s complement in binary form.
Integer value of X:
-2147483648
Binary value of X:
Byte 3
Byte 2
Byte 1
Byte 0
2’s complement of X in binary form (toggle all bits and add 1):
Byte 3
Byte 2
Byte 1
Byte 0
Integer value of X:
-2147483648
Binary value of X:
Byte 3
Byte 2
Byte 1
Byte 0
2’s complement of X in binary form (toggle all bits and add 1):
Byte 3
Byte 2
Byte 1
Byte 0
Explanation / Answer
Integer value of X:
-2147483648
Binary value of X:
Byte 3
Byte 2
Byte 1
Byte 0
10000000
00000000
00000000
00000000
2’s complement of X in binary form (toggle all bits and add 1):
Byte 3
Byte 2
Byte 1
Byte 0
10000000
00000000
00000000
00000000
-2147483648 :
Binary value is
10000000000000000000000000000000
If we take the 2s complement we will get
10000000000000000000000000000000
Integer value of X:
-2147483648
Binary value of X:
Byte 3
Byte 2
Byte 1
Byte 0
10000000
00000000
00000000
00000000
2’s complement of X in binary form (toggle all bits and add 1):
Byte 3
Byte 2
Byte 1
Byte 0
10000000
00000000
00000000
00000000
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.