dsPIC30F6010
DS70119B-page 14
Advance Information
2004 Microchip Technology Inc.
2.3
Divide Support
The dsPIC devices feature a 16/16-bit signed fractional
divide operation, as well as 32/16-bit and 16/16-bit
signed and unsigned integer divide operations, in the
form of single instruction iterative divides. The following
instructions and data sizes are supported:
1.
DIVF
– 16/16 signed fractional divide
2.
DIV.sd
– 32/16 signed divide
3.
DIV.ud
– 32/16 unsigned divide
4.
DIV.sw
– 16/16 signed divide
5.
DIV.uw
– 16/16 unsigned divide
The divide instructions must be executed within a
REPEAT loop. Any other form of execution (e.g. a series
of discrete divide instructions) will not function correctly
because the instruction flow depends on RCOUNT. The
divide instruction does not automatically set up the
RCOUNT value, and it must, therefore, be explicitly and
correctly specified in the
REPEAT
instruction, as shown
REPEAT
will execute the target instruction
{operand value+1} times). The REPEAT loop count must
be set up for 18 iterations of the
DIV/DIVF
instruction.
Thus, a complete divide operation requires 19 cycles.
TABLE 2-1:
DIVIDE INSTRUCTIONS
2.4
DSP Engine
The DSP engine consists of a high speed 17-bit x
17-bit multiplier, a barrel shifter, and a 40-bit adder/
Subtractor (with two target accumulators, round and
saturation logic).
The dsPIC30F devices have a single instruction flow
which can execute either DSP or MCU instructions.
Many of the hardware resources are shared between
the DSP and MCU instructions. For example, the
instruction set has both DSP and MCU Multiply
instructions which use the same hardware multiplier.
The DSP engine also has the capability to perform inher-
ent accumulator-to-accumulator operations, which
require no additional data. These instructions are
ADD,
SUB
and
NEG
.
The DSP engine has various options selected through
various bits in the CPU Core Configuration Register
(CORCON), as listed below:
1.
Fractional or integer DSP multiply (IF).
2.
Signed or unsigned DSP multiply (US).
3.
Conventional or convergent rounding (RND).
4.
Automatic saturation on/off for AccA (SATA).
5.
Automatic saturation on/off for AccB (SATB).
6.
Automatic saturation on/off for writes to data
memory (SATDW).
7.
Accumulator Saturation mode selection
(ACCSAT).
A block diagram of the DSP engine is shown in
Figure 2-2.
Note:
The Divide flow is interruptible. However,
the user needs to save the context as
appropriate.
Instruction
Function
DIVF
Signed fractional divide: Wm/Wn
→
W0; Rem
→
W1
DIV.sd
Signed divide: (Wm+1:Wm)/Wn
→
W0; Rem
→
W1
DIV.sw (or DIV.s)
Signed divide: Wm/Wn
→
W0; Rem
→
W1
DIV.ud
Unsigned divide: (Wm+1:Wm)/Wn
→
W0; Rem
→
W1
DIV.uw (or DIV.u)
Unsigned divide: Wm/Wn
→
W0; Rem
→
W1
Note:
For CORCON layout, see Table 4-2.
TABLE 2-2:
DSP INSTRUCTION
SUMMARY
Instruction
Algebraic Operation
CLR
A = 0
ED
A = (x – y)
2
EDAC
A = A + (x – y)
2
MAC
A = A + (x * y)
MOVSAC
No change in A
MPY
A = x * y
MPY.N
A = – x * y
MSC
A = A – x * y
Содержание dsPIC30F6010
Страница 12: ...dsPIC30F6010 DS70119B page 10 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 32: ...dsPIC30F6010 DS70119B page 30 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 38: ...dsPIC30F6010 DS70119B page 36 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 50: ...dsPIC30F6010 DS70119B page 48 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 68: ...dsPIC30F6010 DS70119B page 66 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 72: ...dsPIC30F6010 DS70119B page 70 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 76: ...dsPIC30F6010 DS70119B page 74 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 86: ...dsPIC30F6010 DS70119B page 84 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 108: ...dsPIC30F6010 DS70119B page 106 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 116: ...dsPIC30F6010 DS70119B page 114 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 128: ...dsPIC30F6010 DS70119B page 126 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 150: ...dsPIC30F6010 DS70119B page 148 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 164: ...dsPIC30F6010 DS70119B page 162 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 208: ...dsPIC30F6010 DS70119B page 206 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 220: ...dsPIC30F6010 DS70119B page 220 Advance Information 2004 Microchip Technology Inc NOTES...
Страница 221: ...2004 Microchip Technology Inc Advance Information DS70119B page 221 dsPIC30F6010 NOTES...