two's complement

Discussion in 'C' started by cindrilla, Dec 19, 2010.

  1. cindrilla

    cindrilla New Member

    Joined:
    Sep 26, 2010
    Messages:
    16
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    student
    Location:
    hyderabad
    hi frinds i want to know how this one's complement & two's complement is done in 16bit system
     
  2. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,009
    Likes Received:
    203
    Trophy Points:
    63
    Occupation:
    Senior Support Engineer
    Location:
    England
    Same way it's done in any size system. One's complement just flips the bits, two's complement flips the bits then adds one. 1's comp of 0001 is 1110; 2's comp is 1111.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice