Open In App

Binary Subtraction

Last Updated : 28 Mar, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

Binary Subtraction is a mathematical operation and is one of the four fundamental operations of binary numbers. Binary subtraction is similar to decimal subtraction but the rules used as somewhat different.

In this article, we will learn about Binary Numbers, Binary Subtraction, and Rules to Perform Binary Subtraction, Examples on Binary Subtraction, Practice Problems on Binary Subtraction, and others in detail.

What is Binary Subtraction?

Binary subtraction is a fundamental idea in binary operations. There are two components in binary subtraction: 0 and 1.

Also check, Subtraction

Is it Possible to Subtract Binary Numbers?

Yes, binary number subtraction is feasible. It’s pretty similar to subtracting base ten values. When you combine 1 + 1 + 1, you get 3. However, in a binary number system, the sum of 1 + 1 + 1 equals 1 1. We must be careful while subtracting or adding in this case since it might get complicated. Base-2 is used to express a binary number. The basic subtraction table of binary numbers is,

x

y

x – y

0

0

0

0

1

1 (Borrow 1)

1

0

1

1

1

0

Binary Subtraction Definition

Binary numbers are a base-2 numeral system that represents data with only two symbols, commonly 0 and 1. the subtraction of two binary digits i called as Binary Subtraction and binary subtraction follow some fundamental rules that are added below.

Before moving any further we must in brief learn about Binary Numbers.

What are Binary Numbers?

Binary Number are numbers that uses two symbols “0” and “1” to write all the numbers. This system is used by computer programmmers to write various computer’s code.

Binary numbers are expressed in the base-2 numeral system. Each digit in Binary Number System is called a bit.

Learn more about, Binary Numbers

Binary Subtraction Rules

Binary Subtraction is performed in the same manner as decimal subtraction. However, there are some specific rules regarding the subtraction among the binary digits 0 and 1 which we need to follow while performingBinary Subtraction.

Binary Subtraction Rules Table

Binary subtraction is easily achieved using the rules added in the tab;le below,

Table of Binary Subtraction Rule

Binary Number

Subtraction Value

Rule

0 – 0

0

When we subtract 0 from 0, we get 0

1 – 0

1

When we subtract 0 from 1, we get 1

0 – 1

1 (Take 1 from the following high order digit)

When we subtract 1 from 0, we get 1 with a borrow of 1

1 – 1

0

When we subtract 1 from 1, we get 0

Addition of two binary numbers, 1 and 1, results in 10, where 1 is taken to the next high order and 0 is disregarded. However, nothing is carried over as the result of subtracting 1 from 1 is 0. When subtracting 1 from 0 in decimal subtraction, we borrow 1 from the preceding number to make it 10, and the outcome is 9 as 10 – 1 = 9. Nevertheless, binary subtraction yields just one result.

How To Do Binary Subtraction?

To do binary subtraction follow the following methods added below,

Methods of Binary Subtraction

Binary numbers can be represented as decimal or base-10 numbers. Computers use binary numerals to represent data because they can only comprehend the binary digits 0 and 1. With the example below, let’s learn how to subtract binary numbers.

Method 1: Subtraction of Binary Numbers without Borrowing

In binary, the number 8 is represented as (1000)2 and the number 25 is represented as (11001)2. Now subtract (1000)2 from (11001)2.

Step 1: Put the numbers in the order given below.

Binary-Subtraction-Method 1 Step-1

Step 2: To subtract the numbers, use binary subtraction principles. Let us begin this subtraction by subtracting the integers on the right and working our way up to the next higher order digit. To begin, subtract (1-0). This equals 1. Likewise, we proceed to the next higher order digit and subtract (0-0), which is equals to 0. Again, subtract (0-0), which is equals to 0. Then, we subtract (1-1), the outcome is 0. As a result, the difference is 100012.

Binary-Subtraction-Method 2 Step-2

(10001)2 has a decimal equivalent of 17. As a result, the distinction is accurate.

Method 2: Subtraction of Binary Numbers With borrowing

In binary, the number 12 is represented as (1100)2 and the number 26 is represented as (11010)2. Now subtract (1100)2 from (11010)2.

Step 1: Put the numbers in the order given below.

Binary-Subtraction Method 2 Step-1

Step 2: To subtract the numbers, use binary subtraction principles. Let us begin this subtraction by subtracting the integers on the right and working our way up to the next higher order digit. To begin, subtract (0-0). This equals 0. Likewise, we proceed to the next higher order digit and subtract (1-0), which is equals to 1.

We must subtract (0 – 1) next, therefore we borrow a 1 from the next higher order digit. As a consequence of subtracting (0 – 1), the outcome is 1. Then the next subtract (1-1) which is equal to 0 again subtract this 0 with 1 which is borrowed from the previous value (0-1) that is equal to 1. As a result, the difference is (1110)2.

Binary-Subtraction Method 2-Step-2(1110)2 has a decimal equivalent of 14. As a result, the distinction is accurate.

Binary Subtraction Using 1’s Complement

