 The algorithm then iterates "n" times.On each iteration, any BCD digit which is greater than 4 is incremented by 3; then the entire scratch space is left-shifted one bit.The increment ensures that a value of 5, incremented and left-shifted, becomes 16, thus correctly "carrying" into the next BCD digit.