We know that a computer stores numbers, letters and other characters in codded forms that is related to the binary number system. In this topic we will learn why a computer system uses binary number system instead of decimal number system for arithmetic operations and how these arithmetic operations are done by a computer in binary system.

Why a Computer uses Binary Number System

There are three basic reasons for which a computer uses binary number system for arithmetic operations instead of decimal number system. These are as follows:

  1. The first and foremost reason is that electronic and electrical components operate in a binary mode by their nature. Information is handled in a computer by electrical components. These components are transistors, semiconductors and wires. These electrical components can only indicate two states. These states are either on (1) or off (0). A transistor can be either conducting represented by state 1 or non-conducting represented by state 0. Similarly Magnetic materials are either magnetised (1) or non-magnetised (0). All information is represented within a computer by the presence or absence of these signals. Since the binary number system which has only two digits, 0 and 1, is most suitable. Thus it is used to express the two possible states.
  2. The second reason is that computer circuits only have to handle two binary digits rather than ten decimal digits. The result is that the internal circuit design of the computers is simplified to a great extent. This ultimately results in less expensive and more reliable circuits for computers.
  3. Finally the binary system is used because everything that can be done with a base of 10 can also be done in binary.

Binary Arithmetic:

Here we will learn how the four basic arithmetic operations such as Binary Addition, Subtraction, Multiplication and Division are performed inside a computer using binary number system. Binary arithmetic is much simpler to learn because it uses only two digits 0 and 1.  All binary numbers are made up using 0 and 1 only and when arithmetic operations are performed on these numbers then the results are also obtained in the same form.

Binary Addition:

Binary addition is performed in the same manner as decimal addition. However, since binary number system has only two digits, the binary addition table is very simple consisting of only four entries. The complete table for binary addition is given below.

Binary Addition Table:
Binary Addition Table

In Binary Number Addition carry-overs are performed in the same manner as in Decimal Addition. Since 1 is the largest digit in the Binary Number System, any sum greater than 1 requires that a digit to be carried over. For instance,

The sum of 10 plus 10 binary numbers requires the addition of two 1’s in the second position. Since 1 + 1 = 0 plus a carry of 1 therefore the sum of 10 + 10 is 100 in Binary System.

By the repeated use of the above rules any two binary numbers can be added together by adding two bits at a time.

Question 1: Add the binary numbers 1011 and 1001?

Binary Addition of numbers 1011 and 1001
 
 
 
 
 

Question 2: Add the numbers 100111 and 11011?

Binary Addition of numbers 100111 and 11011
 
 
 
 

Binary Subtraction:

The principles of decimal subtraction can as well be applied to subtraction of numbers in other cases. It consists of two steps, which are repeated for each column of the numbers.

The first step is to determine if it is necessary to borrow. If the subtrahend (the lower digit) is larger than the minuend (the upper digit), it is necessary to borrow from the column to the left. It is also important to note here that the valued borrowed depends upon the base of the number and is always the decimal equivalent of the base. Thus, in Decimal Number Subtraction 10 is borrowed, in Binary Number Subtraction 2 is borrowed; in Octal Number Subtraction 8 is borrowed and in Hexadecimal Number System 16 is borrowed.

The second step is simply to subtract the lower value from the upper value. The complete table for binary subtraction is given below.

Binary Subtraction Table:
Binary Subtraction Table

Question 3: Subtract the binary number 01110 from 10101?

Binary Subtraction of numbers 01110 from 10101

In the first column, 0 is subtracted from 1 and no borrow is required in this case and the result is 1.

In the second column we have to subtract 1 from 0. As we have seen in the above Binary Subtraction table borrowing of 1 is necessary to perform this subtraction. So a 1 is borrowed from the third column which becomes 2 in the second column because the base is 2. Now in the second column, we subtract 1 from 2 which gives result 1. The borrow performed in the second column reduces the 1 in the third column to 0.

Now in the third column, once again we have to subtract 1 from 0 for which borrowing is required. The fourth column contains a 0 and thus has nothing to borrow.  Therefore, we have to borrow from the fifth column. Borrowing 1 from the fifth column gives 2 in the fourth column. Now the fourth column has something to borrow when 1 of the 2 in the fourth column is borrowed, it becomes 2 in the third column.  Now in the third column we subtract 1 from 2 giving a result of 1. Borrowing performed in the third column reduces the 1 in the fifth column to 0 and in the fourth column to 1. Thus subtraction of the fourth column is now 1 from 1 and it gives result 0.

