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!

2's complement

  1. Oct 14, 2007 #1


    User Avatar

    1. The problem statement, all variables and given/known data
    Covert the following numbers to 12-bit binary numbers using two's complement representation.

    2. Relevant equations
    None I know of.

    3. The attempt at a solution
    I think I'm making this more complicated than it really is. For 234 I can just convert right to binary or do I have to convert 234 to binary, complement, add 1, complement, and then add 1?

    For -234:
    1(adding 1 to LSB)

    On a side note converting a negative number to octal or hex say -234. You convert it like any other binary number? When converting back how do you know you have a negative number or positive number? By the MSB?
  2. jcsd
  3. Oct 14, 2007 #2
    You did the conversion correctly. The way you can check is to add 234 with -234. The result should be 0 (within the 12 bits).

    For positive numbers, you need do nothing. 234 is the same in two's complement, the same in one's complement, the same in unsigned. The conversion method is used to convert positive to negative and negative back to positive.

    If the MSB is 1, then yes, that number is negative in two's or one's complement.
  4. Oct 14, 2007 #3


    User Avatar

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Similar Discussions: 2's complement
  1. 9's complement (Replies: 2)

  2. 2's Complement (Replies: 4)

  3. 2's complement (Replies: 13)