1 / 12

Binary Addition & Subtraction

Binary Addition & Subtraction. Addition Rules. 0 + 0 = 00 ( 0 with a 0 carry ) 0 + 1 = 01 ( 1 with a 0 carry ) 1 + 0 = 01 ( 1 with a 0 carry ) 1 + 1 = 10 ( 0 with a 1 carry ). 0 + 0. 1 + 0. 0 + 1. 1 + 1. Addition Rules . 0 0. 0 1. 0 1. 1 0. Addition Rules w/Carries.

rainer
Download Presentation

Binary Addition & Subtraction

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Binary Addition & Subtraction

  2. Addition Rules • 0 + 0 = 00 ( 0 with a 0 carry ) • 0 + 1 = 01 ( 1 with a 0 carry ) • 1 + 0 = 01 ( 1 with a 0 carry ) • 1 + 1 = 10 ( 0 with a 1 carry )

  3. 0 + 0 1 + 0 0 + 1 1 + 1 Addition Rules 0 0 0 1 0 1 1 0

  4. Addition Rules w/Carries • 0+0+0 = 00 (0 WITH 0 CARRY) • 0+0+1 = 01 (1 WITH 0 CARRY) • 0+1+1 = 10 (0 WITH 1 CARRY) • 1+1+1 = 11 (1 WITH 1 CARRY)

  5. 1 1 0 0 1 1 0 0 1 0 Adding Binary Numbers 10100 +11110 20 +30 50

  6. Subtraction Rules

  7. 1’S Complement Invert all bits. 100011 0 1 1 1 0 0

  8. 2’S Complement Invert all bits and then add one. 1) 1011101100 2) 0100010011 + 1 3) 0100010100

  9. 2’S Complement Quick Method 1011101100 Example: 1) Start at the LSB and write down all zeros moving to the left. 2) Write down the first “1” you come to. 3) Invert the rest of the bits moving to the left. 0 1 0 0 0 1 0 1 0 0

  10. 1001 +1011 1]0100 Sign bit: One means positive, zero means negative. Subtract Positives w/Positive Answer 2’S complement the bottom number then add. 1001 9 -0101 -5 4

  11. 0101 +0111 Subtract Positives w/Negative Answer 2’S complement the bottom number then add. 0101 5 -1001 -9 -0 1 0 0 0]1100 -4 When the sign bit is negative, 2’s complement your answer to find the magnitude of the number.

  12. 1110 1110 -2 - -3 -1101 +0011 1 Subtracting Negatives 1) Convert the decimal numbers to binary. 2) Find the negative binary numbers. 3) 2’s complement of the bottom number, then add. 0010 0011 1]0001

More Related