On Thu, 23 Feb 2006, Chris Emerson wrote: > On Wed, Feb 22, 2006 at 10:41:34AM -0700, Bob Axtell wrote: >> Spehro has it right- to use the code access capability of the >> F877 allows the LUT to handle all of it, i.e. 2 bits for 100s, 4 >> bits for tens, 4-bits for ones places, a total of 10 bits. BUT, it uses >> over 260 code words. Would run about 9 cycles to extract a >> lookup value, however, faster than my earlier suggestion. > > As a compromise you could save about half that space (at the cost of a > few cycles) by first right-shifting, dividing by 5 using a half-size > LUT, and adding the LSB back into the remainder at the end. N/10 = N/8 - N/32 + N/128 ( - N/640 ... ) The terms before the parentheses are enough for 8 bits. Peter -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist