Negative One vs Seven: A 2's Complement Comparison

There is one more positive that negative.In summary, in 2's complement, the negative of 1 is represented as "111" in binary. However, this same bit pattern can also signify the decimal number 7. The main difference between the two is in the interpretation and context in which they are used. While the 2's complement system allows for easy addition and subtraction of binary numbers, other systems like signed magnitude and 1s complement can produce errors or inconsistencies due to +0/-0 problems or asymmetry in the number of positive and negative values.
  • #1
amaresh92
163
0
in 2's complement the negative of 1 is "111". but it also signifies 7 in decimal. how does this -ve 1 is differ from 7?
thanks
 
Engineering news on Phys.org
  • #2
Do you not mean 1001 and 0111? (the most sig digit needs to be included or you can't represent numbers that way).
These two numbers represent one above and one below 1000, which is half way up the range from zero to fifteen. It is convenient to use 1000 (8) as a zero point then you can go above or below it - just like using half of your graph paper for positive numbers and half for the negative numbers. So we call 9, +1 and 7, -1 etc.

This system is better than using a number and a sign digit because that system produces plus and minus zero! and your number scale has a hiccup in it. Not very good for doing sums with. The two's complement system allows you to add and subtract binary numbers, positive and negative, whereas number and sign can produce the wrong answer.
You may have noticed that this system is lopsided - there's one more number (0000) at the bottom than at the top but it's a small price to pay if you want to do calculations.
 
  • #3
amaresh92 said:
in 2's complement the negative of 1 is "111". but it also signifies 7 in decimal. how does this -ve 1 is differ from 7?
thanks
Assuming 3 bits, the only difference is in the interpretation.

[tex]
\begin{array}{c|ccccc}
\mbox{Bit Pattern} & \mbox{Unsigned} & \mbox{Signed Magnitude} &
\mbox{1s Complement} & \mbox{2s Complement} & \mbox{Excess-3} \\
000 & 0 & +0 & +0 & \phantom{+}0 & -3 \\
001 & 1 & +1 & +1 & +1 & -2 \\
010 & 2 & +2 & +2 & +2 & -1 \\
011 & 3 & +3 & +3 & +3 & \phantom{+}0 \\
100 & 4 & -0 & -3 & -4 & +1 \\
101 & 5 & -1 & -2 & -3 & +2 \\
110 & 6 & -2 & -1 & -2 & +3 \\
111 & 7 & -3 & -0 & -1 & +4
\end{array}[/tex]

Bottom line: There is no telling just from looking at the bit pattern what a bit pattern represents. You need to know the context.

Note also that signed magnitude and 1s complement suffer from having +0 and -0. That can create some nasty problems. Note that 2s complement does not have a +0/-0 problem but does have an asymmetry; there is one more negative number, -4 in this case, than there are positive numbers in 2s complement. The opposite occurs with excess-N.
 

FAQ: Negative One vs Seven: A 2's Complement Comparison

1. What is a 2's complement?

A 2's complement is a mathematical operation used in computer systems to represent negative numbers. It involves taking the binary representation of a positive number and inverting all the bits, then adding 1 to the result. This allows for the representation of both positive and negative numbers using only binary digits.

2. What is the difference between negative one and seven in 2's complement?

In 2's complement, negative one is represented as all 1's in binary (11111111) and seven is represented as 0111. The main difference between these two numbers is the first bit, which is the sign bit. In negative one, the sign bit is 1, indicating a negative number, while in seven, the sign bit is 0, indicating a positive number.

3. How does 2's complement handle arithmetic operations?

In 2's complement, arithmetic operations are performed by converting the numbers to their binary representation, then using the standard rules of binary arithmetic. The result is then converted back to its 2's complement representation. This makes it easy to perform addition and subtraction of both positive and negative numbers.

4. What are the advantages of using 2's complement?

The main advantage of using 2's complement is that it allows for the representation of negative numbers using only binary digits. This simplifies arithmetic operations and reduces the complexity of computer systems. It also eliminates the need for a separate sign bit, making it more efficient in terms of memory usage.

5. How is the comparison between negative one and seven done in 2's complement?

In 2's complement, comparison between two numbers is done by subtracting one number from the other and then checking the sign bit of the result. If the sign bit is 0, then the first number is greater than the second number. If the sign bit is 1, then the first number is less than the second number. In the case of negative one and seven, since negative one has a sign bit of 1 and seven has a sign bit of 0, negative one is considered to be less than seven.

Similar threads

Replies
1
Views
811
Replies
2
Views
1K
Replies
5
Views
1K
Replies
10
Views
2K
Replies
4
Views
2K
Replies
35
Views
4K
Replies
3
Views
1K
Back
Top