Dr.M.Pyingkodi
AP/MCA
Kongu Engineering College
Erode, Tamilnadu
Signed Binary Numbers
•Both positive and negativenumbersmay be represented.
•The most significant bit represents the sign
•Three main signed binary number codes are used.
–Sign magnitude
–2s complement
–1s complement
•Sign-magnitude notation is the simplest and one of the
most common methods of representing positive and
negative numbers either side of zero, (0).
•for example, +2 and -2, +10 and -10, etc.
•If the sign bit is “0”, this means the number is positive in
value. If the sign bit is “1”, then the number is negative in
value.
Signed Binary Numbers
Signed Binary Numbers
Positive Signed Binary Numbers
Negative Signed Binary Numbers
Signed Binary Numbers
1) -56
10as a 8-bit number
10111000
2
2) 85
10as a 8-bit number
01010101
2
3) -127
10
11111111
2
Signed Binary Numbers
•Unsigned numbers don’t have any sign
•Contain only magnitude of the number.
Representation of unsigned binary numbers are all
positive numbers only.
•For example, representation of positive decimal
numbers are positive by default.
•We always assume that there is a positive sign symbol
in front of every number.
Unsigned Numbers
•Signed numbers contain sign flag, this representation
distinguish positive and negative numbers
•For example, in representation of negative decimal numbers,
we need to put negative symbol in front of given decimal
number.
Representation of Signed Binary Numbers:
–Sign-Magnitude form
–1’s complement form
–2’s complement form
Signed Binary Numbers
•For n bit binary number,
•1 bit is reserved for sign symbol.
•If the value of sign bit is 0, then the given number will be
positive,
•else if the value of sign bit is 1, then the given number will be
negative.
•Remaining (n-1) bits represent magnitude of the number.
•The positive number is simply represented as a magnitude
form.
Sign-Magnitude form
•1’s complement of a number is obtained by
inverting each bit of given number.
•method which we can use to represent
negative binary numbers in a signed binary
number system.
•the one’s complement of “1” is “0” and vice
versa, then the one’s complement
of10010100
2is simply01101011
2as all the 1’s
are changed to 0’s and the 0’s to 1’s.
1’s complement form
Ones-complement
•Negative number: Bitwise complement positive
number
–0011 ≡3
10
–1100 ≡–3
10
•Solves th arithmetic problem
•Binary subtraction is very much difficult as
compare to addition.
•To do subtraction
•first the binary number subtracted from
another number is represented in 1s
complemented form and then add with the
another number.
Why 1’s complement
•To get 2’s complement of a binary number, simply invert the
given number and add 1 to the least significant bit (LSB) of
given result.
•performing arithmetic operations such as subtraction, addition
2’s complement