Header Ads

Header ADS

Number Bases: Conversion Of Numbers From One Base To Another

Number Bases: Conversion Of Numbers From One Base To Another

Converting between various number bases is essentially comparatively simple, but the thinking following it can appear a bit confusing at first. And while the topic of various bases may appear rather meaningless to you, the increase in the use of computers and computer graphics has augmented the requirement for knowledge of how to work with various (non-decimal) base systems, especially binary systems (ones and zeroes) and hexadecimal systems (the numbers zero up to nine, followed by the letters A to F).

In our normal base-ten system, we have digits for the numbers zero to nine. We do not have a one-digit number for "ten". Therefore, we write "10", but this represents "1 ten and 0 ones". This is two digits; we do not have any one standalone digit that represents "ten".

Rather, when we are required to count to one more than nine, we zero out the ones column and add one to the tens column. When we get too big in the tens column -- when we require one more than nine tens and nine ones ("99"), we zero out the tens and ones columns, and add one to the ten-times-ten, or hundreds, column.

The next column is the ten-times-ten-times-ten, or thousands, column. The same goes for each bigger column that is ten times bigger than the one before. We put digits in each column, to inform us of the number of copies of that power of ten we require.

The only reason base-ten math appears "natural" and the other bases don't is that you've been working with base-ten since you were a child. And (almost) every civilization has made use of base-ten math maybe for the simple reason that we possess ten fingers.

