Results 1 to 3 of 3

Thread: two's complement

  1. #1
    Nov 2009

    two's complement

    Perform the following arithmetic operation using 8-bit
    two's complement

    a) 8710 - 2910

    i just want to know.. am i converting the number correctly?

    89 = 0101 1001
    -29 = 1110 0011


    i should change from decimal to binary...
    then, apply two's complement to the number?

    i know how to perform the arithmetic.. just bit confused with the representation of the number..
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor chiph588@'s Avatar
    Sep 2008
    Champaign, Illinois
    $\displaystyle 29_{10} = 00011101_2 $. To get $\displaystyle -29 $ invert the digits and add one.

    $\displaystyle (-29)_{10} = (11100010+1)_2 = 11100011_2 $, so yes you are correct.
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Dec 2009
    The idea behind 2's complement arithmetic is to represent 29 as a negative binary number
    and add instead of subtract.

    $\displaystyle 89-29=80+(-29)$

    In binary, $\displaystyle 29=2^4+2^3+2^2+2^0=00011101_2$

    To write $\displaystyle -29$ in 2's complement form, invert the bits and add 1.

    8-bit negative numbers have a 1 in the most-significant bit position.
    Positive numbers have a 0 there.

    $\displaystyle 01011001_2+11100011_2=00111100_2$

    with a carry into the 9th bit position, which means the result is positive.

    The result should be 60.

    $\displaystyle 00111100_2=2^2+2^3+2^4+2^5=4+8+16+32=60$
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. 10's complement
    Posted in the Advanced Math Topics Forum
    Replies: 2
    Last Post: Mar 25th 2010, 06:01 PM
  2. complement question..
    Posted in the Advanced Statistics Forum
    Replies: 11
    Last Post: Nov 23rd 2009, 08:00 AM
  3. Supplement & Complement
    Posted in the Geometry Forum
    Replies: 3
    Last Post: Oct 15th 2009, 10:51 AM
  4. complement help
    Posted in the Discrete Math Forum
    Replies: 3
    Last Post: Sep 24th 2009, 10:49 AM
  5. 2s Complement
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: Jun 6th 2008, 08:00 AM

Search tags for this page

Click on a term to search for related topics.

Search Tags

/mathhelpforum @mathhelpforum