Number Systems Exercises

This Number System lab is designed for you to practice converting between different bases.

Binary Numbers

Binary is a base 2 numbering system. There are only two symbols used, 0 and 1.

Binary Positional Values

MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421

Binary to Decimal Conversion

To convert from binary to decimal, we need to add together the positional values for all the columns containing a 1. We ignore the columns with a 0, as they have nothing in them.

MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421
00010010110

In the above example, there are 1s in the \(2^7\), \(2^4\), \(2^2\) and \(2^1\) columns.

Therefore the decimal equivalent value is:

\[ \begin{aligned} 2^7 &= 128\\ 2^4 &= \hspace{0.5em}16 \\ 2^2 &= \hspace{1em} 4 \\ 2^1 &= \hspace{1em} 2 \hspace{0.5em}+ \\ \hline 000 1001 0110 & \equiv 150_{10} \end{aligned} \]

Binary to Decimal Conversion Exercises

Convert the following binary numbers into decimal:

$$2^7$$$$2^6$$$$2^5$$$$2^4$$$$2^3$$$$2^2$$$$2^1$$$$2^0$$Decimal
1286432168421
01010101
11111101
10000010
00001110
11001001
00100010
11011101
10101101
00110010


Click for solutions

$$2^7$$$$2^6$$$$2^5$$$$2^4$$$$2^3$$$$2^2$$$$2^1$$$$2^0$$Decimal
1286432168421
0101010185
11111101253
10000010130
0000111014
11001001201
0010001034
11011101221
10101101173
0011001050

Decimal to Binary Conversion

To convert from decimal to Binary, we have two options: The first of these involves continually dividing by two, and is explained in the PowerPoint presentation. The second way is the shorter way and it involves dividing through by the positional values rather than two. For example:

$$171_{10}$$

The largest positional value which will divide into \(171_{10}\) once is \(2^7\) which is equal to \(128_{10}\). We therefore place a 1 in the \(2^7\) column, and subtract \(128_{10}\) from \(171_{10}\):

MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421
1

\[ \begin{aligned} & 171_{10}\\ & 128_{10} \hspace{1em} - \\ \hline & \hspace{0.5em}43_{10} \end{aligned} \]

  • 43 is less than 64, so we put a 0 in the \(2^6\) column and move on to the \(2^5\) column. 43 is greater than 32, so we put a 1 in the \(2^5\) column and subtract 32 from 43:
MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421
101

\[ \begin{aligned} & 43_{10}\\ & 32_{10} \hspace{1em} - \\ \hline & 11_{10} \end{aligned} \]

  • 11 is less than 16, so we put a 0 in the \(2^4\) column and move on to the \(2^3\) column. 11 is greater than 8, so we put a 1 in the \(2^3\) column and subtract 8 from 11:
MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421
10101

\[ \begin{aligned} & 11_{10}\\ & \hspace{0.5em}8_{10} \hspace{1em}- \\ \hline & \hspace{0.5em}3_{10} \end{aligned} \]

  • 3 is less than 4, so we put a 0 in the \(2^2\) column and move on to the \(2^1\) column. 3 is greater than 2, so we put a 1 in the \(2^1\) column and subtract 2 from 3:
MSBLSB
$$2^{10}$$$$2^{9}$$$$2^{8}$$$$2^{7}$$$$2^{6}$$$$2^{5}$$$$2^{4}$$$$2^{3}$$$$2^{2}$$$$2^{1}$$$$2^{0}$$
10245122561286432168421
10101011

\[ \begin{aligned} & 1_{10}\\ & 1_{10} \hspace{1em}- \\ \hline & 0_{10} \end{aligned} \]

Decimal to Binary Conversion Exercises

Convert the following decimal numbers into binary:

Decimal$$2^7$$$$2^6$$$$2^5$$$$2^4$$$$2^3$$$$2^2$$$$2^1$$$$2^0$$
1286432168421
165
242
7
92
63
12
129
71
45

Click for solutions

Decimal$$2^7$$$$2^6$$$$2^5$$$$2^4$$$$2^3$$$$2^2$$$$2^1$$$$2^0$$
1286432168421
16510100101
24211110010
700000111
9201011100
6300111111
1200001100
12910000001
7101000111
4500101101