We think you are located in Nigeria. Is this correct?

# Test yourself now

High marks in maths are the key to your success and future plans. Test yourself and learn more on Siyavula Practice.

# Chapter 3: Binary numbers

In Chapter 1 you revised binary numbers. You also learnt how to convert numbers between different number systems.

Here are the binary numbers that correspond to the decimal numbers 1 to 10 again:

\begin{array}{|c|c|} \hline \text{decimal number} & \text{binary number} \\ \hline 1& 1 \\ 2& 10 \\ 3& 11 \\ 4& 100 \\ 5& 101 \\ 6& 110 \\ 7& 111 \\ 8& 1000 \\ 9& 1001 \\ 10& 1010 \\ \hline \end{array}

In this chapter you will learn how to add, subtract, multiply and divide binary numbers. Some of this work was done in previous years.

Remember that we work in groups of 2 in the base two number system.

### Worked example 3.1: Adding in the base two number system (Method 1)

Find the sum of $101_\text{two}$ and $111_\text{two}$.

1. Step 1: Write the numbers one below the other, without the subscript "two". Line up the digits under the powers of two.

Remember that the powers of two, written from right to left in a place value table are: $2^0$, $2^1$, $2^2$, $2^3$, $2^4$, and so on.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline \end{array}
2. Step 2: Add the digits in the $2^0$ column. Decide how many groups of 2 you have and carry these over. Write down the remainder.

• This is 1 group of 2 and a remainder of 0.
• Carry over the 1 and write down the remainder in the $2^0$ column.
\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 0\;\, \\ \hline \end{array}
3. Step 3: Repeat Step 2 for the digits in the $2^1$ column.

• This is 1 group of 2 and a remainder of 0.
• Carry over the 1 and write down the remainder in the $2^1$ column.
\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 0\;\;0\;\, \\ \hline \end{array}
4. Step 4: Repeat Step 3 for the digits in the $2^2$ column.

• This is 1 group of 2 and a remainder of 1.
• Carry over the 1 and write down the remainder in the $2^2$ column.
\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 1\;\;0\;\;0\;\, \\ \hline \end{array}
5. Step 5: Bring down the group that was carried over to the $2^3$ column.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline &1\;\; 1\;\;0\;\;0\;\, \\ \hline \end{array}

The answer is $1100_\text{two}$.

6. Step 6: Check your answer by converting to the base ten number system, adding, and then converting back to a base two number.

\begin{align} 101_2&=2^2+0+2^0 \\ &=4+1 \\ &=5_{10}\\ \end{align} \begin{align} 111_2&=2^2+2^1+2^0 \\ &=4+2+1 \\ &=7_{10}\\ \end{align} \begin{align} 12_{10}&=8+4 \\ &=2^3+2^2+0+0 \\ &=1100_2\\ \end{align}

Another way to do addition in the base two number system is to use these basic rules:

$0+0=0$
$0+1=1$
$1+0=1$
$1+1=10$
$1+1+1=11$

Remember:
$2_\text{ten}=10_\text{two}$
$3_\text{ten}=11_\text{two}$

### Worked example 3.2: Adding in the base two number system (Method 2)

Find the sum of $101_\text{two}$ and $111_\text{two}$.

1. Step 1: Write the numbers one below the other, without the subscript "two". Line up the digits under the powers of two.

Remember that the powers of two, written from right to left in a place value table are: $2^0$, $2^1$, $2^2$, $2^3$, $2^4$, and so on.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline \end{array}
2. Step 2: Add the digits in the $2^0$ column. If the answer is 10 or 11, carry over the left-hand 1 and write down the right-hand 0 or 1.

