# Thread: Help with understanding two's complement

1. 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?  2.

3. You have probably already been over this but if not maybe it will help.

Two's complement - Wikipedia, the free encyclopedia  4. 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.  5. Here is an explanation of how to do 10s complement arithmetic, if that helps: https://cs.senecac.on.ca/~david.ward...mplements.html  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   BB code is On Smilies are On [IMG] code is On [VIDEO] code is On HTML code is Off Trackbacks are Off Pingbacks are Off Refbacks are On Terms of Use Agreement