Solve the following operation with binary numbers. Check your answer by converting the binary numbers to base 10 numbers, doing the operation on the base 10 numbers, and converting the answer back to base 2.

1012
- 112

1 answer

To subtract binary numbers, we can use the borrowing method, similar to subtracting decimal numbers.

Starting from the rightmost column, we subtract the corresponding digits of the two binary numbers. If the result is 0 or positive, we write the result in the answer. If the result is negative, we borrow 1 from the next higher column. After borrowing, we add 2 to the digit from which we borrowed and subtract the second digit. This process continues until we subtract all the digits.

1012
- 112
-------
101

To convert the binary numbers to base 10 numbers, we can use the place value method. The rightmost digit has a place value of 2^0 = 1, and the place value doubles as we move to the left.

1012 = (1 * 2^2) + (0 * 2^1) + (1 * 2^0) = 4 + 0 + 1 = 5
112 = (1 * 2^2) + (1 * 2^1) + (0 * 2^0) = 4 + 2 + 0 = 6

When we subtract the base 10 numbers, we get 5 - 6 = -1.

To convert the answer back to base 2, we can divide the base 10 number by 2 and keep track of the remainders. The remainder of each division is a digit in the binary number, starting from the least significant digit.

-1 ÷ 2 = -0 remainder 1

Since the division results in a negative number, we need to adjust the sign of the remainder by adding 2^1 = 2 to it.

-0 remainder 1 ==> 2 remainder 1

Therefore, the answer in binary is 12.