A quick follow up. Spent a few minutes looking for an appropriate multiplication constant and didn't find one. A Google search for a div10 algorithm returned this page: https://electronics.stackexchange.com/questions/12618/fastest-way-to-get-in= teger-mod-10-and-integer-divide-10 It contains several bcd conversion routines. The most interesting one to me is the double dabble algorithm. On Sat, May 19, 2018, 7:24 AM Forrest Christian (List Account) < lists@packetflux.com> wrote: > Which processor? > > If it has a 8x8 hardware multiplier there might be some options using it. > I'd have to spend some time figuring out how to leverage it since it only > multiplies. Often you can get around this by a multiply by a constant an= d > a shift. The constant is chosen such that the result is an even power o= f > two too high, which results in your division result being in the most > significant bits, and a fractional remainder being in the least > significant bits. > > On Fri, May 18, 2018, 4:00 PM Dwayne Reid wrote: > >> Good day to all. >> >> I'm looking for a small, fast 9-bit binary-to-decimal conversion >> routine. Somewhere between Scott Datallo's 8-bit-to-decimal and John >> Payson's 16-bit-to-decimal routines. >> >> Input range is [0..511] in binary, output in BCD or >> packed-BCD. Actual input range for this project is 0..399 but I >> might as well try to get the full 9-bits of range. >> >> Short and fast if possible. >> >> I've been looking at PICLIST.com as well as my old email archives but >> haven't seen anything that is both short and fast. >> >> Does anyone have something that they can share? >> >> Many thanks! >> >> dwayne >> >> -- >> Dwayne Reid >> Trinity Electronics Systems Ltd Edmonton, AB, CANADA >> 780-489-3199 voice 780-487-6397 fax 888-489-3199 Toll Free >> www.trinity-electronics.com >> Custom Electronics Design and Manufacturing >> >> -- >> http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >> > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .