 Essentially, the algorithm operates by doubling the BCD value on the left each iteration and adding either one or zero according to the original bit pattern.Shifting left accomplishes both tasks simultaneously.If any digit is five or above, three is added to ensure the value "carries" in base 10.