0

I know the answer is 29 but I'm not sure how to arrive at it.

Usually I would take 011101 get its inverse of 100010 and add 1 to get 100011.

The value of this is 35. How then is the answer 29?

5 Answers 5

1
011101 is 29 //Binary to Decimal 100011 + 011101 = 000000 //100011 is inverse+1 100011 = -011101 100011 = -29 

There is no '35' because in a two's compliment system any number starting with a '1' is a negative number. This means, assuming 6 bits, that any number greater than 31 (011111) is in fact a negative number.

Sign up to request clarification or add additional context in comments.

Comments

1

The term "two's complement" is ambiguous.

  • 011101 is the two's complement representation of the decimal number 29.
  • Performing the two's complement operation on 011101 results in 100011 (decimal -29, since two's complement notation uses the most-significant-bit as the sign bit).

Comments

0

The answer is 35, not 29.

invert(0b011101) + 0b1 = 0b100010 + 0b1 = 0b100011 = 35 

The question was for the two's complement of 29:

0b011101 = 29 

Comments

0

The "inverse +1" procedure is for encoding negative numbers.

You know this number is positive because the high bit is zero, so:

1*2^4 + 1*2^3 + 1*2^2 + 0*2^1 + 1*2^0 = 16 + 8 + 4 + 0 + 1 = 29

Comments

0

100011 is correct, and its decimal equivalent is indeed 35. How do you know it should be 29?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.