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?
 

1. How does 1's complement and 2's complement represent negative numbers?

1's complement and 2's complement are two different methods of representing negative numbers in binary form. In 1's complement, the negative number is represented by inverting all the bits of its positive counterpart. For example, -5 in 1's complement would be represented as 11111010. On the other hand, in 2's complement, the negative number is represented by adding 1 to the 1's complement of its positive counterpart. So, -5 in 2's complement would be represented as 11111011.

2. Why do 1's complement and 2's complement have different ranges?

The main reason for the different ranges in 1's complement and 2's complement is due to the way they represent negative numbers. In 1's complement, there are two representations for 0 (positive 0 and negative 0), which reduces the overall range of numbers that can be represented. However, in 2's complement, there is only one representation for 0, which allows for a larger range of numbers to be represented.

3. How do the ranges of 1's complement and 2's complement differ?

The range of numbers that can be represented in 1's complement is from -(2^(n-1) - 1) to (2^(n-1) - 1), where n is the number of bits used. For example, in an 8-bit system, the range would be from -127 to 127. On the other hand, the range of numbers that can be represented in 2's complement is from -(2^(n-1)) to (2^(n-1) - 1). In an 8-bit system, the range would be from -128 to 127.

4. Which representation is more commonly used in modern computing?

In modern computing, 2's complement is the more commonly used representation for negative numbers. This is because it simplifies the arithmetic operations and allows for a larger range of numbers to be represented. It also eliminates the need for a separate representation for 0, making it more efficient.

5. Are there any advantages of using 1's complement over 2's complement?

One advantage of using 1's complement is that it is easier to convert a number from positive to negative and vice versa. This is because it only requires inverting the bits. However, this advantage is outweighed by the disadvantages of a smaller range and the need for a separate representation of 0. Hence, 2's complement is the preferred representation in modern computing.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
Back
Top