Remember, in the base two number system: $1+1=10$ and $1+1+1=11$.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 0\;\, \\ \hline \end{array}
3. Step 3: Repeat Step 2 for the $2^1$ column.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 0\;\;0\;\, \\ \hline \end{array}
4. Step 4: Repeat Step 3 for the $2^2$ column.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline & 1\;\;0\;\;0\;\, \\ \hline \end{array}
5. Step 5: Bring down the 1 that was carried over to the $2^3$ column.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline &1\;\; 1\;\;0\;\;0\;\, \\ \hline \end{array}

The answer is $1100_\text{two}$.

6. Step 6: Check your answer using the base ten number system.

\begin{align} 101_2&=2^2+0+2^0 \\ &=4+1 \\ &=5_{10}\\ \end{align} \begin{align} 111_2&=2^2+2^1+2^0 \\ &=4+2+1 \\ &=7_{10}\\ \end{align} \begin{align} 12_{10}&=8+4 \\ &=2^3+2^2+0+0 \\ &=1100_2\\ \end{align}

### Exercise 3.1: Add binary numbers

Calculate each of the following in the base two number system.

1. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & \phantom{000}\newline & 1\;\;0\;\;0\;\, \\ +& 1\;\;0\;\, \\ \hline &\;\;\; 1\;\;1\;\;0\;\, \\ \hline \end{array}
2. Remember to use $1+1=10$ where you need to.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1} \phantom{000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\, \\ \hline &1\;\; 0\;\;0\;\;0\;\, \\ \hline \end{array}
3. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1} \phantom{00000}\newline & 1\;\;1\;\;0\;\, \\ +& 1\;\;1\;\, \\ \hline &1\;\; 0\;\;0\;\;1\;\, \\ \hline \end{array}
4. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1} \phantom{00000}\newline & 1\;\;1\;\;1\;\, \\ +& 1\;\;0\;\, \\ \hline &1\;\; 0\;\;0\;\;1\;\, \\ \hline \end{array}
5. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;\phantom{000000}\newline & 1\;\;0\;\;0\;\, \\ +& 1\;\;0\;\;1\;\, \\ \hline &1\;\; 0\;\;0\;\;1\;\, \\ \hline \end{array}
6. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;\phantom{000000}\newline & 1\;\;0\;\;1\;\, \\ +& 1\;\;1\;\;0\;\, \\ \hline &1\;\; 0\;\;1\;\;1\;\, \\ \hline \end{array}
7. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\phantom{00000}\newline & 1\;\;1\;\;0\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline &1\;\; 1\;\;0\;\;1\;\, \\ \hline \end{array}
8. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1}\phantom{000}\newline & 1\;\;1\;\;1\;\, \\ +& 1\;\;1\;\;1\;\, \\ \hline &1\;\; 1\;\;1\;\;0\;\, \\ \hline \end{array}
9. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\phantom{00000}\newline & 1\;\;0\;\;1\;\;0\;\, \\ +& 1\;\;1\;\, \\ \hline &1\;\; 1\;\;0\;\;1\;\, \\ \hline \end{array}
10. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{1}\;\;_{1}\;\;_{1}\;\;_{1}\phantom{000}\newline & 1\;\;1\;\;1\;\;1\;\, \\ +& 1\;\;1\;\, \\ \hline &1\;\;0\;\; 0\;\;1\;\;0\;\, \\ \hline \end{array}

## 3.2 Subtraction

### Worked example 3.3: Subtracting in the base two number system (Method 1)

Subtract $101_\text{two}$ from $1010_\text{two}$.

1. Step 1: Write the numbers one below the other, without the subscript "two". Line up the digits under the powers of two.

Remember that the powers of two, written from right to left in a place value table are: $2^0$, $2^1$, $2^2$, $2^3$, $2^4$, and so on.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\;1\;\;0\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline \end{array}
2. Step 2: Subtract the digits in the $2^0$ column. If it is not possible to subtract the bottom number from the top one, move a group of two from the column to the left.

We cannot do $0-1$, so move one group of two from the $2^1$ column to the $2^0$ column:

• The $2^1$ column becomes $1-1=0$.
• The $2^0$ column becomes $0+2=2$.

