dsPIC30F6011/6012/6013/6014
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.
2.
3.
4.
5.
DIVF
- 16/16 signed fractional divide
DIV.sd
- 32/16 signed divide
DIV.ud
- 32/16 unsigned divide
DIV.sw
- 16/16 signed divide
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
instruc-
tion as shown in Table 2-1 (REPEAT will execute the tar-
get instruction {operand value+1} times). The REPEAT
loop count must be setup for 18 iterations of the
DIV/
DIVF
instruction. Thus, a complete divide operation
requires 19 cycles.
Note:
The divide flow is interruptible. However,
the user needs to save the context as
appropriate.
The 16/16 divides are similar to the 32/16 (same number
of iterations), but the dividend is either zero-extended or
sign-extended during the first iteration.
TABLE 2-1:
Instruction
DIVF
DIV.sd
DIV.sw or
DIV.s
DIV.ud
DIV.uw or
DIV.u
DIVIDE INSTRUCTIONS
Function
Signed fractional divide: Wm/Wn
鈫?/div>
W0; Rem
鈫?/div>
W1
Signed divide: (Wm+1:Wm)/Wn
鈫?/div>
W0; Rem
鈫?/div>
W1
Signed divide: Wm/Wn
鈫?/div>
W0; Rem
鈫?/div>
W1
Unsigned divide: (Wm+1:Wm)/Wn
鈫?/div>
W0; Rem
鈫?/div>
W1
Unsigned divide: Wm/Wn
鈫?/div>
W0; Rem
鈫?/div>
W1
DS70117C-page 16
Preliminary
铮?/div>
2004 Microchip Technology Inc.
prev
next
DSPIC30F6011AT-20E/PF相关型号PDF文件下载
-
型号
版本
描述
厂商
下载
-
英文版
Serial Peripheral Interface - Master/Slave
DCD
-
英文版
Serial Peripheral Interface - Slave
DCD
-
英文版
Flash Programming Specification
-
英文版
Flash Programming Specification
MICROCHIP ...
-
英文版
dsPIC High-Performance 16-bit Digital Signal Controller Fami...
-
英文版
dsPIC High-Performance 16-bit Digital Signal Controller Fami...
MICROCHIP ...
-
英文版
High-Performance, 16-bit Digital Signal Controllers
-
英文版
Serial Peripheral Interface Master/Slave with FIFO
DCD [Digit...
-
英文版
28/44-Pin High-Performance Switch Mode Power Supply Digital ...
-
英文版
28/44-Pin High-Performance Switch Mode Power Supply Digital ...
MICROCHIP ...
-
英文版
-
英文版
High-Performance Digital Signal Controllers
-
英文版
High-Performance Digital Signal Controllers
-
英文版
High-Performance Digital Signal Controllers
MICROCHIP ...
-
英文版
High-Performance Digital Signal Controllers
-
英文版
High-Performance Digital Signal Controllers
MICROCHIP ...
-
英文版
28/44-Pin High-Performance Switch Mode Power Supply Digital ...
-
英文版
-
英文版
44-Pin High-Performance Switch Mode Power Supply Digital Sig...
-
英文版
44-Pin High-Performance Switch Mode Power Supply Digital Sig...