Please Help Me Solve This!

HeloutthisCEnerd

New member
Joined
Apr 6, 2022
Messages
2
Question
Given N which is base n where N > 2 and n > 2 and M which is base m where M > 2 and m > 2 as well N > M and n > m write a procedure to convert N base n to M base m.

I know how to convert from base n to base 10, but I'm unsure about going from base 10 to base m. There is a general equation in trying to derive. I understand the process of using modulus and finding the remainders, but I am struggling to figure out an equation. Any help would be appreciated.

The general equation I was referring to:

Convert from source base to decimal (base 10 ) by multiplying each digit with the base raised to the power of the digit number (starting from right digit number 0):

decimal = ∑(digit×basedigit number) Convert from decimal to destination base: divide the decimal with the base until the quotient is 0 and calculate the remainder each time. The destination base digits are the calculated remainders.
 
Question
Given N which is base n where N > 2 and n > 2 and M which is base m where M > 2 and m > 2 as well N > M and n > m write a procedure to convert N base n to M base m.
There is a general equation [I'm?] trying to derive. I understand the process of using modulus and finding the remainders, but I am struggling to figure out an equation.

This asks for a procedure, not an equation. You appear to know a procedure; what more do you need?

On the other hand, have you considered that you can use the same formula you show for converting to base 10 to convert from base 10, as long as you can do the arithmetic in the target base?

For example, to convert 34_ten to binary, write each digit in base 2 and use the place values. 3_ten = 011_2, 4_ten = 100, 10_ten = 1010, so

34_ten = 3*10 + 4 = 011*1010 + 100 = 11110 + 100 = 100010_2​
 
Top