How can 1's complement, and 2's complement have different ranges?

In summary, the conversation revolved around the topic of whether or not time travel is possible. The first speaker argued that it is not possible due to the scientific laws of the universe. The second speaker countered with the idea of parallel universes and the possibility of travelling between them. The conversation concluded with both speakers agreeing that the concept of time travel is intriguing but ultimately remains a mystery.
  • #1
Callmelucky
144
30
Homework Statement
How can 1's complement, and 2's complement have different ranges?
Relevant Equations
For 1's complement: -(2^(n-1)-1) till 2^(n-1)-1. For 2's complement - 2^(n-1) till 2^(n-1)-1
How can 1's complement, and 2's complement have different ranges?
For 1's complement range is for 8 bit register(where first is for sign +, -) from - 127 to 127 and for 2's complement range is from - 128 to 127.

I came accros the fact that for 1's complement we have +0 and - 0, why is that and why we don't have that for 2's complement?

Thank you.
 
Physics news on Phys.org
  • #2
What does the binary value 1111 1111 represent in 1's complement? And in 2's complement? What about 1000 0000?
 

FAQ: How can 1's complement, and 2's complement have different ranges?

Why does 1's complement have a different range than 2's complement?

1's complement represents negative numbers by inverting all bits, which results in two representations for zero (positive zero and negative zero). This reduces the number of unique values it can represent compared to 2's complement, which only has one representation for zero.

How is the range of 1's complement calculated?

The range of 1's complement for an n-bit number is from -((2^(n-1)) - 1) to (2^(n-1)) - 1. This is because one bit is used for the sign, and the inverting process allows for two representations of zero, reducing the total count of unique values by one.

How is the range of 2's complement calculated?

The range of 2's complement for an n-bit number is from -2^(n-1) to 2^(n-1) - 1. This is because 2's complement has a single representation for zero, allowing it to use the full range of values for negative numbers up to -2^(n-1) and positive numbers up to 2^(n-1) - 1.

What is the impact of having two representations of zero in 1's complement?

Having two representations of zero in 1's complement means that there is one less unique value available for representing other numbers. This results in a slightly smaller range of representable integers compared to 2's complement, which has only one zero representation.

Can you give an example of the different ranges for 1's complement and 2's complement for an 8-bit number?

For an 8-bit number, the range in 1's complement is from -127 to 127, because it has both +0 and -0. In contrast, the range in 2's complement is from -128 to 127, as it has only one representation of zero, allowing it to include one additional negative number.

Similar threads

Replies
17
Views
1K
Replies
5
Views
1K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
2
Views
2K
Replies
8
Views
2K
Replies
5
Views
2K
Back
Top