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

  • Thread starter Aristotle
  • Start date
  • Tags
    Form
In summary, the conversation is about converting a number in one's complement form to its decimal value. The method used is to inverse the bits and add a negative sign if the first sign bit is 1. The result is -0, which is equivalent to all 1's in one's complement form. There is a discussion about how some processors handle this conversion automatically.
  • #1
Aristotle
169
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
  • #2
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.
 

1. What is One's Complement form?

One's Complement is a method of representing negative numbers in binary form. It involves flipping all the bits of a positive number to represent its negative counterpart.

2. How do I convert a decimal number to One's Complement form?

To convert a decimal number to One's Complement form, you will need to first convert the number to binary form. Then, for negative numbers, you will need to flip all the bits (0s become 1s and 1s become 0s). Finally, add a leading 1 to indicate that the number is in One's Complement form.

3. What are the advantages of using One's Complement form?

One's Complement form allows for a simpler method of representing negative numbers in binary form. It also allows for efficient subtraction operations, as addition and subtraction can be performed using the same algorithm.

4. What are the limitations of One's Complement form?

One limitation of One's Complement form is that there are two representations for zero: all 0s and all 1s. This can lead to confusion and errors in calculations. Additionally, it is not suitable for floating-point numbers.

5. How do I convert a number in One's Complement form back to decimal?

To convert a number in One's Complement form back to decimal, you will first need to check if the number is negative by looking at the leading 1. If it is negative, flip all the bits (0s become 1s and 1s become 0s). Then, convert the resulting binary number to decimal form. Finally, add a negative sign to the decimal number.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
627
  • Engineering and Comp Sci Homework Help
Replies
9
Views
958
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
3
Views
950
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Replies
4
Views
936
Back
Top