Is the answer in book wrong? Ones complement conversion

  • Thread starter Thread starter orangeincup
  • Start date Start date
  • Tags Tags
    Book
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
3 replies · 2K views
orangeincup
Messages
121
Reaction score
0

Homework Statement


Convert the following one's compliment binary into a decimal number
1000 1000

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:
Physics news on Phys.org
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.

http://en.m.wikipedia.org/wiki/Ones'_complement
 
Last edited:
  • Like
Likes   Reactions: 1 person
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:
  • Like
Likes   Reactions: 1 person
1000 1000 represented by one's complement
My workings...
1 at the far right means it's negative
inverting numbers...
0111 0111
0+64+32+16+0+4+2+1=119

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