Now in the fifth column 0 is subtracted from 0 which gives result 0. Thus the final result is 00111.

Question 4: Subtract 1011100 from 0111000?

Binary Subtraction of numbers 1011100 and 0111000
 
 
 
 

Complementary Method of Binary Subtraction:

The direct method of subtraction using borrow concept seems to be easy when people perform subtraction with paper and pencil. However when subtraction is implemented by means of digital components this method is found to be less efficient than the complementary method of subtraction. There are two complementary method one is by taking 1’s complement of subtrahend and other is by taking 2’s complement of subtrahend.

Binary Subtraction of Unsigned Binary Number Using 1’s Complement:

Unsigned Binary numbers are the numbers which have no signs. If there are two unsigned binary numbers. Then there will be two different cases of subtraction. And each of them is explained below with examples. We will take help of 1’s complement to subtract these two binary numbers.

Case One: When Minuend is greater than Subtrahend

We must follow the following given steps to do the binary subtraction of unsigned numbers using 1’s compliment.

  1. Find the 1’s complement of number subtrahend.
  2. Add minuend and 1’s complement of subtrahend.
  3. Discard end carry from the sum obtained in second step. The most significant bit of the result of addition is the end carry.
  4. Finally add 1 to least significant bit and that is the result of subtraction.

Question 5: Subtract the unsigned Binary numbers 11100 from 11010 using 1’s complement method.

Step 1: First we are going to find the 1’s complement of 11010. 1’s Complement of a binary number is obtained by changing 0’s to 1’s and 1’s to 0’s. Thus 1’s complement of 11010 is 00101.

Step 2: Now adding 11100 and 0010 gives result 100001.

Step 3: Now we will discard the end carry of 100001. Thus 100001 becomes 00001.

Step 4: Finally adding 1 to 00001 gives result 00010. Hence the required value of subtraction is 00010.

Case Two: When Minuend is less than Subtrahend

Following steps are used to get the result of subtraction when minuend is less than subtrahend using 1’s complement.

  1. Find out the 1’s complement of subtrahend.
  2. Find the sum of minuend and 1’s complement of subtrahend.
  3. In this case there is no end carry. So the result is 1’s complement of the sum obtained in second Step with a negative sign.

Question 6: Subtract unsigned Binary number 10010 from unsigned binary number 11000.

Step 1: First we will find 1’s complement of subtrahend. 1’s complement of 11000 is 00111.

Step 2: Now adding 10010 and 00111 gives result 11001.

Step 3: Now the 1’s complement of 11001 is 00110. We will write the number 00110 followed by a negative sign.

Hence the required value of subtraction is – 00110.

Binary Subtraction of Unsigned Binary Number Using 2’s Complement:

Rules for Binary subtraction of unsigned Binary number using 2’s complement is given below. Here, there will be two cases depending upon the values of minuend and subtrahend.

Case One: When Minuend is greater than Subtrahend

Following steps are used to find the result of subtraction using 2’s complement method.

  1. Find out the 2’s complement of subtrahend.
  2. Add minuend and 2’s complement of subtrahend.
  3. Discard end carry from the sum obtained in Step two. After discarding end carry from sum the rest number will be the required value of subtraction.

Question 7: Subtract 10100 from 01111 using 2’s complement method.

Step 1: 2’s complement of 01111 is 10001.

Step 2: By adding 10100 and 10001, we get 100101.

Step 3: 100101 becomes 00101 after removing end carry. And hence the required value of subtraction is 00101.

Case Two: When minuend is less than subtrahend

Following steps are used to get the result of subtraction when minuend is less than subtrahend by using 2’s complement method.

  1. First we need to find the 2’s complement of subtrahend.
  2. Now we have to add minuend and 2’s complement of subtrahend.
  3. Since there would be no end carry, therefore the result is the 2’s complement of the sum with a negative sign.

Question 8: Subtract the binary number 00101 from 10001.

Step 1: 2’s complement of 10001 is 01111.

Step 2: By adding 00101 and 01111. It gives 10100.

Step 3: So the required answer is 2’s complement of 10100 with a negative sign. Hence the required answer is – 01100.

Binary Subtraction of Signed Binary Number Using 2’s Complement:

A signed number is written either with a positive or negative sign. There will be two cases of subtraction depending upon the numbers.

Case One: When minuend is greater than subtrahend

