Difficulty: Moderately Easy
Step1
Examine the subtraction problem that you must solve. Remember from grade school that a positive number subtracted from another positive number is the same as a negative number added to a positive number, then we can restructure the subtraction problem as an addition problem. This is called subtraction by the two's complement method.
Step2
Convert the number subtracted from the first number to its negative form, taking the one's complement of the number. To do this you must exchange all the ones in the number for zeroes and all zeroes for ones.
Step3
Add one to the ones complement you did in step two, forming the two’s complement. Now you have restructured the subtraction problem to an addition problem.
Step4
Take the original number and add it to the two's compliment of the second number as you would in any other addition problem in binary. Be mindful of the carries in each column of the addition problem.
Step5
Discard any carry bit that extends beyond the number of bit of the original or two's complement. You now have the answer to the problem of the second number subtracted from the first number.