In the base ten number system, we use the same principle. There we just move a group of 10 rather than a group of 2.

Now you have 2 in the $2^0$ column, and it is possible to subtract 1 from 2.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{0}\;\;_{2} \;\,\newline & 1\;\,0\;\cancel{1}\;0\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline &1\;\, \\ \hline \end{array}$
3. Step 3: Repeat Step 2 for the $2^1$ column.

In this column, $0-0=0$.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{0}\;\;_{2} \;\,\newline & 1\;\,0\;\cancel{1}\;0\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline &0\;\;1\;\, \\ \hline \end{array}$
4. Step 4: Repeat Step 2 for the $2^2$ column.

We cannot do $0-1$, so move one group of two from the $2^3$ column to the $2^2$ column:

• The $2^3$ column becomes $1-1=0$.
• The $2^2$ column becomes $0+2=2$.
$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ &_{0}\;\;_{2}\;\;\,_{0}\;\;_{2} \;\,\newline & \cancel{1}\;0\;\cancel{1}\;0\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline &1\;\;0\;\;1\;\, \\ \hline \end{array}$
5. Step 5: Check your answer using the base ten number system.

\begin{align} 1010_2&=2^3+0+2^1+0 \\ &=8+2 \\ &=10_{10}\\ \end{align} \begin{align} 101_2&=2^2+0+2^0 \\ &=4+1 \\ &=5_{10}\\ \end{align} \begin{align} 5_{10}&=4+1 \\ &=2^2+0+2^0 \\ &=101_2\\ \end{align}

Another way to do subtraction in the base two number system is to use these basic rules:

$0-0=0$
$1-0=0$
$1-1=0$
$10-1=1$
$11-1=10$

Remember:
$2_\text{ten}=10_\text{two}$
$3_\text{ten}=11_\text{two}$

### Worked example 3.4: Subtracting in the base two number system (Method 2)

Subtract $101_\text{two}$ from $1010_\text{two}$.

1. Step 1: Write the numbers one below the other, without the subscript "two". Line up the digits under the powers of two.

Remember that the powers of two, written from right to left in a place value table are: $2^0$, $2^1$, $2^2$, $2^3$, $2^4$, and so on.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\;1\;\;0\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline \end{array}
2. Step 2: Subtract the digits in the $2^0$ column. If it is not possible to subtract the bottom number from the top one, move 1 from the column to left.

We cannot do $0-1$, so move the $1$ from the $2^1$ column to the $2^0$ column:

• The $2^1$ column becomes $0$.
• The $2^0$ column becomes $10$.

Remember, in the base two number system: $10-1=1$ and $11-1=10$.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \; 2^2 \; 2^1 \; 2^0 }\\ &_{0}\,\phantom{000} \newline & 1\;\;0\;\cancel{1} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;0\;\;\,1\;\, \\ \hline &1\;\, \\ \hline \end{array}$
3. Step 3: Repeat Step 2 for the $2^1$ column.

In this column, $0-0=0$.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \; 2^2 \; 2^1 \; 2^0 }\\ &_{0}\,\phantom{000} \newline & 1\;\;0\;\cancel{1} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;0\;\;\,1\;\, \\ \hline &0\;\;\,1\;\, \\ \hline \end{array}$
4. Step 4: Repeat Step 2 for the $2^2$ column.

We cannot do $0-1$, so move the $1$ from the $2^3$ column to the $2^2$ column:

• The $2^3$ column becomes $0$.
• The $2^2$ column becomes $10$.
$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \; 2^2 \; 2^1 \; 2^0 }\\ &_{0}\,\phantom{000}_{0}\,\phantom{000} \newline & \cancel{1}\color{red}{1}\color{black}{0} \cancel{1} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;0\;\;\,1\;\, \\ \hline &1\;\;0\;\;\,1\;\, \\ \hline \end{array}$
5. Step 5: Check your answer using the base ten number system.

