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

Click For Summary
1's complement and 2's complement systems have different ranges due to their handling of zero and negative numbers. In 1's complement, the range for an 8-bit register is -127 to 127, including both +0 and -0, while 2's complement has a range of -128 to 127, with only one representation for zero. The binary value 1111 1111 represents -0 in 1's complement and -1 in 2's complement. The value 1000 0000 represents -128 in 2's complement and is not a valid representation in 1's complement. Understanding these differences is crucial for binary arithmetic and computer architecture.
Callmelucky
Messages
144
Reaction score
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
What does the binary value 1111 1111 represent in 1's complement? And in 2's complement? What about 1000 0000?
 
Thread 'Why wasn’t gravity included in the potential energy for this problem?'
I’m looking at the attached vibration problem. The solution in the manual includes the spring potential energy but does NOT include the gravitational potential energy of the hanging mass. Can someone explain why gravitational potential energy is not included when deriving the equation of motion? I tried asking ChatGPT but kept going in circles and couldn't figure out. Thanks!

Similar threads

  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
5
Views
2K