If on the contrary we lived in a cartoon world, where we would only possess only four fingers on each hand ( you may need to take note of them next time you're watching TV or reading the comics), then the "natural" base system would probably have been base-eight, or "octal".

Binary system or base two

Let's discuss about base-two, or binary numbers. How would you write, for example, 1210 ("twelve, base ten") as a binary number? You would be required to convert to base-two columns, the analogue of base-ten columns. In base ten, there are columns or "places" for 100 = 1, 101 = 10, 102 = 100, 103 = 1000, etc. In the same way, in base two, there are columns or "places" for 20 = 1, 21 = 2, 22 = 4, 23 = 8, 24 = 16, etc.

The first column in base-two math is the units column. Therefore only, "0" or "1" can fit into the units column. When you count to "two", you discover that there is no one single digit that represents "two" in base-two math. Rather, you put a "1" in the twos column and a "0" in the units column, showing "1 two and 0 ones". The base-ten "two" (210) is written in base two as 102.

A "three" in base two means just "1 two and 1 one", therefore it is written as 112. "Four" is really two-times-two, therefore we zero out the twos column and the units column, and input a "1" in the fours column; 410 is written in binary form as 1002. Below is a listing of the first few numbers:

decimal (base 10)binary (base 2)
0 1
2
3
4
5
6
7
9
8
10
11
12
13
14
15
16
0 1
10
11
100
101
110
111
1000
1001
1010
1011
1100
1101
1110
1111
10000
0 ones
1 one
1 two and zero ones
1 two and 1 one
1 four, 0 twos, and 0 ones
1 four, 0 twos, and 1 one
1 four, 1 two, and 0 ones
1 four, 1 two, and 1 one
1 eight, 0 fours, 0 twos, and 0 ones
1 eight, 0 fours, 0 twos, and 1 one
1 eight, 0 fours, 1 two, and 0 ones
1 eight, 0 fours, 1 two, and 1 one
1 eight, 1 four, 0 twos, and 0 ones
1 eight, 1 four, 0 twos, and 1 one
1 eight, 1 four, 1 two, and 0 ones
1 eight, 1 four, 1 two, and 1 one
1 sixteen, 0 eights, 0 fours, 0 twos, and 0 ones

Converting between binary and decimal numbers

This is rather simple, in so far as you remember that every digit in the binary number stands for a power of two. Eg.

• Convert 1011001012 to its equivalent base-ten number.

We will list the digits in order, and count them off from the RIGHT, beginning with zero:

digits:1 0 1 1 0 0 1 0 1
number:8 7 6 5 4 3 2 1 0

The first line above that is the row labeled "digits" is made up of the digits from the base two number; the second row labeled "number" is made up of the power of 2 which is the base equivalent to each one of the digits. We will make use of the above listing to convert everyone of digits to the power of two that it stands for:

1×28 + 0×27 + 1×26 + 1×25 + 0×24 + 0×23 + 1×22 + 0×21 + 1×20

= 1×256 + 0×128 + 1×64 + 1×32 + 0×16 + 0×8 + 1×4 + 0×2 + 1×1

= 256 + 64 + 32 + 4 + 1

= 357

Thus conversion of 1011001012 to base 10 gives 35710.

Conversion of decimal numbers to binaries is almost as simple as the above example. You only need to divide the number you have gotten by 2. Example:

• Convert 35710 to the equivalent base 2 number.

To obtain the answer to this, you are required to constantly divide by 2 and keep in mind the remainders as you go along. After dividing constantly by 2, the remainders you ended up with is the binary number you are required to obtain. Jus count the numbers above the division from the top and wrap your way around and down the right-hand side. When this is done, you would obtain that:

35710 converts to 1011001012.

This form of conversion works for the conversion to any non-decimal base. Remember to always include that first digit on the top, before you start listing the remainders. You can convert from base-ten (decimal) to any other base. In the class settings when you study this topic, you will likely be required to convert number to different other bases. A few more examples will help you to understand this better.

Base 4

In base four, each digit in a number represents the number of copies of that power of four. That is, the first digit signifies the number of ones you have; the second signifies the number of fours you have; the third signifies the number of sixteens (four-times-fours) you have; the fourth signifies the number of sixty-fours (four-times-four-times-fours) you have; etc. The methodology for conversion between decimal and base-four numbers is merely like that for converting between decimals and binaries, apart from the fact that binary digits can be only "0" or "1", whereas the digits for base-four numbers can be "0", "1", "2", or "3".You would notice that there is no single one digit in base-four math that stands for the quantity "four".

Convert 35710 to the equivalent base-four number.

Here, you will carry out the same division that we did before, keeping record of the remainders. You may want to this in a rough paper.

Then 35710 is 112114 in base 4.

Convert 80710 to the equivalent base-four number.

Things to bear in mind: Immediately, you get to "3" on top, stop because four cannot divide 3.

Reading the numbers gotten from the division, you get that 80710 converts to 302134.

Convert 302134 to the corresponding decimal number.

What you will do here is to list out the digits, and then number them from the RIGHT, beginning from zero:

digits:3 0 2 1 3
numbering:4 3 2 1 0

Each digit stands for the number of copies I need for that power of four:

3×44 + 0×43 + 2×42 + 1×41 + 3×40
= 3×256 + 0×64 + 2×16 + 1×4 + 3×1 
= 768 + 32 + 4 + 3 
= 807

Just like you would expect, 302134 would convert to 80710.

Base 7

Base 7 don’t have any particular use, but they would be used here for showing you a few more practice with the conversions of number bases.

Convert 35710 to the equivalent base-seven number.

See the division below:

Then, 35710 = 10207

Convert 1334610 to the equivalent base-seven number.

Then, 1334610 = 536247

Convert 536247 to the equivalent decimal number.

You would list the digits, and count them off from the RIGHT, beginning from zero:

digits:5 3 6 2 4
number:4 3 2 1 0

After that, do the multiplication and addition:

5×74 + 3×73 + 6×72 + 2×71 + 4×70 = 5×2401 + 3×343 + 6×49 + 2×7 + 4×1 = 12005 + 1029 + 294 + 14 + 4 = 13346

Then, 536247 = 1334610

Base eight or Octal

An older computer base system is "octal", or base eight. The digits in base 8 math are 0, 1, 2, 3, 4, 5, 6, and 7. The value "eight" is written as "1 eight and 0 ones", or 108.

Convert 35710 to the equivalent base-eight number.

You will carry out the normal repeated division, but this time dividing by 8 at every step:

Therefore the equivalent base 8 number is 5458.

Convert 5458 to the equivalent decimal number.

Follow the normal procedure, counting off the digits from the RIGHT, beginning from zero:

digits:5 4 5
number:2 1 0

After this carry out the addition and multiplication:

5×82 + 4×81 + 5×80 
= 5×64 + 4×8 + 5×1 
= 320 + 32 + 5 
= 357

Therefore, the equivalent decimal number is 35710.

Hexadecimal

Hexadecimal or base-sixteen maths is mostly made use of in computer programming or computer engineering (or computer graphics).

Decimal math does not have a single standalone digit that stands for the value of "ten". Rather, it is being represented by two digits, a 1 and a 0: "10". But in hexadecimal math, the columns represent multiples of sixteen. This means that the first column stands for the number of units you have, the second column represents the number of sixteens, the third column represents the number of two hundred fifty-sixes (sixteen-times-sixteens) etc.

In base ten, we had digits 0 to 9. In base eight, we had digits 0 to 7. In base 4, we had digits 0 to 3. In any base system, you will obtain digits 0 to one-less-than-that number base. Following this rule, in hexadecimal base, we ought to have "digits" that range from 0 to15. To obtain this, we require one solitary digit that represents the value of "ten", "eleven", "twelve", "thirteen", "fourteen", and "fifteen". But this is not possible. Therefore as a replacement we make use of letters. Thus, counting in hexadecimal, the sixteen "numerals" are as shown below:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

This means that, A is "ten" in "regular" numbers, B is "eleven", C is "twelve", D is "thirteen", E is "fourteen", and "F" is fifteen. It is this utilization of letters to represents digits that make hexadecimal numbers look weird at first. But the conversions still follows the same method as shown below:

Convert 35710 to the equivalent hexadecimal number.

Divide repeatedly by 16, keeping record of the remainders as I go. You may wish to make use of a few scratch paper for this.

Reading off the digits, beginning from the top and wrapping around the right-hand side, you would obtain that 35710 = 16516.

Convert 16516 to the equivalent decimal number.

List the digits, and count them off starting from the RIGHT, with zero first:

digits:1 6 5
number:2 1 0

Bear in mind that every digit in the hexadecimal number stands for the number of copies you require of that power of sixteen, and convert the number to decimal:

1×162 + 6×161 + 5×160 
= 1×256 + 6×16 + 5×1 
= 256 + 96 + 5 
= 357

Then 16516 = 35710.

Convert 6393310 to the equivalent hexadecimal number.

Divide repetitively by 16, keeping record of your remainders:


View more on psalmfresh.blogspot.com for more educating and tricks article Thank you

No comments

Powered by Blogger.