\begin{align} 1010_2&=2^3+0+2^1+0 \\ &=8+2 \\ &=10_{10}\\ \end{align} \begin{align} 101_2&=2^2+0+2^0 \\ &=4+1 \\ &=5_{10}\\ \end{align} \begin{align} 5_{10}&=4+1 \\ &=2^2+0+2^0 \\ &=101_2\\ \end{align}

### Exercise 3.2: Subtract binary numbers

Calculate each of the following in the base two number system.

1. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & \phantom{000}\newline & 1\;\;1\;\;1\;\, \\ -& 1\;\;1\;\;0\;\, \\ \hline &1\;\, \\ \hline \end{array}
2. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & \phantom{000}\newline & 1\;\;1\;\;1\;\, \\ -& 1\;\;0\;\;1\;\, \\ \hline &1\;\;0\;\, \\ \hline \end{array}
3. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & \phantom{000}\newline & 1\;\;1\;\;1\;\, \\ -& 1\;\;0\;\;0\;\, \\ \hline &1\;\;1\;\, \\ \hline \end{array}
4. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & \phantom{000}\newline & 1\;\;1\;\;0\;\, \\ -& 1\;\;0\;\;0\;\, \\ \hline &1\;\;0\;\, \\ \hline \end{array}
5. Remember, in the base two number system, $10-1=1$.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \; 2^1 \, 2^0 }\\ &_{0}\;\phantom{00000} \newline & \cancel{1} \color{red}{1}\color{black}{0}\;\;1\;\, \\ -& 1\;\;1\;\, \\ \hline &1\;\;0\;\, \\ \hline \end{array}$
6. $\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \; 2^0 }\\ &_{0}\,\phantom{000} \newline & 1\;\cancel{1} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;0\;\;\,1\;\, \\ \hline &1\;\, \\ \hline \end{array}$
7. $\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \; 2^0 }\\ &_{0}\;\,_{\color{red}{1}\color{black}{0}}\phantom{000} \newline & \cancel{1} \cancel{1} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;1\;\, \\ \hline &1\;\;1\;\, \\ \hline \end{array}$
8. There is a 0 in the $2^0$ column, so you need to move 1 from the $2^1$ column. But there is a 0 in $2^1$ column also, so you need to move the 1 from the $2^2$ column to the $2^1$ column first. When you move the 1 from the $2^2$ column, you have 10 in the $2^1$ column. When you then move 1 from the $2^1$ column, there is $10-1=1$ left.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \;\; 2^2 \;\; 2^1 \;\, 2^0 }\\ &_{0}\,\phantom{00}_{1}\phantom{000}\; \newline & \cancel{1\phantom{.}}\! \cancel{\color{red}{1}\color{black}{0}} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;\;1\;\, \\ \hline &1\;\, \\ \hline \end{array}$
9. When you move the 1 from the $2^3$ column, you have 10 in the $2^2$ column. When you then move 1 from the $2^2$ column, there is $10-1=1$ left.

$\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \;\; 2^2 \;\; 2^1 \;\, 2^0 }\\ &_{0}\,\phantom{00}_{1}\phantom{00000}\; \newline & \cancel{1\phantom{.}}\! \cancel{\color{red}{1}\color{black}{0}} \color{red}{1}\color{black}{0}\;\;1\;\, \\ -& 1\;\;0\;\, \\ \hline &1\;\;\,1\;\;1\;\, \\ \hline \end{array}$
10. $\require{cancel}\begin{array}{r r} & \color{blue}{2^3 \;\; 2^2 \;\; 2^1 \;\, 2^0 }\\ &_{0}\,\phantom{00}_{1}\,\phantom{00}_{1}\phantom{000}\; \newline & \cancel{1\phantom{.}}\! \cancel{\color{red}{1}\color{black}{0}} \cancel{\color{red}{1}\color{black}{0}} \color{red}{1}\color{black}{0}\;\, \\ -& 1\;\;\;1\;\, \\ \hline &1\;\;\;\,0\;\;\;1\;\, \\ \hline \end{array}$

