0

Original question: Express the bit string 11001110 as a decimal quantity, first interpreted as an unsigned quantity, and second interpreted as a two’s complement quantity.

So, for the bit string 11001110, its complement is 00110001, which is 49 in decimal, right?

But I am not sure what the question is asking. Is the bit string 11001110 is already a complemented version? Or am I asked to find its complement and convert it into decimal?

Second, 11001110 is 206 in decimal; since two's complement uses the most significant bit as a sign bit, then 206 cannot be represented in two's complement right (due to overflow, assuming only 8-bit used)? It will be negative. But 00110001 the most significant bit is 0, which means the quantity is positive? I am confused...

Ross Jacobs
  • 2,962
  • 1
  • 17
  • 27
Joshua Leung
  • 2,219
  • 7
  • 29
  • 52

1 Answers1

0

Two's Complement

To get the twos-complement of a number, invert the bits and add 1. If you want verification of your answer, use an online converter like this one. Keep in mind that the width of your twos complement can make the overflow bit drop.

There are various stack overflow questions that also address two's complement like

Ross Jacobs
  • 2,962
  • 1
  • 17
  • 27