Results 1 to 3 of 3

Math Help - two's complement

  1. #1
    Member
    Joined
    Nov 2009
    Posts
    151

    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

    or...

    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
    Joined
    Sep 2008
    From
    Champaign, Illinois
    Posts
    1,163
     29_{10} = 00011101_2 . To get  -29 invert the digits and add one.

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

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

    89-29=80+(-29)

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

    To write -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.

    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.

    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: March 25th 2010, 06:01 PM
  2. complement question..
    Posted in the Advanced Statistics Forum
    Replies: 11
    Last Post: November 23rd 2009, 08:00 AM
  3. Supplement & Complement
    Posted in the Geometry Forum
    Replies: 3
    Last Post: October 15th 2009, 10:51 AM
  4. complement help
    Posted in the Discrete Math Forum
    Replies: 3
    Last Post: September 24th 2009, 10:49 AM
  5. 2s Complement
    Posted in the Discrete Math Forum
    Replies: 4
    Last Post: June 6th 2008, 08:00 AM

Search Tags


/mathhelpforum @mathhelpforum