You are on page 1of 6

Tutorial on Numbering Systems

Part 1: Review of numbering systems:


1. The Decimal System
The decimal number system is the one that we are most familiar with, we use it every day.
Decimal is what we refer to as a positional number system. That is, the position of the digits
gives meaning to the value they represent. The other number systems (binary, hexadecimal
and octal) are also positional, so once we understand the underlying theory of decimal we
can easily apply that to understand the other systems.
Let's look at an example:
If we have the number 31415, what this actually represents is:
30,000 + 1,000 + 400 + 10 + 5
Or more precisely:

Decimal is base 10. This means we have 10 symbols for representing values ( 0 - 9 ). As
we move through each position we multiply that number by 10 to the power of that position
(starting at 0 at the far right side).

2. Binary
Binary follows the same pattern as Decimal except that instead of being base 10, it is
instead base 2. Instead of having 10 symbols to represent values we have two ( 0 and 1
). So Decimal is a base 10 number system, we have 10 symbols and multiply by powers
of 10. It follows that Binary is a base 2 number system, we have two symbols and
multiply by powers of 2.
Let's look at an example:
If we have the binary number 101010, this translates into decimal as:
32 + 0 + 8 + 0 + 2 + 0 = 42
Or:

3. Hexadecimal:
Two other number systems which are commonly used in computing are Hexadecimal and
Octal. These are both also base number systems. Hexadecimal is base 16. For hexadecimal
we go up to 15 (remember we start from 0). Once we get to 9 we add the letters of the
alphabet A - F to represent 10 - 15 (see the reference table below).
Let's take the decimal number 27.
In hexadecimal this would be (1B) which in decimal translates into:
1 * 161 + 11 * 160 = 16 + 11
Part 2: Conversion between numbering systems:

a. Binary to Decimal
We touched on binary to decimal conversion briefly in the previous section. We'll cover it
again here. The process is fairly simple:
 Each digit may only be a 1 or 0.
 If it is a 0 then it adds nothing.
 If it is a 1 then we add 2 to the power of that position.
The right most digit in the binary number is multiplied by 2 to the power of 0 (which is 1).
The next digit is multiplied by 2 to the power of 1 ( which is 2 ) and so on. It is easy to start
at the far right binary digit as this is always going to be to the power of 0. If you start at the
far left digit then you have to work out what the starting power should be (how many digits
there are minus 1) and it's easy to make a mistake. Starting at the far right also makes our
calculations easier as each time we increase the power we simply double the result of the
previous power.
20 = 1
21 = 2
22 = 4
23 = 8
24 = 16
Here is a simple demonstration that should make the process clearer:
(110111)2=
1 x 20 = 1
1 x 21 = 2
1 x 22 = 4
0 x 23 = 0
1 x 24 = 16
1 x 25 = 32
So the total sum is (55)10.
b. Decimal to Binary
Converting a decimal number to binary is a little more complex. Once you get the hang of
it though it's fairly straight forward. There are a few ways you may approach converting
decimal to binary. The first way is to put the digit weights and see which ones you need to
add to get the required decimal number:

For example:
To convert (30)10 to binary:
25 24 23 22 21 20
(0) (1) (1) (1) (1) (0)  16+8+4+2=30. So the answer is (011110)2.

Another way is repeated division by 2. With repeated division by 2 we repeatedly divide


the number by 2 and record the remainder. Once you've done this, all the way down to 0,
you read the remainder digits from bottom to top and you have your binary number. The
example below will illustrate. The result of division by 2 is listed on the left and the
remainder is listed on the right.
For example, in order to convert (43)10 to binary:

Quotient Remainder
43 21 1
21 10 1
10 5 0
5 2 1
2 1 0
1 0 1

Therefore, the binary equivalent is: (101011)2, read from down to top, left to right !

c. Hexadecimal to binary:

Converting from binary to hexadecimal and hexadecimal to binary is actually very easy.
This is because hexadecimal is base 16. convert a hexadecimal number to binary all we
need to do is replace each hexadecimal digit with it's equivalent in binary. In the following
examples it may help to refer to the reference table further down the page.

For example if we have the hexadecimal value (75C)16 then it may be converted to binary
as follows:

7 5 C
0111 0101 1100
So the result is : (0111 0101 1100)2

d. Binary to hexadecimal:
To convert binary to hexadecimal is simply a matter of reversing the above process. Divide
your binary number into chunks of 4 (starting from the far right), then replace each chunk
with the relevant hexadecimal value.
For example to convert (1111 0100 11)2 to hexadecimal we simply divide the whole
number into group of 4 bits, starting from right side, we can extra zeros on the left if we
need to:

(00) 11 1101 0011


3 D (this is 13) 3

So the result is (3D3)16.

e. Decimal to Hexadecimal:
If you need to convert between decimal and hexadecimal it is possible using the methods
listed for binary but replacing 2 with 16. For example, to convert (250)10 to hexadecimal,
we need to do the following division (note that you need to divide by 16 each time):

Quotient Remainder
300 18 12
18 1 2
2 0 2

Therefore the result is (2 2 C )16 , make sure to read remainder from bottom to top, then
left to right.

f. Hexadecimal to decimal:
This is done the same way in converting binary to decimal, however replacing 2 with 16.

For example:
To convert (2C9)16 to decimal:
2 C 9
162 161 160

So the results is: 2*(162) + C*161 + 9*160 = (713)10


References:
1. https://ryanstutorials.net/binary-tutorial/binary-conversions.php
2. https://www.tutorialspoint.com/computer_fundamentals/computer_number_syste
m.htm
3. https://code.tutsplus.com/articles/number-systems-an-introduction-to-binary-
hexadecimal-and-more--active-10848

You might also like