A number’s 1’s complement is derived by reversing every 0 to 1 and every 1 to 0 in a binary integer. For example, the binary number 1102 has a 1’s complement of 0012. Please follow the instructions below to accomplish binary subtraction using 1’s complement. Binary subtraction with 1’s complement entails adding the complement of the subtrahend (the number being subtracted) to the minuend (the amount being removed). Here’s an illustration:

Let’s subtract (100010)2​ from (110110)2​. In this case, the binary equivalent of 34 is (100010)2 whereas the binary equivalent of 54 is (110110)2.

Step 1: First identify the Minuend and Subtrahend. In this Minuend is (110110)2 and subtrahend is (100010)2.

Step 2: Find the 1’s complement of the subtrahend. The subtrahend is (100010)2 and after 1’s complement it is (011101)2.

Step 3: Now add the minuend and the 1’s complement of the subtrahend.

Binary-Subtraction-1's-Complement-Step-1

Step 4: This increment is shown in the left-most digit, 1. We add that to the result, which is (010011)2.

Binary-Subtraction-1's-Complement-Step-2

As a consequence, the answer is (10100)2. In addition, the difference between 54 and 34 is 20. The binary equivalent of 20 is (10100)2.

Binary Subtraction Using 2’s Complement

Binary subtraction with 2’s complement entails adding the complement of the subtrahend (the number being subtracted) to the minuend (the amount being removed). Here’s an illustration:

Let’s subtract (100010)2​ from (110110)2​. In this case, the binary equivalent of 34 is (100010)2 whereas the binary equivalent of 54 is (110110)2.

Step 1: First identify the Minuend and Subtrahend. In this Minuend is (110110)2 and subtrahend is (100010)2.

Step 2: Find the 1’s complement of the subtrahend. The subtrahend is (100010)2 and after 1’s complement it is (011101)2. Now add 1 to the 1’s complement (011101)2 + 1 = (011110)2. So the 2’s Complement is (011110)2.

Step 3: Now add the minuend and the 2’s complement of the subtrahend.

Binary-Subtraction-2's-Complement

In this leave the carryout. As a consequence, the answer is (10100)2. In addition, the difference between 54 and 34 is 20. The binary equivalent of 20 is (10100)2

Read More,

Binary Subtraction Examples

Various examples on binary subtraction includes,

Example 1: Subtract (1011010)2 – (001010)2

Solution:

1011010
-001010
——–
1010000
——–

After subtracting (1011010)2 – (001010)2 = (1010000)2

Example 2: Subtract (1110)â‚‚ – (11)₂ using 1’s complement.

Solution:

Step 1: First find the subtrahend and Minuend. Subtrahend is 11 and Minuend is 1110.

Step 2: Now calculate the 1’s complement of the subtrahend and then add that with minuend.

1110
+1100
——
10010
——

Step 3: Here, carry over occurs, move it to the least significant portion.

1010
+1
—-
1011
—-

Hence the answer is (1011)2.

Example 3: Subtract 101â‚‚ – 110₂ using 2’s complement.

Solution:

Step 1: First find the subtrahend and Minuend. Subtrahend is (101)2 and Minuend is (110)2.

Step 2: Find the 1’s complement of the subtrahend. The subtrahend is (101)2 and after 1’s complement it is (010)2. Now add 1 to the 1’s complement (010)2 + 1 = (011)2. So the 2’s Complement is (011)2.

Step 3: Now add the minuend and the 2’s complement of the subtrahend.

110
+011
—-

1001
—-

In this leave the carry. Hence the answer is (001)2.

Practice Problems of Binary Subtraction

Some practice problems on Binary Subtraction are,

Problem 1: Do Binary Subtraction: (101100)2 – (100010)2.

Problem 2: Subtract (10110)â‚‚ – (1110)₂ using 1’s complement.

Problem 3: Subtract (100100)2 – (10010)3.

Problem 4: Subtract (11001)â‚‚ – (1000)₂ using 2’s complement.

Binary Subtraction Frequently Asked Questions

What is Binary Subtraction?

Binary subtraction is the process of subtraction in binary numbers. It is inverse operation of Binary Addition.

How to do Bianry Subtraction?

Binary subtraction can be done using the standard borrow technique of arithmetic subtraction, or by calculating the 1’s complement of the subtrahend and adding it to the minuend, and then adding any carryovers to the result.

What are Binary Subtraction Rules?

Binary Subtraction rules are,

  • 1 – 0 = 1
  • 1 – 1 = 0
  • 0 – 0 = 0
  • 0 – 1 = 1 (As, this is not possible directly, we borrow a 1 from the next higher order digit)

What is Binary Addition?

Binary addition is a fundamental mathematical operation performed on binary integers, which are made up exclusively of 0s and 1s. Similar to decimal addition, the appropriate bits of two binary integers are added together, with any carry-over transferred to the next higher bit.

What is Difference Between Binary Addition and Binary Subtraction?

In binary addition, when 1 is added to 1, it equals 0, and 1 carries over to the next high order digit, however in binary subtraction, when 1 is subtracted from 0, we borrow 1 from the next order digit and receive the remainder as 1.

What Signs do Binary Digits 0 and 1 represent?

  • 0 represents a positive sign (+)
  • 1 represents a negative sign (-)


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads