How to Inter-convert Numbers NOT in Powers of 2?
In this course, our primary focus lies on four number systems: binary, octal, hexadecimal, and decimal. Each of the first three—binary, octal, and hexadecimal—shares a structural foundation rooted in powers of \(\mathsf{2}\), making them particularly convenient for digital and computational applications. Meanwhile, the decimal system, based on powers of \(\mathsf{10}\), remains dominant in everyday use and human-centric calculations.
However, situations may arise where we need to convert numbers from one arbitrary base to another, particularly when neither system is decimal and at least one of them is not a power of \(\mathsf{2}\). In such cases, instead of developing complicated mathematical strategies to carry out a direct base-to-base conversion, we can adopt a simpler, more universal method: use the decimal system as a bridge.
To do so, we begin by converting the number from its original base into decimal. Once we have the decimal equivalent, we then proceed to convert it into the desired target base. This two-step process ensures clarity, consistency, and reliability—especially when working across uncommon or custom-designed number systems.
How to Convert from Arbitrary to Another Base?
- Convert the original number to decimal using base to decimal conversion method.
- Take the decimal number and convert it to the target base using decimal to base conversion method.
Example: Let’s convert \(\mathsf{55.25_{6}}\) into base-9 with 2 digits of precision.
Step 1: Convert \(\mathsf{55.25_{6}}\) into base-10.
To begin the conversion, we first transform the number \(\mathsf{55.25}\) from base-6 into its decimal equivalent. This involves multiplying each digit by powers of \(\mathsf{6}\) based on its positional index, starting from left to right for the whole part and from right to left for the fractional part. Specifically, each digit contributes a weighted value depending on its place: the whole digits are multiplied by \(\mathsf{6^{1}}\) and \(\mathsf{6^{0}}\), while the fractional digits are multiplied by \(\mathsf{6^{-1}}\) and \(\mathsf{6^{-2}}\). Adding all these weighted values gives us the final decimal result. The equivalent number in decimal turns out to be \(\mathsf{35.47}\).
Step 2: Convert \(\mathsf{35.47_{10}}\) into base-9 with 2 bits of precision.
To convert \(\mathsf{35.47_{10}}\)} into base-9 with two digits of fractional precision, we begin by processing the whole number part. Divide \(\mathsf{35}\) by \(\mathsf{9}\) repeatedly, recording each remainder. Writing the remainders in reverse order gives the base-9 representation of the whole part.
Next, we focus on the fractional part: Multiply \(\mathsf{0.47}\) by \(\mathsf{9}\) to get the first base-9 fractional digit. Keep the integer part of the result, and continue by multiplying the remaining fractional part again by \(\mathsf{9}\). The whole number portion of this second product becomes the second digit after the radix point.
Since we need only two digits of precision, this multiplication cycle is performed just twice, yielding an accurate base-9 representation with the desired precision. The answer comes out to be \(\mathsf{38.42_{9}}\).
So, by converting \(\mathsf{55.25_6}\) into decimal first and then translating it into base-9 with two digits of fractional precision, we obtain: \(\mathsf{38.42_9}\).