Obtain the 1’s and 2’s complements of the following binary numbers:
(a) 00010000 (b) 00000000
(c) 11011010 (d) 10101010
(e) 10000101 (f) 11111111
Ans: 1’s complement means changing 1’s to 0’s and 0’s to 1’s.
2’s complement is obtained by adding 1 to the 1's complement.
(a) binary number - 00010000
1’s complement - 11101111
2’s complement - 11110000
(b) binary number - 00000000
1’s complement - 11111111
2’s complement - 00000000
(c) binary number - 11011010
1’s complement - 00100101
2’s complement - 00100110
(d) binary number - 10101010
1’s complement - 01010101
2’s complement - 01010110
(e) binary number -10000101
1’s complement- 01111010
2’s complement- 01111011
(f) binary number - 11111111
1’s complement- 00000000
2’s complement- 00000001