04-26-2013, 02:13 AM
(This post was last modified: 04-26-2013, 02:14 AM by redstonewarrior.)
Now, why it works :3 (W/O Video)
I think the easiest explanation is this:
Each shift operation does BCD multiplication by two. So for each digit, multiply it by two (shift), and if the result is over ten then carry. So you have a series of multiplications by two (in BCD format) and additions of one. By placing the increments properly (BCD adding one, a simple operation), you can end up with this where V is the final value and Ia is the ath element.)
V = I[/size]0 + 2* (I[/size]1 + 2 * ( I[/size]2 + 2* (...)))
And you end up with
V = I7 * 2^7 + I6 * 2^6 + I5 * 2^5 + I4 * 2^4 + I3 * 2^3 +I2 * 2^2 +I1 * 2^1 + I0 * 2^0, or the exact same value, but in BCD.
I hope that helps. :3
I think the easiest explanation is this:
Each shift operation does BCD multiplication by two. So for each digit, multiply it by two (shift), and if the result is over ten then carry. So you have a series of multiplications by two (in BCD format) and additions of one. By placing the increments properly (BCD adding one, a simple operation), you can end up with this where V is the final value and Ia is the ath element.)
V = I[/size]0 + 2* (I[/size]1 + 2 * ( I[/size]2 + 2* (...)))
And you end up with
V = I7 * 2^7 + I6 * 2^6 + I5 * 2^5 + I4 * 2^4 + I3 * 2^3 +I2 * 2^2 +I1 * 2^1 + I0 * 2^0, or the exact same value, but in BCD.
I hope that helps. :3