----- Original Message ----- From: Daniel Serpell To: Sent: Thursday, June 26, 2003 5:59 PM Subject: Re: [PIC]: 8-byte vertical adder? > On Thu, Jun 26, 2003 at 05:13:46PM +0100, Sergio Masci wrote: > > From: Daniel Serpell > > > > Assuming that this is actually giving you what you want and that acc is 16 bits, > > the first 3 iterations of the loop can be perfomed on 8 bit acc and the > > remainder on 16 bit acc. Also your lookup table will require 256 entries > > I'm not thinking on using lookup tables. The code will be: > > > That's exactly 121 cycles, and 121 program words. > But seeing it writen, I have found an error (try to spot it!), > so 7 more instructions are needed (with 128 cycles total). > The code can be expanded for more than 8 bits. > > Daniel. Unfortunatly I don't have time to go working through your code right now (which is why I wrote the alogrithm in C in the first place). Perhaps you can show us the corrected version? Why do you not want to use a lookup table? This would speed things up. I will certainly be having a closer look at what Scott has produced when I get a few minutes. Regards Sergio Masci -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads