Number Systems
5
The 1’s complement of a binary number is obtained by complementing all its bits, i.e. by replacing
0s with 1s and 1s with 0s. For example, the 1’s complement of (10010110) 2 is (01101001) 2 . The 2’s
complement of a binary number is obtained by adding ‘1’ to its 1’s complement. The 2’s complement
of (10010110) 2 is (01101010) 2 .
1.7.2 Decimal Number System
Corresponding to the 1’s and 2’s complements in the binary system, in the decimal number system we
have the 9’s and 10’s complements. The 9’s complement of a given decimal number is obtained by
subtracting each digit from 9. For example, the 9’s complement of (2496) 10 would be (7503) 10 . The
10’s complement is obtained by adding ‘1’ to the 9’s complement. The 10’s complement of (2496) 10
is (7504) 10 .
1.7.3 Octal Number System
In the octal number system, we have the 7’s and 8’s complements. The 7’s complement of a given
octal number is obtained by subtracting each octal digit from 7. For example, the 7’s complement of
(562) 8 would be (215) 8 . The 8’s complement is obtained by adding ‘1’ to the 7’s complement. The 8’s
complement of (562) 8 would be (216) 8 .
1.7.4 Hexadecimal Number System
The 15’s and 16’s complements are defined with respect to the hexadecimal number system. The 15’s
complement is obtained by subtracting each hex digit from 15. For example, the 15’s complement of
(3BF) 16 would be (C40) 16 . The 16’s complement is obtained by adding ‘1’ to the 15’s complement.
The 16’s complement of (2AE) 16 would be (D52) 16 .
1.8 Number Representation in Binary
Different formats used for binary representation of both positive and negative decimal numbers include
the sign-bit magnitude method, the 1’s complement method and the 2’s complement method.
1.8.1 Sign-Bit Magnitude
In the sign-bit magnitude representation of positive and negative decimal numbers, the MSB represents
the ‘sign’, with a ‘0’ denoting a plus sign and a ‘1’ denoting a minus sign. The remaining bits represent
the magnitude. In eight-bit representation, while MSB represents the sign, the remaining seven bits
represent the magnitude. For example, the eight-bit representation of +9 would be 00001001, and that
for −9 would be 10001001. An n−bit binary representation can be used to represent decimal numbers
in the range of −(2
n−1
− 1) to +(2
n−1
− 1). That is, eight-bit representation can be used to represent
decimal numbers in the range from −127 to +127 using the sign-bit magnitude format.
5
The 1’s complement of a binary number is obtained by complementing all its bits, i.e. by replacing
0s with 1s and 1s with 0s. For example, the 1’s complement of (10010110) 2 is (01101001) 2 . The 2’s
complement of a binary number is obtained by adding ‘1’ to its 1’s complement. The 2’s complement
of (10010110) 2 is (01101010) 2 .
1.7.2 Decimal Number System
Corresponding to the 1’s and 2’s complements in the binary system, in the decimal number system we
have the 9’s and 10’s complements. The 9’s complement of a given decimal number is obtained by
subtracting each digit from 9. For example, the 9’s complement of (2496) 10 would be (7503) 10 . The
10’s complement is obtained by adding ‘1’ to the 9’s complement. The 10’s complement of (2496) 10
is (7504) 10 .
1.7.3 Octal Number System
In the octal number system, we have the 7’s and 8’s complements. The 7’s complement of a given
octal number is obtained by subtracting each octal digit from 7. For example, the 7’s complement of
(562) 8 would be (215) 8 . The 8’s complement is obtained by adding ‘1’ to the 7’s complement. The 8’s
complement of (562) 8 would be (216) 8 .
1.7.4 Hexadecimal Number System
The 15’s and 16’s complements are defined with respect to the hexadecimal number system. The 15’s
complement is obtained by subtracting each hex digit from 15. For example, the 15’s complement of
(3BF) 16 would be (C40) 16 . The 16’s complement is obtained by adding ‘1’ to the 15’s complement.
The 16’s complement of (2AE) 16 would be (D52) 16 .
1.8 Number Representation in Binary
Different formats used for binary representation of both positive and negative decimal numbers include
the sign-bit magnitude method, the 1’s complement method and the 2’s complement method.
1.8.1 Sign-Bit Magnitude
In the sign-bit magnitude representation of positive and negative decimal numbers, the MSB represents
the ‘sign’, with a ‘0’ denoting a plus sign and a ‘1’ denoting a minus sign. The remaining bits represent
the magnitude. In eight-bit representation, while MSB represents the sign, the remaining seven bits
represent the magnitude. For example, the eight-bit representation of +9 would be 00001001, and that
for −9 would be 10001001. An n−bit binary representation can be used to represent decimal numbers
in the range of −(2
n−1
− 1) to +(2
n−1
− 1). That is, eight-bit representation can be used to represent
decimal numbers in the range from −127 to +127 using the sign-bit magnitude format.
