Science Zero
[ Science ] [ Electronics ] [ Experiments ] [ Computing ] [ About us ] [ Links ]
Low-end microcontrollers from Microchip do not have a multiplication instruction so
any multiplication needs to be done using software or external hardware. This is a
collection of 8 by 8 bit multiplication methods that are very efficient. General (13-123 cycles, 18 instructions) A simple starting point for experimentation and is easily extendible to any word lenght. It is quite fast if a large portion of the numbers are very small. Small (67 cycles constant, 11 instructions) This one is for saving precious code memory and still have good speed. The principle of this method comes from the Microchip application note 526 but has been optimised for minimum size and maximum speed by Bjørn Bæverfjord. Medium (36 cycles constant, 36 instructions) Directly from Microchip application note 526. Fast (22-36 cycles, 51 instructions) The fastest software solution I could find. Lifted from the PIClist. Hardware (2-12 cycles) How to read a 128kB look up table in EPROM using only 10 I/O pins and still have good performance. A larger PIC with more I/O pins will give higher performance since the data bus can be split and made unidirectional. ;General - 13-123 cycles, 18
instructions ;Small - 67 cycles constant, 11
instructions ;Medium - 36 cycles constant, 36
instructions ;Fast - 22-36 cycles, 51 instructions Hardware for efficient table look up on a 16F84A microcontroller. The value of R1 must be selected to give a pulse from the EOR gate that is shorter than the instruction cycle of the PIC and longer than the minimum requirements for the specific latch used. |