Re: sw multiply



On Fri, 6 Oct 2006 10:51:11 +0200, "ivan" <wolfsafety@xxxxxxxxxxxxx>
wrote:

I am very tight on time here. I have lots of long moltiplications to do in e
very short time. I needed to roughly estimate how wastefull would be a
moltiplication without a HW multiplier. But found out that the safest option
(with HW multiplier) is also the cheapest (at least using PICs).

thanks everyone for their useful inputs
ivan

--
Regards, Joerg

http://www.analogconsultants.com


Depending on the architecture, and assuming you have space for a table
of arguments, the following pseudocode can make a really fast software
multiplier:

mul(a, b)
return (sqr(a+b)-(sqr[a] + sqr[b])) >> 1

It costs a table of squares from the minimum argument value to the sum
of the two largest argument values, though, and that can eat a lot of
memory. Otherwise, it involves 3 table lookups, 2 adds, 2 subtracts
and a right shift.

--Charles
.



Relevant Pages

  • Re: sw multiply
    ... I needed to roughly estimate how wastefull would be a ... moltiplication without a HW multiplier. ... But found out that the safest ...
    (comp.arch.embedded)
  • Re: sw multiply
    ... wastefull would be a moltiplication without a HW multiplier. ... requiring 3 one byte multiplications, an add, and a shift. ... These are unsigned methods. ...
    (comp.arch.embedded)