Similar to the adder, we can also design subtractors and we also have half and full subtractors.
Half subtractor (HS): This circuit subtracts two bits and gives Borrow and Difference as 2 outputs. The following table shows the result for different combinations of inputs:
a b B(borrow) D(difference)= D = a – b
0 0 0 0
1 0 0 1
0 1 1 1
1 1 0 0
We scan easily see that diference is 1 only when we have one of the inputs as 1 and other as 0 just like a XOR gate. So equation for difference is D= a’b + ab’
We can also obtain the equations using K-maps


And the digital circuit to implement the above functions is as follow: