2. Representation of Binary Numbers:
• Binary numbers can be represented in signed
and unsigned way.
• Unsigned binary numbers do not have sign bit.
• Whereas signed binary numbers uses signed
bit as well as these can be distinguishable
between positive and negative numbers
T.Srikrishna, M.Sc, M.Tech. GVP
4. 1. Unsigned Numbers:
• Unsigned numbers don’t have any sign, these can
contain only magnitude of the number.
Representation of Unsigned Binary Numbers:
• Since there is no sign bit in this unsigned binary
number, so N bit binary number represent its
magnitude only.
• Zero (0) is also unsigned number. This representation
has only one zero (0), which is always positive.
• Example-1: Represent decimal number 92 in unsigned
binary number.
(92)10= (1011100)2
• It’s 7 bit binary magnitude of the decimal number 92.
T.Srikrishna, M.Sc, M.Tech. GVP
5. 2. Signed Numbers:
• Signed numbers contain sign flag, this
representation distinguish positive and
negative numbers. This technique contains
both sign bit and magnitude of a number.
• (a) Signed Magnitude Method.
• (b) 1’s Complement Method.
• (c) 2’s Complement Method.
T.Srikrishna, M.Sc, M.Tech. GVP
6. 2.(a)Signed Magnitude Method
• In this method, number is divided into two
parts: Sign bit and Magnitude.
• If the number is positive then sign bit will be 0
and if number is negative then sign bit will be 1.
• Example: Let we are using 5 bits register. The
representation of -5 to +5 will be as follows:
T.Srikrishna, M.Sc, M.Tech. GVP
7. • The drawback of this system is that 0 has two
different representation
• one is -0 (e.g., 1 0000 in five bit register) and
second is +0 (e.g., 0 0000 in five bit register).
T.Srikrishna, M.Sc, M.Tech. GVP
8. 2.(b) 1’s Complement Method
• Positive numbers are represented in the same
way as they are represented in sign magnitude
method.
• If the number is negative then it is represented
using 1’s complement. First represent the number
with positive sign and then take 1’s complement
of that number.
1's complement
• The 1's complement of a number is found by
changing all 1's to 0's and all 0's to 1's. This is
called as taking complement or 1's complement.
T.Srikrishna, M.Sc, M.Tech. GVP
9. • Example of 1's Complement is as follows.
T.Srikrishna, M.Sc, M.Tech. GVP
10. • Example: Let we are using 5 bits register. The
representation of -5 and +5 will be as follows:
T.Srikrishna, M.Sc, M.Tech. GVP
11. • +5 is represented as it is represented in sign
magnitude method.
• -5 is represented using the following steps:
(i) +5 = 0 0101
(ii) Take 1’s complement of 0 0101 and that is
1 1010. MSB is 1 which indicates that number is
negative.
• MSB is always 1 in case of negative numbers.
T.Srikrishna, M.Sc, M.Tech. GVP
12. • Note that drawback of this system is that 0
has two different representation
• one is -0 (e.g., 1 1111 in five bit register) and
second is +0 (e.g., 0 0000 in five bit register).
T.Srikrishna, M.Sc, M.Tech. GVP
13. 2.(c) 2’s Complement Method
• Positive numbers are represented in the same
way as they are represented in sign magnitude
method.
• If the number is negative then it is
represented using 2’s complement.
• First represent the number with positive sign
and then take 2’s complement of that number.
T.Srikrishna, M.Sc, M.Tech. GVP
14. 2's complement
• The 2's complement of binary number is
obtained by adding 1 to the Least Significant
Bit (LSB) of 1's complement of the number.
• 2's complement = 1's complement + 1
• Example of 2's Complement is as follows.
T.Srikrishna, M.Sc, M.Tech. GVP
15. • Example: Let we are using 5 bits registers. The
representation of -5 and +5 will be as follows:
T.Srikrishna, M.Sc, M.Tech. GVP
16. • +5 is represented as it is represented in sign
magnitude method.
• -5 is represented using the following steps:
(i) +5 = 0 0101
(ii) Take 2’s complement of 0 0101 and that is
1 1011. MSB is 1 which indicates that number is
negative.
• MSB is always 1 in case of negative numbers.
T.Srikrishna, M.Sc, M.Tech. GVP
17. • The advantage of this system is that 0 has only
one representation for -0 and +0.
• Zero (0) is considered as always positive (sign
bit is 0) in 2’s complement representation.
Therefore, it is unique or unambiguous
representation.
T.Srikrishna, M.Sc, M.Tech. GVP