dsPIC30F Family Reference Manual
DS70049C-page 2-22 © 2004 Microchip Technology Inc.
Table 2-2: dsPIC30F Data Ranges
2.6.2.1 DSP Multiply Instructions
The DSP instructions that utilize the multiplier are summarized in Table 2-3.
Table 2-3: DSP Instructions that Utilize the Multiplier
The US control bit (CORCON<12>) determines whether DSP multiply instructions are signed
(default) or unsigned. The US bit does not influence the MCU multiply instructions which have
specific instructions for signed or unsigned operation. If the US bit is set, the input operands for
instructions shown in Table 2-3 are considered as unsigned values which are always
zero-extended into the 17th bit of the multiplier value.
2.6.2.2 MCU Multiply Instructions
The same multiplier is used to support the MCU multiply instructions, which include integer 16-bit
signed, unsigned and mixed sign multiplies as shown in Table 2-4. All multiplications performed
by the MUL instruction produce integer results. The MUL instruction may be directed to use byte
or word sized operands. Byte input operands will produce a 16-bit result and word input operands
will produce a 32-bit result to the specified register(s) in the W array.
Table 2-4: MCU Instructions that Utilize the Multiplier
Register
Size
Integer Range Fraction Range
Fraction
Resolution
16-bit -32768 to
32767
-1.0 to (1.0 – 2
-15
)
(Q.15 Format)
3.052 x 10
-5
32-bit -2,147,483,648 to
2,147,483,647
-1.0 to (1.0 – 2
-31
)
(Q.31 Format)
4.657 x 10
-10
40-bit -549,755,813,888 to
549,755,813,887
-256.0 to (256.0 – 2
-31
)
(Q.31 Format with 8 Guard bits)
4.657 x 10
-10
DSP Instruction Description Algebraic Equivalent
MAC Multiply and Add to Accumulator OR
Square and Add to Accumulator
a = a + b*c
a = a + b
2
MSC Multiply and Subtract from Accumulator a = a – b*c
MPY Multiply a = b*c
MPY.N Multiply and Negate Result a = -b*c
ED Partial Euclidean Distance
a = (b – c)
2
EDAC Add Partial Euclidean Distance to the
Accumulator
a = a + (b – c)
2
Note: DSP instructions using the multiplier can operate in Fractional (1.15) or Integer
modes.
MCU Instruction Description
MUL/MUL.UU Multiply two unsigned integers
MUL.SS Multiply two signed integers
MUL.SU/MUL.US Multiply a signed integer with an unsigned integer
Note 1: MCU instructions using the multiplier operate only in Integer mode.
2: Result of an MCU multiply is 32-bits long and is stored in a pair of W registers.