Use repeated subtraction of 100 to get the top nibble then use a 100 entry lookup table for the two lower nibbles. Fast and compact. __________________________________________ David C Brown 43 Bings Road Whaley Bridge High Peak Phone: 01663 733236 Derbyshire eMail: dcb.home@gmail.com SK23 7ND web: www.bings-knowle.co.uk/dcb *Sent from my etch-a-sketch* On 19 May 2018 at 17:25, Jean-Paul Louis wrote: > Wayne, > With 9bit input and 10/11 bit output, a lookup table will be fast and > inexpensive. > > Just a thought, > Jean-Paul > N1JPL > > On Fri, May 18, 2018, 6:53 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 > > > -- > 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 .