Published by: Nuru
Published date: 22 Jun 2021
Conversion of the Number System can be normally divided into two parts so that you can easily understand the concept. They are as follows:
As an example, let's take a decimal number 123 and convert it to decimal notation. To extract the last digit, you move the decimal point by one digit, which means you divide the given number by 10.
123/10=12+3/10
The remainder of 3 is the last digit. To extract, you again move the decimal point by one digit.
12/10=1+2/10
You repeat this process until nothing is left. Then you stop.
Quotient Remainder
123/10= 12 3
12/10= 1 2
1/0= 0 1
Now, let's try a nontrivial example. Let's express a decimal number 51 in binary notation. Note that the desired base is 2, so we repeatedly divide the given decimal by 2 and repeat the same process.
Quotient Remainder
51/2= 25 1
25/2= 12 1
12/2= 6 0
6/2= 3 0
3/2= 1 1
1/2= 0 1
Again, let's take the same decimal number 51 in octal notation.
Quotient Remainder
51/8= 6 3
6/8= 1 2
Similarly, you can do for hexadecimal also.
Let's think more carefully about what a decimal number means. For example, 123 means there are 3 boxes(digits); and there are 3 ones in the right-most box(least significant digit), 2 ten's in the text box, and a hundred's in the left-most box. The total is 123.
Thus, each digit has a value: 100=1 for the least significant digit, increasing to 101=10, 102=100, and so on.
Likewise, the least significant digit in a hexadecimal number has a value of 160=1 for the least significant digit, increasing to 161=16 for the next digit, 162=256 for the next and so on. Thus, 123 means there are 3 boxes(digits); and there are 3 ones in the right-most box, 2 sixteens in the next box, and 1 256 in the next box. The total is:
1*256+2*16+3*1=291
In summary, the conversion from any base to decimal can be obtained from the formulae
an.rn+a.r+…an-1.rn-1+a2.r2+ a1.r+a0+a-1.r-1+a-2.r-2…+a-m.r-m
Where r is the base, d is the digit at position I, m is the number of digit after decimal point, n is the number of digits of integer parts and
X10 is the obtained number in decimal. This forms the basic of the polynomial method of converting numbers from any base to decimal.