Multiplication and Division Of Binary Numbers

Various operations can be performed on binary numbers.

For example, we can add, subtract, multiply and divide binary.

We have discussed the addition and subtraction of Binary numbers in the previous post.

Therefore, we will be looking at the multiplication and division of binary numbers in this post.

But, before we continue, note that the base 2 digits are called bits.

Multiplication Of Binary Numbers

To multiply two binary numbers, follow the following steps:

  1. Write down the numbers in such a way that the rightmost bit of the two numbers is lined up vertically just like the way you do in decimal.
  2. Starting with the rightmost bit of the second number, take the first number and multiply it by each bit of the second number one at a time.
  3. After each multiplication, shift the result one place to the left.
  4. Write the results below the previous, starting with the rightmost multiplication.
  5. Add all the results together to get the final product.
  6. You should also note this
    • In binary, the product of 0 and 0 is 0.
    • In binary, the product of 1 and 0 is 0.
    • In binary, the product of 1 and 1 is 1.
    • The product of 1 and 0 is 1 in binary
  7. Since you would add after multiplying, you should note this about base 2 addition:
    • 1+0=1
    • 1+1=10
    • 0+1=1
    • 0+0=0
    • 1+1+1=11
    • 1+0+1=11
    • 1+1+0=10

You should note that multiplication in Binary is similar to the way you normally multiply decimal numbers.

Example 1

Multiply 11 and 11 in base 2

Solution:

\begin{align}11& \\\underline{\times \quad 11} \\ 11 & \\\underline{\phantom{0}\phantom{0}11\phantom{0}}\\\underline{1001}&\end{align}

Explanation:

  1. We first align the numbers.
  2. Multiply the first number by each bit of the second number, starting with the rightmost bit, and shift the result to the left after each multiplication.
  3. Now, for the addition part,
    • 1+0 gives 1.
    • 1+1 gives us 10. we wrote 0 and carry 1.
    • 1+0 gives us 1. However, we then added the 1 carried over so that 1+1=10.
  4. Therefore, we get 1001 when we multiply 11 and 11 in base 2.

Example 2

Multiply \(101_2\) and \(110_2\)

Solution:

\begin{align}101& \\\underline{\times \quad 110} \\ 000 & \\ 101\phantom{0}\\\underline{101\phantom{00}}\\\underline{11110}&\end{align}

Explanation:

  1. We first need to align the numbers
  2. Multiply the first number by each bit of the second number, starting with the rightmost bit, and shift the result to the left after each multiplication.
  3. Now, adding the result,
    • 0+0+0 gives 0.
    • 0+1+0 gives 1.
    • 0+0+1 gives 1.
    • 0+1+0 gives 1.
    • 0+0+1 gives 1.
  4. Therefore, 11110 is the product of 101 and 110 in base 2.

Example 3

Multiply \(1101_2\) and \(1111_2\)

Solution:

\begin{align}1101& \\\underline{\times \quad 1111} \\ 1101 & \\ 1101\phantom{0}\\ 1101\phantom{00}\\\underline{\phantom{0}1101\phantom{000}}\\\underline{11000011}&\end{align}

Explanation:

  1. The digits are aligned in such a way that the rightmost bit of the two numbers is lined up vertically.
  2. Multiply the first number by each bit of the second number, starting with the rightmost bit, and shift the result to the left after each multiplication.
  3. To add the resulting digits,
    • 1+0+0+0=1
    • 0+1+0+0=1
    • 1+0+1+0=10. But we write 0 and carry 1 over
    • 1+1+0+1=11. Now, let’s now add the 1 carried over from the previous step. So, 11+1=100, which means we write 0 and carry 10 over
    • 0+1+1+0=10. Now, add the 10 carried over from the previous step, 10+10=100. Once again, we write 0 and carry 10 over.
    • 0+0+1+1=10. Remember, we carry 10 from the previous step. So, 10+10=100. Once again, we write 0 and carry 10 over.
    • 0+0+0+1=1. Now, we add 1 and the 10 carried over, which gives 11. Now, we do not need to carry anything over because it is the last digit.
  4. As a result, \(1101_2 \times 1111_2=11000011\)

Division of Binary Numbers

The easiest way to divide binary numbers is to convert the dividend (the number being divided) and the divisor (the number doing the dividing) to decimal numbers, divide the numbers and then convert them back to binary numbers.

The steps to divide binary numbers are as follows:

  1. Identify the dividend and divisor. The dividend is the number that is to be divided by another number while the divisor is the number that another number is to be divided by.
  2. Convert the dividend and divisor to decimal numbers.
  3. Divide as you normally divide decimal numbers.
  4. Convert the result back to binary numbers.

Example 4

Divide 111111 by 111 in base 2.

Solution:

First, we convert 111111 and 111 to base 10.

\(111111_2=63_{10}\)

\(111_2=7_{10}\)

Let’s divide the numbers

63/7=9

Now, we convert 9 back to binary using the base 10 to base 2 conversion method discuss here.

\(9_{10}=1001_2\)

Therefore, We get 101 when we divide 111111 by 111.

Example 5

Divide 111110100 by 100 in base 2

Solution:

The decimal equivalent of the binary number 111110100 is 500.

The decimal equivalent of the binary number 100 is 4.

The next step is to divide 500 by 4.

500/4=125

We then convert to base 2.

\(125_{10}=1111101_2\)

Hence, the result of dividing 111110100 by 100 in base 2 is 1111101.