Following steps are used to subtract a signed Binary number from another signed Binary number.

  1. Represent the given numbers into signed form.
  2. Find the 2’s complement of subtrahend.
  3. Find the sum of minuend and 2’s complement of subtrahend.
  4. Discard end carry from the number obtained in Step three.
  5. After discarding end carry the most significant bit of the rest number is used to present plus sing and rest digits make up the number. Thus the final answer is written with a positive sign.

Question 9: Subtract signed binary number + 101001 from signed binary number + 011010.

Step 1: Signed representation of Binary Number +101001 is 0101001 and signed representation of + 011010 is 0011010. Zero at most significant bit represent + sign.

Step 2: Now finding 2’s complement of 0011010. 2’s complement of a Binary number is obtained by changing 1’s with 0’s and 0’s with 1 and then adding 1 to least significant bit. Thus 2’s complement of 0011010 is 1100110.

Step 3: Now adding 0101001 and 1100110 gives 10001111.

Step 4: Now the End carry from the sum obtained in third step is removed.

Step 5: Therefore the result is 0001111 or + 001111. The most significant bit 0 of 0001111 will be used to represent plus sign.

Case Two: When minuend is less than subtrahend

Following steps are used to get the result of subtraction of two signed binary numbers when minuend is less than subtrahend by using 2’s complement method.

  1. Represent the given numbers in signed binary form.
  2. Find out the 2’s complement of subtrahend.
  3. Add minuend and Binary number obtained step two.
  4. In this case there would be no end carry, the required answer will be the 2’s complement of the sum except sing bit.

Question 10: Subtract +011010 from +101001.

Step 1: Signed representation of + 011010 is 0011010 and + 101001 is 0101001.

Step 2: 2’s complement of 0 101001 is 1010111.

Step 3: sum of 0011010 and 1010111 is 1110001.

Step 4: The required answer is 2’s complement of 110001 (Sign bit is not included). Hence the required answer is 1001111 or – 001111. Most significant bit 1 represents minus sign.

Binary Multiplication:

Multiplication in the binary system also follows the same general rules as decimal multiplication. However, learning the binary multiplication is a trivial task because the table for binary multiplication is very short, with only four entries instead of the 100 necessary for decimal multiplication. The complete table for binary multiplication is given below.

Binary Multiplication Table:Binary Multiplication TableQuestion 11: Multiply the binary numbers 1010 and 1001?
Binary Multiplication of numbers 1010 and 1001
 
 
 
 
 
 
 

We can see that in the above example that the multiplicand is simply copied when multiplier digit is 1 and when the multiplier digit is 0 then the partial product is a string of zeros. As in decimal multiplication, each partial product is shifted one place to the left from the previous partial product. Finally all the partial products are added according to the binary addition rule to get the final result of multiplication.

Additive method of Binary Multiplication:

Most of the computers perform multiplication operation by the way of addition only. This can be easily seen by considering an example, say 5 ✕ 8.The result of this product can be calculated by evaluating 8 + 8 + 8 + 8 + 8. The result is simply obtained by adding the digit 8 five times. Similarly computers perform all multiplication operation in binary using the additive approach.

Binary Division:

Binary division is again very simple. As in the decimal system (or in any other number system), division by 0 is meaningless. Hence, the complete table for binary division is given below.

Binary Division Table:Binary Division TableThe division process is performed in a manner similar to decimal division. The rules for binary division are:
  1. Start from the left of the dividend.
  2. Perform a series of subtraction in which the divisor is subtracted from the dividend.
  3. If subtraction is possible, put a 1 in the quotient and subtract the divisor from the corresponding digits of dividend.
  4. If subtraction is not possible (divisor is greater than remainder), record a 0 in the quotient.
  5. Bring down the next digit to add to the remainder digits. Proceed as before in a manner similar to long division.

Question 12: Divide 100001 by 110?

Binary Division Example
 
 
 
 
 
 
 
 
 

Step 1: Divisor greater than 100, so put 0 in quotient.

Step 2: Add digit from dividend to group used above.

Step 3: Subtraction possible so put 1 in the quotient.

Step 4: Remainder from subtraction plus digit from dividend

Step 5: Divisor greater, so put 0 in quotient.

Step 6: Add digit from dividend to group.

Step 7: Subtraction possible, so put 1 in quotient.

See Also:

  1. Primary Secondary and Catch Memory
  2. Addition, Subtraction, Multiplication and Division of Hexadecimal Numbers
  3. Addition, Subtraction, Multiplication and Division of Octal Numbers