Example of binary subtraction - positive number
Case 1. Positive number is more than negative number ( i e, answer is positive)
Example subtract 4510 ( 1011012 ) form 9210 ( 10111002.
Solution: write both numbers is in 8 bit form
01011100 92_{10}
-00101101 -45_{10}
1 s complement of the negative number = 11010010
Add 1 1
2 s complement of the negative number = 11010011
This will represent -45_{10} in microprocessor
Adding 2 s complement of the negative number with the first (positive ) number
01011100 (92_{10})
+11010011( -45_{10})
Carry 00101111( +47_{10})
Ignoring carry the answer is + 0010 11112 ( +47_{10})