And if both values realy are *needed*, it's faster to do the *2 first, then do a *8, thats 1+3 shifts instead 4+3, right ? Jan-Erik S=F6derholm -----Original Message----- From: Bob Barr [mailto:bbarr@CALIFORNIA.COM] Sent: den 30 januari 2003 23:46 To: PICLIST@MITVMA.MIT.EDU Subject: Re: [pic]: fast 16bit mpy/div On Thu, 30 Jan 2003 11:26:53 -0200, antoniasse wrote: >Hi all, > >I'm needing any help. >How can I do a fast 16bit number multiply by costant decimal value 16 = and a >16bit result value divide by a costant decimal 8 >Ex: d850*16=3D13600 >13600/8=3D1700 > Am I missing something that's just so obvious that I can't see it here? Why wouldn't you just multiply the original number by 2? You can do that by just adding the number to itself, propogating any carry from the lsb to msb byte. Regards, Bob -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body