-
4x4 bit from John Payson, Ray Gardiner, Dmitry Kiryashov
(12 cycles/ 12 instructions)
-
8x8 bit from
Andrew Warren (10 or 35
instructions, 38 cycles)
-
8x8 bit from unknown author (please step forward)
(35 instructions, 37 cycles)
-
8x8 bit from Scott
Dattalo with small correction by Dmitry Kiryashov (52 instructions, 24-36
cycles, 34 avg)
-
16x8 bit from Dingbat
-
16x8 bit from Martin Sturm (18
instructions, 84-124 cycles, 104 avg)
-
16x8 bit from Martin Sturm (69
instructions, 69 cycles)
-
10x10 bit from Martin Sturm (73 instructions, 57-73
cycles, 65 avg)
-
14x10 bit from Martin Sturm (83 instructions, 71-83 cycles,
77 avg)
-
12x12 bit from Martin Sturm (92 instructions, 92 cycles)
-
16x16 bit
from Martin Sturm (140 instructions, 140 cycles)
-
16x16 bit from
Jim Bixby Unsigned, fast
(16x16 mpy in 164 instructions ~168 cycles):
-
16x16 bit macro from Bob Fehrenbach,
Scott Dattalo (22 instructions, 215
to 295 cycles)
-
16x16 bit From Clyde Smith-Stubbs of
HI-TECH software (21 instructions, <
289 cycles)
-
16x16 bit from malin. Unsigned (32 instructions,
128 to 229 cycles)
-
16x16 bit from malin. Signed. (64 instructions,
134 to 248 cycles)
-
16x16 bit from Ravi Pailoor Signed or Unsigned
(240 instructions, < 282 cycles)
-
24x8 bit from Byron A Jeff
-
24x24 bit from
Nikolai Golovchenko
-
24x24 bit from Fred Maher with Tutorial
-
32x16 bit from anonymous
-
32x16 bit from VegiPete for 18F
-
32-bit signed integer math routines. add, subtract, multiply,
divide, round, sqrt, bin2dec, dec2bin. By Peter Hemsley.
-
Tutorial1 Logic based
-
Tutorial2 Math based
-
Russian Peasent Multiplication
and Exponentiation
-
Novel Methods of Integer Multiplication
and Division
-
Multiplication and/or Division by a Constant
-
(8 bits * 256) / 8 bits by
Nikolai Golovchenko
-
See also:
Archive:
Interested:
See:
Code:
See also:
-
http://www.reenigne.org/blog/multiplying-faster-with-squares/
(a+b)2 = a2 + b2 + 2ab and
(a-b)2 = a2 + b2 - 2ab and subtracting
these gives: 4ab = (a+b)2 - (a-b)2 or ab
= (a+b)2/4 - (a-b)2/4. So if we keep in memory
a table of x2/4 we can do a multiply with an add, two subtractions
and two table lookups. The tables have a+b number of entries rather than
a*b, but must hold values as large as a*b if the full range of possible output
is to be supported.
Questions: