Number representation
Almost all of us know how to convert a decimal number, i.e. a number represented in base 10, to a binary which is a number in base 2. We also learn the generalization of it, i.e. converting a decimal number to any positive integral base. But the interesting fact is that it is not essential to have the base to be a positive integer, rather base can be negative, fractional and even imaginary. In this article we will only consider positive fractional base and the arithmetic of it.
The Scheme:
Suppose we want to convert a decimal number x to a
base 1/n, where n is any positive integer. The conversion process involves two steps:1. First we convert x into base n.
2. Next we convert it to the base 1/n.
How To Do It?
Here I will assume that you already know how to perform the first step (If you do not, then just consult any standard text book or search the web, the process is very easy and straight forward). One point is to be noted that for a fractional number represented in other bases the 'point' should be called a radix point, rather than the decimal point.
The second step is the interesting one. I will describe it step by step using a real number, say x=34.0625 and n=8.
Note: To display the base of a number I will use curly brackets after the number, for example, (43.04){8} means 43.04 is to be considered in base 8.
1. First convert the number in base 8 and write in expanded form.
(35.0625){10} = (43.04){8} = 4(8^1) + 3(8^0) + 0(8^-1) + 4(8^-2)
2. Change the sign of all exponents of 8, so that
4(8^-1) + 3(8^0) + 0(8^1) + 4(8^2) = (403.4){1/8}
Hence, (35.0625){10} = (403.4)1/8
Examples of Conversion:
A few more examples will make this easy method further easier.
1. (39.0625){10} = (213.01){4} = 2(4^2) + 1(4^1) + 3(4^0) + 0(8^-1) + 1(8^-2).
Therefore (39.0625){10} = (103.13){1/4}
2. -(119.4){10} = -(434.2){5} = -4(5^2) - 3(5^1) - 4(5^0) - 2(5^-1).
Therefore -(119.4){10} = -(24.34){1/4}
3. (0.0625){10} = (0.0001){2} = 0(2^-1) + 0(2^-2) + 0(2^-3) + 1(2^-4).
Therefore (0.0625){10} = (10000){1/2}
4. (45.678){10} = (8765.4){1/10}
Some Properties and A Shortcut:
1. In the fractional base the most significant digit is the rightmost digit in contrast to
the integral base. So if you want to compare two numbers in the fractional base you need to compare positional value of the rightmost digit.Thus, (77.32){1/8} < (11.06){1/7}.
2. If you observe you will notice that conversion from the numbers in integral base to fractional base follows a simple rule. Just shift the radix point in base n to one digit left and write the number in reverse order to obtain representation in fractional base 1/n. This shortcut reduces the job to half and you can find the answer just by performing step 1.
Thus, (1234.56){7} = (654.321){1/7}.
3. The calculation becomes very trivial for the case of n=10, you need no conversion and result is found by merely shifting the decimal point and writing the number in reverse order.
Thus, (100200){10} = (0.02001){1/10}
Addition and Subtraction
Addition and subtraction in fractional base is same as integral base except for the fact that now you need to start from left side and continue to the right, this is because of the fact that the rightmost digit is the most significant digit as mentioned earlier. Also while subtracting, take care of which number is greater and put it on the top not to get into any trouble. Here I show few examples.
Examples of Addition and subtraction
1. (23.04){1/8} + (71.2){1/8}} = (15.24){1/8}
2. (2.13){1/4} + (112){1/4} = (110.23){1/4}
3. (112){1/4} - (2.13){1/4}
= -[(2.13){1/4} - (112.0){1/4}] = -(323.03){1/4}
4. (20.63){1/10} - (623.7){1/10} = (496.82){1/10}
In a similar fashion multiplication and division can also be done, which I leave for the readers to check.
I hope my article will help you understanding the concept of fractional base. If you like it or have any question leave a comment below.
If you like ti join Expertscolumn, click here. Check out my other related articles: How to Convert a Decimal Number into Negative Base: A Tutorial A Standard Interview Question: Finding Integral and Derivative of a Graph without Knowing the Functional Form You can also see: http://www.squidoo.com/how-to-convert-a-decimal-number-to-any-fractional-base-a-tutorial