1 / 5

Subtracting Binary

Subtracting Binary. Subtracting Binary. The most common way of subtracting binary numbers is done by first taking the second value (the number to be subtracted) and apply what is known as two's complement , this is done in two steps: Complement each digit in turn (change 1 to 0 and 0 to 1)

mervyn
Download Presentation

Subtracting Binary

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. Subtracting Binary

  2. Subtracting Binary • The most common way of subtracting binary numbers is done by first taking the second value (the number to be subtracted) and apply what is known as two's complement, this is done in two steps: • Complement each digit in turn (change 1 to 0 and 0 to 1) • Add 1 (one) to the result • We are in fact turning the second value (the number to be subtracted) into a negative • Example: 5 -2 = 3 is the same as 5 + (-2) = 3

  3. Example:11012 - 01002 First we complement each digit of the second value (change 1 to 0 and 0 to 1) We start with 0100 and complement each value. 0 0 0 1 1 1 0 1 1 1 + 1 We then add 1 to the result 1 1 0 0 2

  4. Now we add 1101 to our new number 1100. 1 1 1 1 0 1 + 1 1 0 0 X 1 1 0 0 1 9 = 2 10 When we do this addition, we always disregard the last carry.

  5. Final Check 11012 – 01002 = 10012 In decimal format: 1310 – 410 = 910 

More Related