On Thu, Feb 23, 2006 at 10:50:27AM +0000, 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. I didn't see anything the original spec that indicated that compromise was necessary. The OP threw out the word fastest. Space be damned! ;-) BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist