Binary subtraction practice
The Web This site. Arithmetic rules for binary numbers are quite straightforward, and similar to those used in decimal arithmetic.
The rules for addition of binary numbers are:. Notice that in Fig. Binary addition is carried out just like decimal, by adding up the columns, starting at the right and working column by column towards the left. For example, in Fig. The rules for subtraction of binary numbers are again similar to decimal. The subtraction rules for binary are quite simple even if the borrow and pay back system create some difficulty.
The rules for binary subtraction are quite straightforward except that when 1 is subtracted from 0, a borrow must be created from the next most significant column.
This borrow is then worth 2 10 or 10 2 because a 1 bit in the next column to the left is always worth twice the value of the column on its right. Notice that in the third column from the right 2 2 a borrow from the 2 3 column is made and then paid back in the MSB 2 3 column.
Borrowing 1 from the next highest value column to the left converts the 0 in the 2 2 column into 1 0 2 and paying back 1 from the 2 2 column to the 2 3 adds 1 to that column converting the 0 to 0 1 2.
Once these basic ideas are understood, binary subtraction is not difficult, but does require some care. As the main concern in this module is with electronic methods of performing arithmetic however, it will not be necessary to carry out manual subtraction of binary numbers using this method very often.
This is because electronic methods of subtraction do not use borrow and pay back, as it leads to over complex circuits and slower operation. Computers therefore, use methods that do not involve borrow. That is, it is 1 if the number is odd, and 0 if it is even. Although we only proved our observations with 4-digit binary numbers, the same argument works no matter how many digits we have. The number 85 is odd. Hence, the last digit is 1.
Subtract 1, we get Then dividing 84 by 2 we get Binary representation of 42 will get us all other digits in front of the last. The number 42 is even, hence its last binary digit is 0. Dividing 42 by 2 we get Subtract 1 and divide by two again: Dividing 2 by 2, we get 1. Now the binary digit 1 represents the number 1.