Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

How to represent Negative Numbers

in Binary
• It is not possible to add minus or plus symbol in front of a binary
number because a binary number can have only two symbol either 0
or 1 for each position or bit. That’s why we use extra bit called sign bit
or sign flag. The value of sign bit is 1 for negative binary numbers and
0 for positive numbers. Negative numbers can be distinguishable with
the help of extra bit or flag called sign bit or sign flag in Binary
number representation system for signed numbers.
• Negative number may be represented in one of three possible ways:
• Sign-Magnitude method,
• 1’s Complement method, and
• 2’s complement method.
SIGNED MAGNITUDE METHOD
• 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 signed binary numbers the most significant bit (MSB) is used as
the sign bit. 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. The
remaining bits in the number are used to represent the magnitude of
the binary number in the usual unsigned binary number format way.
Then we can see that the Sign-and-Magnitude (SM) notation stores
positive and negative values by dividing the “n” total bits into two
parts: 1 bit for the sign and n–1 bits for the value which is a pure binary
number. For example, the decimal number 53 can be expressed as an
8-bit signed binary number as follows.
SIGNED MAGNITUDE METHOD
Positive Signed Binary Numbers
SIGNED MAGNITUDE METHOD
Negative Signed Binary Numbers
SIGNED MAGNITUDE METHOD-Disadvantages
1. The disadvantage here is that whereas before we
had a full range n-bit unsigned binary number, we
now have an n-1 bit signed binary number giving
a reduced range of digits from:
-2(n-1) to +2(n-1)
So for example: if we have 4 bits to represent a signed binary number, (1-bit for the Sign
bit and 3-bits for the Magnitude bits), then the actual range of numbers we can
represent in sign-magnitude notation would be:
-2(4-1) – 1 to +2(4-1) – 1
-2(3) – 1 to +2(3) – 1
-7 to +7
SIGNED MAGNITUDE METHOD-Disadvantages
Whereas before, the range of an unsigned 4-bit binary number would have
been from 0 to 15, or 0 to F in hexadecimal, we now have a reduced range
of -7 to +7. Thus an unsigned binary number does not have a single sign-bit,
and therefore can have a larger binary range as the most significant bit
(MSB) is just an extra bit or digit rather than a used sign bit.

2.using this sign-magnitude method can result in the possibility of two


different bit patterns having the same binary value. For example, +0 and -
0 would be 0000 and 1000 respectively as a signed 4-bit binary number. So
we can see that using this method there can be two representations for
zero, a positive zero ( 00002 ) and also a negative zero ( 10002 ) which can
cause big complications for computers and digital systems.
1’s Compliment Method

To find 1’s compliment of a negative number


• All 0’s becomes 1’s
• All 1’s becomes 0’s
4 in 8 bit would be represented as : 00000100
-4 in 8 bit would be represented as : 11111011
2’s Compliment Method
• To find 2’s compliment of a negative
binary no.
• Find 1’s Compliment of No.
• Add 1 to it.
Binary Addition
• Rules
Binary Addition
Example
Example − Addition
Binary Subtraction
Rule-
0–0=0
0 – 1 = 1 ( with a borrow of 1)
1–0=1
1–1=0
Binary Subtraction
Example
Example − Subtraction
Binary Subtraction using 1’s Compliment
For subtracting a smaller number from a larger number, the 1s complement method is as
follows:

1. Determine the 1s complement of the smaller number.

2. Add the 1s complement to the larger number.

3. Remove the final carry and add it to the result. This is called the end-around carry.

Example:

11001-10011

Result from Step1: 01100

Result from Step2: 100101

Result from Step3: 00110

To verify, note that 25 - 19 = 6


Binary Subtraction using 1’s Compliment
For subtracting a larger number from a smaller number, the 1s complement method is as follows:

1. Determine the 1s complement of the larger number.

2. Add the 1s complement to the smaller number.

3. Change the sign and take the 1s complement of the result to get the final answer.

Example:

1001 - 1101

Result from Step1: 0010

Result from Step2: 1011

Result from Step3: - 0100

To verify, note that 9 - 13 = - 4


Binary Subtraction using 2’s Compliment
For subtracting a smaller number from a larger number, the 2s complement method is as follows:

1. Determine the 2s complement of the smaller number.

2. Add the 2s complement to the larger number.

3. Discard the final carry (there is always one in this case)

Example:

11001 - 10011

Result from Step1: 01101

Result from Step2: 100110

Result from Step3: 00110

Again, to verify, note that 25 - 19 = 6


Binary Subtraction using 2’s Compliment
For subtracting a larger number from a smaller number, the 2s complement method is as follows:

1. Determine the 2s complement of the larger number.

2. Add the 2s complement to the smaller number.

3. There is no carry from the left-most column. The result is in 2s complement form and is negative.

4. Change the sign and take the 2s complement of the result to get the final answer.

Example:

1001 - 1101

Result from Step1: 0011

Result from Step2: 1100

Result from Step3: -0100

You might also like