English
Language : 

PIC17C4X Datasheet, PDF (49/240 Pages) Microchip Technology – High-Performance 8-Bit CMOS EPROM/ROM Microcontroller
PIC17C4X
8.0 HARDWARE MULTIPLIER
All PIC17C4X devices except the PIC17C42, have an
8 x 8 hardware multiplier included in the ALU of the
device. By making the multiply a hardware operation, it
completes in a single instruction cycle. This is an
unsigned multiply that gives a 16-bit result. The result
is stored into the 16-bit PRODuct register
(PRODH:PRODL). The multiplier does not affect any
flags in the ALUSTA register.
Making the 8 x 8 multiplier execute in a single cycle
gives the following advantages:
• Higher computational throughput
• Reduces code size requirements for multiply
algorithms
The performance increase allows the device to be used
in applications previously reserved for Digital Signal
Processors.
Table 8-1 shows a performance comparison between
the PIC17C42 and all other PIC17CXX devices, which
have the single cycle hardware multiply.
Example 8-1 shows the sequence to do an 8 x 8
unsigned multiply. Only one instruction is required
when one argument of the multiply is already loaded in
the WREG register.
Example 8-2 shows the sequence to do an 8 x 8 signed
multiply. To account for the sign bits of the arguments,
each argument’s most significant bit (MSb) is tested
and the appropriate subtractions are done.
EXAMPLE 8-1: 8 x 8 MULTIPLY ROUTINE
MOVFP
MULWF
ARG1, WREG
ARG2
; ARG1 * ARG2 ->
; PRODH:PRODL
EXAMPLE 8-2: 8 x 8 SIGNED MULTIPLY
ROUTINE
MOVFP
MULWF
BTFSC
SUBWF
MOVFP
BTFSC
SUBWF
ARG1, WREG
ARG2
ARG2, SB
PRODH, F
ARG2, WREG
ARG1, SB
PRODH, F
; ARG1 * ARG2 ->
; PRODH:PRODL
; Test Sign Bit
; PRODH = PRODH
;
- ARG1
; Test Sign Bit
; PRODH = PRODH
;
- ARG2
TABLE 8-1: PERFORMANCE COMPARISON
Routine
Device
8 x 8 unsigned
8 x 8 signed
16 x 16 unsigned
16 x 16 signed
PIC17C42
All other PIC17CXX devices
PIC17C42
All other PIC17CXX devices
PIC17C42
All other PIC17CXX devices
PIC17C42
All other PIC17CXX devices
Program Memory
(Words)
13
1
—
6
21
24
52
36
Cycles (Max)
69
1
—
6
242
24
254
36
Time
@ 25 MHz
11.04 µs
160 ns
—
960 ns
38.72 µs
3.84 µs
40.64 µs
5.76 µs
@ 33 MHz
N/A
121 ns
N/A
727 ns
N/A
2.91 µs
N/A
4.36 µs
© 1996 Microchip Technology Inc.
This document was created with FrameMaker 4 0 4
DS30412C-page 49