English
Language : 

PIC24FJ128GA Datasheet, PDF (26/232 Pages) Microchip Technology – General Purpose, 16-Bit Flash Microcontrollers
PIC24FJ128GA FAMILY
2.3.2 DIVIDER
The divide block supports 32-bit/16-bit and 16-bit/16-bit
signed and unsigned integer divide operation with the
following data sizes:
1. 32-bit signed/16-bit signed divide
2. 32-bit unsigned/16-bit unsigned divide
3. 16-bit signed/16-bit signed divide
4. 16-bit unsigned/16-bit unsigned divide
The quotient for all divide instructions ends up in W0
and the remainder in W1. 16-bit signed and unsigned
DIV instructions can specify any W register for both the
16-bit divisor (Wn) and any W register (aligned) pair
(W(m+1):Wm) for the 32-bit dividend. The divide algo-
rithm takes one cycle per bit of divisor, so both
32-bit/16-bit and 16-bit/16-bit instructions take the
same number of cycles to execute.
2.3.3 MULTI-BIT SHIFT SUPPORT
The PIC24 ALU supports both single-bit and
single-cycle, multi-bit arithmetic and logic shifts.
Multi-bit shifts are implemented using a shifter block,
capable of performing up to a 15-bit arithmetic right
shift, or up to a 15-bit left shift, in a single cycle. All
multi-bit shift instructions only support register direct
addressing for both the operand source and result
destination.
A full summary of instructions that use the shift
operation is provided below in Table 2-2.
TABLE 2-2: INSTRUCTIONS THAT USE THE SINGLE AND MULTI-BIT SHIFT OPERATION
Instruction
Description
ASR
ASRF
ASRW
ASRK
SL
SLF
SLW
SLK
LSR
LSRF
LSRW
LSRK
Arithmetic shift right source register by one bit.
Arithmetic shift right the content of the register by one bit.
Arithmetic shift right source register by up to 15 bits, value held in the W register referenced
within instruction.
Arithmetic shift right source register up to 15 bits. Shift value is literal.
Shift left source register by one bit.
Shift left the content of the file register by one bit.
Shift left source register by up to 15 bits, value held in the W register referenced instruction.
Shift left source register up to 15 bits. Shift value is literal.
Logical shift right source register by one bit.
Logical shift right the content of the register by one bit.
Logical shift right source register by up to 15 bits, value held in the W register referenced
within instruction.
Logical shift right source register up to 15 bits. Shift value is literal.
DS39747C-page 24
Preliminary
© 2006 Microchip Technology Inc.