Binary subtraction

Binary subtraction is an important part of number systems. We have to subtract the first number from the second number. 

We see some conditions in Binary subtraction.

Binary subtraction table 

Subtraction conditions
Result
Borrow
0-0
0
0
0-1
1
1
1-0
1
0
1-1
0
0


Binary subtraction 

Example

Binary subtraction

Binary subtraction procedure


From right side 
0–0
Result = 0, Borrow =0
0–1
Result =1 , Borrow =1
0–(0+1) [Borrow was 1 from previous]
Result = 1, Borrow =1
0–(0+1) [Borrow was 1 from previous]
Result = 1, Borrow =1
Only borrow = 1 left from previous bit. So, Result=1 
So, Subtraction result is = 11110

Read about Binary addition.