In decimal number system (+) sign or (no sign) is used to denote a positive number and a minus (-) sign to denote negative number. This representation of numbers is know as signed number. As we know that digital systems can understand only two symbols, 0 and 1, which are actually the voltage levels; therefore +/- sign in front of values cannot be used in binary to show sign.
In binary numbering system, an additional bit is used as the sign bit and it is placed at the most significant bit position. But is is also necessary to clearly mentioned that a number is signed number, so that the sign bit is not taken into equivalent value calculation, and should only indicate sign i.e (+) or (-). For unsigned binary numbers, all the bits should be considered for value calculation.
For example, when it is said that 10101100 is a signed binary number, the 8th bit is sign bit, and should not be taken into value calculation, it is only indicating -ve value, and the remaining 7 bits should be used for equivalent value calculation. Hence decimal equivalent of signed (10101100)2 is -44 and not 172. Below is shown how 4 bit binary number represents different value when declared as unsigned binary number and signed binary number.
Sign and unsigned representation table..
Decimal number Signed magnitude UnSigned magnitude 0 0000 0 1 0001 1 2 0010 2 3 0011 3 4 0100 4 5 0101 5 6 0110 6 7 0111 7 -8 - -7 1111 15 -6 1110 14 -5 1101 13 -4 1100 12 -3 1011 11 -2 1010 10 -1 1001 9 -0 1000 8
There are two more ways to represent signed numbers, these are :- one's complement representation and two's complement representation.
One's Compliment Representation : In any signed binary number, if each '1' is replaced by '0' and each '0' by '1', then the resulting number is know as the "one's complement" of the original number. Both the numbers are complement of each other. If the original number was positive, then the one's compliment number will be negative, and of the same magnitude. Similarly, if the original number was negative, then the one's complement number will positive, and of the same magnitude. For example, one's complement of (0101)2 is (1010)2. Where, (0101)2 represents (+5)10, and (1010) 2 represents (-5)10.
One's complement representation table ..
Decimal number One's complement representation 0 0000 1 0001 2 0010 3 0011 4 0100 5 0101 6 0110 7 0111 -8 - -7 1000 -6 1001 -5 1010 -4 1011 -3 1100 -2 1101 -1 1110 -0 1111