You need to know two's compliment in order to do this. Take a look at my other two's compliment tutorial.
Subtracting a number using two's compliment is easy as pie. Or pizza. Maybe cake.
In standard denary maths, adding a negative number is the same as subtracting a positive version of the same number.
1 + -2 == 1 - 2
The same applies to binary maths.
If we want to subtract one binary number from another, we can add an inverted…