Digital design

Discussion in 'Homework Help' started by rds1975, Sep 21, 2004.

  1. rds1975

    Thread Starter New Member

    Aug 30, 2004

    Can somebody help me in solving this problem ?

    Express the negative value –27 as a 2’s complement integer using 8 bits. Repeat,
    using 16 bits and 32 bits respectively. What does this illustrate with respect to the
    properties of sign extension as they pertain to 2’s complement representation.

    Thanks and regards
  2. Kingcosmos

    New Member

    Sep 23, 2004
    It has been a while so let me see. In order to show -27 in 2's complement you need to write out +27 in binary (using 8 bits):


    Then change all 0's to 1's and all 1's to zeroes:


    Then add 1:

    11100100 + 1 = 11100101

    Therefore 11100101 is -27 in 2's complement.

    Repeat using 16 bits and 32 bits. As to the answer of your question I am not sure. I would answer it by saying that all negative numbers in binary have a 1 as a sign bit. :blink:
  3. Liquid_Klone

    New Member

    Sep 29, 2004
    did you know that most scientific calculators show negative numbers in the 2s compliment? So if you are as lucky as I was, you can just type in -27, then hit your decimal to binary button, and the problem is solved. (I use texas instruments)