Notices
Results 1 to 4 of 4

Thread: Help with understanding two's complement

  1. #1 Help with understanding two's complement 
    New Member
    Join Date
    May 2010
    Posts
    3
    I'm studying data representation and I'm kind of confused on two's complement.

    The first question I should ask is what is a complement? Would a complement in base 10 with the number 9 be 1 and for 7 would it be 3? Since it "complements' with the remainder? Am I understanding this correctly?

    If so then what is the "twos" part?


    Reply With Quote  
     

  2.  
     

  3. #2  
    has lost interest seagypsy's Avatar
    Join Date
    Nov 2012
    Posts
    3,107
    You have probably already been over this but if not maybe it will help.

    Two's complement - Wikipedia, the free encyclopedia


    Speaking badly about people after they are gone and jumping on the bash the band wagon must do very well for a low self-esteem.
    Reply With Quote  
     

  4. #3  
    New Member
    Join Date
    Apr 2013
    Posts
    1
    A complement is the opposite of a binary representation. EX: 0's complement is 1 and vise versa. In computer science world, integer values are stored using base 2 binary and we represent all signed integer value using two's complement so we get an idea of the range of numbers that can be represented. If the left most significant bit is 1 then the decimal value is negative if it's 0 then the value is positive. To find two's complement binary representation for a base10 number: First you have to write the absolute value in binary, then complement each binary, then plus 1. And if you want to convert it from two's complement binary representation to base 10 number: First you complement the binary number, then add 1. Put the + or - sign depending on the left most bit of the two's complement binary representation.
    Last edited by meng78; April 18th, 2013 at 06:58 AM.
    Reply With Quote  
     

  5. #4  
    Brassica oleracea Strange's Avatar
    Join Date
    Oct 2011
    Location
    喫茶店
    Posts
    16,493
    Here is an explanation of how to do 10s complement arithmetic, if that helps: https://cs.senecac.on.ca/~david.ward...mplements.html
    Without wishing to overstate my case, everything in the observable universe definitely has its origins in Northamptonshire -- Alan Moore
    Reply With Quote  
     

Similar Threads

  1. Problems understanding C.D.O.M.B
    By Dkav in forum Biology
    Replies: 1
    Last Post: March 12th, 2011, 05:07 PM
  2. Understanding the PC?
    By Sev7 in forum Computer Science
    Replies: 4
    Last Post: July 24th, 2010, 03:18 PM
  3. Is CT the Foreplay of Understanding?
    By coberst in forum Philosophy
    Replies: 0
    Last Post: January 13th, 2009, 04:24 AM
  4. understanding dimensions..
    By newspaper in forum Physics
    Replies: 4
    Last Post: December 16th, 2008, 01:22 PM
  5. Understanding: a way of seeing
    By coberst in forum Philosophy
    Replies: 2
    Last Post: July 31st, 2007, 12:53 PM
Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •