How to find decimal of a number in One's Complement form?

  • Thread starter Thread starter Aristotle
  • Start date Start date
  • Tags Tags
    Form
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
1 reply · 2K views
Aristotle
Messages
169
Reaction score
1

Homework Statement


Assume the number
https://www.physicsforums.com/tel:1111111
Is in one's complement form, what is its decimal values?

Homework Equations



2^7 + 2^6 + 2^5 + 2^4 + 2^3 + 2^2 + 2^1 + 2^0

1 in first sign bit indicates negative
0 in first sign bit indicates positive

The Attempt at a Solution



The first thing I did to solve this problem is that we know that 1111111 is already in 1's complement form and so I inverse the bits and got 0000000. Noticing that there is a 1 in the first sign bit of the binary 1111111 that is in 1s complement form, I included a 'negative' to the decimal 0. From the inverse number 0000000... Is simply added to equal 0...and got -0.

is this the correct method in approaching this? any guidance would be appreciated! Thank you[/B]
 
Last edited by a moderator:
Physics news on Phys.org
In one's complement, all 1's is negative zero. Some processors will automatically convert all 1's to all 0's in their results.