You are viewing the article How to Subtract Two Binary Numbers at Lassho.edu.vn you can quickly access the necessary information in the table of contents of the article below.
wikiHow is a “wiki” site, which means that many of the articles here are written by multiple authors. To create this article, 49 people, some of whom are anonymous, have edited and improved the article over time.
This article has been viewed 65,344 times.
It’s a little different, but with the steps below, subtracting two binary numbers will be just as simple, or even simpler, than subtracting two ordinary decimals.
Steps
Use the borrowing method
- 1 – 0 = 1
- 11 – 10 = 1
- 1011 – 10 = 1001
- 110 – 101 = ?
- First, cross out 1 and replace it with 0, we get: 1 0
10 – 101 = ? - We’ve just taken away 10 from the first number so we can add this “borrowed” value to position one: 1 0
1100– 101 = ?
- 1 0
1100– 101 = ? - The rightmost column will now be: 10 – 1 = 1. If you don’t understand how we got to this answer, you can convert it to decimal:
- 10 2 = (1 x 2) + (0 x 1) = 2 10 . (The index number indicates what the base of the number is.)
- 1 2 = (1×1) = 1 10 .
- Therefore, the decimal form of this problem will be 2 – 1 = ?, answer: 1.
- 1 0
1100– 101 = __1 = _01 = 001 = 1 .
- 1 0
110000 – 111 = - 1 0
111001000 – 111 = (don’t forget 10 – 1 = 1) - 1 0
111001100100– 111 = - Briefly write: 1011 10
0– 111 = - Solve each column in turn : _ _ _ _ 1 = _ _ _ 0 1 = _ _ 0 0 1 = _ 0 0 0 1 = 1 0 0 0 1
- Add them together to check your answers. When adding the difference for the smaller number, the result must be the large number. With example 2 (11000 – 111 = 10001), we have 10001 + 111 = 11000, which is the original larger number.
- Or, you can convert each binary number to decimal and check if the calculation is correct. With the above example (11000 – 111 = 10001), we can convert each number to decimal and have the equation 24 – 7 = 17. This equation is correct, and therefore, our answer is correct.
Using the complement method
- Example problem: 101 – 11 = ?
- 101 – 011 = ?
- Actually, we’re “taking the complement” or subtracting each digit from one by one. This shortcut “conversion” works for binary numbers because the conversion only gives two possible outcomes: 1 – 0 = 1 and 1 – 1 = 0 .
- 101 + 101 = 1010
- If you don’t understand, you can review how to add two binary numbers.
-
1010 = 10 - So 101 – 011 = 10
- If the answer has no extra digits, you must have subtracted the large number from the smaller number. Refer to the tips section for how to solve such problems and try again.
- 56 – 17
- Since we use the base ten system, we’ll get the “nine’s complement” from the following number (17) by subtracting nine from each of the digits. 99 – 17 = 82 .
- Convert to addition: 56 + 82 . Comparing with the original problem (56 – 17), we can see that we have added 99.
- 56+82= 138 . But since we added 99 to the original math, now we need to subtract 99 from the answer. Here, we shorten again as in the method with binary numbers above: add 1 to the sum and then cross out the digit to the left (representing 100):
- 138 + 1 = 139 →
139 → 39 . This is the final answer to the original problem, 56-17.
Advice
- To subtract small numbers from large numbers, swap their positions, perform the subtraction, and add a minus sign in front of the answer. For example, to solve the binary problem 11 – 100, we find the answer of 100 – 11 and then add a minus sign in front of the answer (this rule applies to all base systems, not just binary).
- Mathematically, the complement method applies the equation a – b = a + (2 n – b) – 2 n Where n is the number of digits of b, 2 n – b is equal to 1’s complement.
wikiHow is a “wiki” site, which means that many of the articles here are written by multiple authors. To create this article, 49 people, some of whom are anonymous, have edited and improved the article over time.
This article has been viewed 65,344 times.
It’s a little different, but with the steps below, subtracting two binary numbers will be just as simple, or even simpler, than subtracting two ordinary decimals.
Thank you for reading this post How to Subtract Two Binary Numbers at Lassho.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: