Binary-to-decimal conversion based on the divisibility of 2 8 — 1 by 5
Benjamin Arazi, David Naccache · Electronics Letters · 1992
The Letter treats the case of converting a binary value, represented in the form of n bytes, into a decimal value, represented in the form of m BCD characters. The conversion, which is suitable for one-byte and two-byte processors, is based on the following observations: (a) 5 is a divisor of 28 − 1 and 216 − 1. (b) Modular binary arithmetic over 2r − 1 is easily performed. (c) Binary division by 2r −1, in the case where the remainder is known to be zero, is easily performed. (d) All the prime factors of 28 − 1 and 216 − 1 are of the form 2r + 1.