## 3.3 Multiplication

Multiplication of the digits 0 and 1 work the same way in the base ten and base two number systems:

$0\times0=0$
$1\times0=0$
$0\times1=0$
$1\times1=1$

### Worked example 3.5: Multiplying in the base two number system

Multiply $11_\text{two}$ by $11_\text{two}$.

1. Step 1: Write the numbers one below the other, without the subscript "two". Line up the digits under the powers of two.

Remember that the powers of two, written from right to left in a place value table are: $2^0$, $2^1$, $2^2$, $2^3$, $2^4$, and so on.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\, \\ \times& 1\;\;1\;\, \\ \hline \end{array}
2. Step 2: Multiply the digit in the $2^0$ column of the bottom row by each of the digits in the top row.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\, \\ \times& 1\;\;\color{red}{1}\;\, \\ \hline & 1\;\;1\;\, \end{array}
3. Step 3: Start a new line. Insert a zero in the $2^0$ column.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\, \\ \times& 1\;\;\color{red}{1}\;\, \\ \hline & 1\;\;1\;\, \\ & 0 \;\, \end{array}
4. Step 4: Multiply the digit in the $2^1$ column of the bottom row by the top row.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\, \\ \times& \color{red}{1} \;\;\color{black}{1}\;\, \\ \hline & 1\;\;1\;\, \\ & 1\;\;1\;\;0 \;\, \end{array}
5. Step 5: Add the rows from Steps 3 and 4.

This adding step in a multiplication works differently in the base two number system than in the base ten number system. You need to use the base two addition rules: $1+1=10$ and $1+1+1=11$.

Remember, if the answer in any column is 10 or 11, carry over the left-hand 1 and write down the right-hand 0 or 1.

\begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\, \\ \times& 1 \;\; 1\;\, \\ \hline & 1\;\;1\;\, \\ & ^1\;^1 1\;\;1\;\;0 \;\, \\ \hline & 1\;\;0\;\;0\;\;1\;\, \\ \hline \end{array}
6. Step 6: Check your answer using the base ten number system.

\begin{align} 11_2&=2^1+2^0 \\ &=2+1 \\ &=3_{10}\\ \end{align} \begin{align} 9_{10}&=8+1 \\ &=2^3+0+0+2^0 \\ &=1001_2\\ \end{align}

### Exercise 3.3: Multiply binary numbers

Calculate each of the following in the base two number system.

1. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\, \\ \times& 1 \;\; 0\;\, \\ \hline & 0\;\;0\;\, \\ & 1\;\;0\;\;0 \;\, \\ \hline & 1\;\;0\;\;0\;\, \\ \hline \end{array}
2. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\, \\ \times& 1 \;\; 1\;\, \\ \hline & 1\;\;0\;\, \\ & 1\;\;0\;\;0 \;\, \\ \hline & 1\;\;1\;\;0\;\, \\ \hline \end{array}
3. \begin{array}{r r} & \color{blue}{2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;0\;\;0\;\, \\ \times& 1 \;\; 0\;\, \\ \hline & 0\;\;0\;\;0\;\, \\ & 1\;\;0\;\;0\;\;0 \;\, \\ \hline & 1\;\;0\;\;0\;\;0\;\, \\ \hline \end{array}
4. \begin{array}{r r} & \color{blue}{2^4 \,2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\;0\;\, \\ \times& 1 \;\; 1\;\, \\ \hline & 1\;\;1\;\;0\;\, \\ & ^1 \;^1 1\;\;1\;\;0\;\;0 \;\, \\ \hline & 1\;\;0\;\;0\;\;1\;\;0\;\, \\ \hline \end{array}
5. \begin{array}{r r} & \color{blue}{2^4 \,2^3 \, 2^2 \, 2^1 \, 2^0 }\\ & 1\;\;1\;\;1\;\, \\ \times& 1 \;\; 1\;\, \\ \hline & ^1 1\;\;1\;\;1\;\, \\ & ^1 \;^1 1\;\;1\;\;1\;\;0 \;\, \\ \hline & 1\;\;0\;\;1\;\;0\;\;1\;\, \\ \hline \end{array}

## 3.4 Division

To divide binary numbers, we can use a method similar to the long division method we use in the decimal number system. Note that the dividend is divided by the divisor to give a quotient:

In the binary system, long division is easier, because we only work with the following two principles:

• The number 1 represents "yes" and the number 0 represents "no".
• Throughout the process, we ask the same question: "Can the divisor divide into this part of the dividend?"

### Worked example 3.6: Dividing in the base two number system

Divide $1011_\text{two}$ by $11_\text{two}$.

1. Step 1: Write the dividend and divisor as you would for long division in the decimal number system, without the subscript "two".

2. Step 2: Start with the first digit of the dividend. Determine whether the divisor can divide into this digit.

Ask: "Can 11 divide into 1?"

• If the answer is "yes", write a 1 above the first digit of the dividend.
• If the answer is "no", write a 0 above the first digit of the dividend.
3. Step 3: Multiply the 0 or 1 from Step 2 with the divisor and subtract. Bring down the second digit of the divisor.

4. Step 4: Repeat Steps 2 and 3 for the divisor and the number obtained in Step 3.

Ask: "Can 11 divide into 10?"

• If the answer is "yes", write a 1 above the first digit of the dividend.
• If the answer is "no", write a 0 above the first digit of the dividend.

Then multiply, subtract, and bring down the next digit, as in Step 3.

5. Step 5: Repeat Steps 2 and 3 for the divisor and the number obtained in Step 4.

Ask: "Can 11 divide into 101?"

• If the answer is "yes", write a 1 above the first digit of the dividend.
• If the answer is "no", write a 0 above the first digit of the dividend.

Remember, in the binary system: $10-1=1$

6. Step 6: Repeat Step 2 for the divisor and the number obtained in Step 5.

There are no more digits in the dividend to bring down, so we cannot repeat Step 3. The answer we get here is a remainder.

Ask: "Can 11 divide into 101?"

• If the answer is "yes", write a 1 above the first digit of the dividend.
• If the answer is "no", write a 0 above the first digit of the dividend.

The answer is 11 remainder 10.

### Exercise 3.4: Divide binary numbers

Calculate each of the following in the base two number system.

2. The answer is 10 remainder 1.

3. The answer is 1 remainder 10.

5. The answer is 1 remainder 1.

7. The answer is 11 remainder 1.

8. The answer is 10 remainder 1.

## 3.5 Summary

• Use the following basic rules when adding binary numbers:
• $0+0=0$
• $0+1=1$
• $1+0=1$
• $1+1=10$
• $1+1+1=11$
• Use the following basic rules when subtracting binary numbers:
• $0-0=0$
• $1-0=0$
• $1-1=0$
• $10-1=1$
• $11-1=10$
• Multiplication of the digits 0 and 1 work the same in the base ten and base two number systems:
• $0\times0=0$
• $1\times0=0$
• $0\times1=0$
• $1\times1=1$
• The adding step in a multiplication works differently in the base two number system, because you need to use the base two addition rules.
• To divide binary numbers, we use a method similar to the long division we use in the decimal number system.
• Just as in the decimal number system:
$\begin{array}{r} \text{quotient}\newline {\color{red}{\text{divisor}}} \enclose{longdiv} {\color{blue}{\text{dividend}}}\newline \end{array}$
• When we divide in the binary system, we only work with the following two principles:
• The number 1 represents "yes" and the number 0 represents "no".
• Throughout the process, we ask the same question: "Can the divisor divide into this part of the dividend?"