On Mon, 15 Feb 2010, Isaac Marino Bavaresco wrote: > I understand, but this method doesn't use 16-bit math at all. All the > math is done nibble-by-nibble, no carry is propagated during the additions. > The only part that uses carry propagation is during the shifts, that > shifts the whole 16-bit (or 9-bit in this case) value. It works for > values with any number of digits. > > If you don't already know this method, I would suggest to study it, it > is very enlightening. Shows a very different approach that exploits > curious properties of binary and BCD numbers. It is being used for a > while by the CPLD/FPGA guys, because it is easily implemented using just > shift-registers and adders. Thank you Isaac I'll have a look at that later (got to get the C18 compiler and library first) :-) I vaugely remember a method using half carrys but not well enough to do it off the top of my head. I also know of a method using multiply by 10 (which itself can be broken down to shifts and add) but a method not propagated carry in additions? I'm not sure I've seen that one or if I have I've certainly forgotten all about it. Thanks Sergio -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist