1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Is the answer in book wrong? Ones complement conversion

  1. Sep 11, 2014 #1
    1. The problem statement, all variables and given/known data
    Convert the following one's compliment binary into a decimal number
    1000 1000

    3. The attempt at a solution
    The book says the answer is suppose to be 119, but shouldn't it be negative? I thought one at the front of the number represented the sign, when using one's compliment.
    Last edited: Sep 11, 2014
  2. jcsd
  3. Sep 11, 2014 #2


    Staff: Mentor

    It depends on how many bits are defined for the number like 8bits or 16bits...

    In this case, it looks like it is a negative number so the ones complement of it will be positive because all bits are reversed.

    So show your work and we can confirm what you got.

    Last edited: Sep 11, 2014
  4. Sep 11, 2014 #3


    User Avatar
    Homework Helper

    For positive numbers, the ones and twos complement representation of a value are the same. For negative numbers with the same string of bits, the ones complement value will be +1 more than the two's complement value. For 8 bit numbers, 10000000 is -128 in two's complement and -127 (= -128 + 1) in one's complement, 11111111 is -1 in two's complement and 0 (= -1 + 1) in ones complement, and 10001000 is -120 in two's complement and -119 (= -120 + 1) in ones compement.
    Last edited: Sep 11, 2014
  5. Sep 11, 2014 #4
    1000 1000 represented by one's complement
    My workings...
    1 at the far right means it's negative
    inverting numbers...
    0111 0111

    Answer: -119

    The solution says it's 119. Here's exactly what the question asks for:

    What is the decimal representation of 8 bit 1000 1000 (subscript 2) one’s
    compliment numbers.
    Ans: 119
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted