Binary Addition Addition Rules: = = = = = carry 1 1 carry 1 Example 1: Example 2:
Binary Multiplication Multiplication Rules: 0 x 0 = 0 x 1 = 1 x 0 = 1 x 1 = Example: X
Binary Subtraction A computer cannot subtract a number from another. It can only add two numbers Example: Subtract B from AA - B Add –B to AA + (-B) Complementation
Subtraction Rules Pad with 0’s until both numbers are the same length Take 2’s complement of the digit to be subtracted Add the result to the first binary number Ignore the carry result to preserve the initial size
Step 1: One’s Complement Example: Example: Find the one’s complement of Number Number Invert bits Invert bits Step 2: Two’s Complement Number Number One’s complement One’s complement Add 1 Add 1+ 1 Two’s complement Two’s complement Adding 1 to the one’s complement of a binary digit Example: Example: Find the two’s complement of
Practice Examples Example 1: Example 1:Find the result of Step 1: Two’s complement for 010 Number010 Invert bits101 Add 1+ 1 Code for -010 = 110 Step 2: Add answer with first number Number101 Code for -010 =