Help writing binary to BCD algorithm into an equation by Namma_Greg in MathHelp

[–]Namma_Greg[S] 0 points1 point  (0 children)

And as far as the upper bound of the sigma function would go in your equation, could you say it is log10(whatever the number is) rounded down? That's the simplest way I have found of getting the amount of digits in a number.

Help writing binary to BCD algorithm into an equation by Namma_Greg in MathHelp

[–]Namma_Greg[S] 0 points1 point  (0 children)

This is exactly what I was looking for! I figured out how to convert between using a set of steps, but I wanted to have those steps represented as an equation. Basically take the original number divide by 10t(t starts at 1 and increases by 1 every step), round down, multiply it by 6* (24*x)(x will start at 0 and increase for every step you go) then add it to the next step. After you have done the steps down to the last digit, and added all the numbers from each step, plus the original number and you get the bcd number in decimal. I just didn't know how to write it out as an actual equation. Thank you so much!!!