TC1784
Peripheral Control Processor (PCP)
User´s Manual
10-100
V1.1, 2011-05
PCP, V2.09
10.18.4
Divide and Multiply Instructions
The PCP has Multiply and Divide capabilities (unsigned values only). All Multiply and
divide instructions operate on 8 bits of data (taken from the dividend for divide, from the
multiplicand for multiply). This strategy allows the user to implement the appropriate
number of instructions (“steps”) as required for the user’s data format.
Each execution of a divide instruction (DSTEP) performs a division which generates
8 bits of result, and also manipulates the registers being used to allow the execution of
consecutive divide (DSTEP) instructions to build divide algorithms in multiples of 8 bits
(see
for more details).
Each execution of a multiply instruction (MSTEP32 and MSTEP64) performs a
multiplication on 8 bits of data (taken from the multiplicand) and also manipulates the
registers to allow execution of consecutive multiply instructions to build multiply
algorithms in multiples of 8 bits (see
for more details).
The following restrictions apply to the use of Divide and Multiply instructions:
•
The first instruction of any divide sequence must be the DINIT (initialization)
instruction. Any additional instructions other than MINIT, MSTEP32 or MSTEP64
may also be used within the sequence as long as they do not modify any of the
registers used for division (R0, Ra and Rb). All subsequent divide instructions within
the sequence (DSTEP) must use the same register for dividend and the same
register for divisor as used in the preceding DINIT instruction.
•
The first instruction of any multiply sequence must be the MINIT (initialization)
instruction. Any additional instructions other than DINIT or DSTEP may also be used
within the sequence as long as they do not modify any of the registers used for
multiplication (R0, Ra and Rb). All subsequent multiply instructions within the
sequence (MSTEP32 and MSTEP64) must use the same register for multiplicand
and the same register for multiplier as used in the preceding MINIT instruction.
•
Neither of the operand registers (Ra or Rb) may be R0 (which is used implicitly within
all the instructions), and the same register may not be supplied as both operand
registers of an instruction (e.g. DSTEP R3, R3 is invalid).
Note: Failure to adhere to these restrictions will yield undefined results.
1. Special care must be taken when using multiply and divide sequences when a
channel program is interruptible. In this case it must be ensured that a sequence
cannot be corrupted by the execution of multiply or divide instructions executed by a
higher-priority channel. The R7.IEN bit can be used to ensure that a sequence is not
interruptible (see
In the descriptions attached to each multiply and divide instruction, a pseudo-code model
is supplied to provide an unambiguous definition of the function of the instruction. The
models supplied for the DSTEP and MSTEP32 instructions use 32 bit unsigned integer
arithmetic, ignoring any possible overflows. The model supplied for the MSTEP64 uses
Summary of Contents for TC1784
Page 1: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Page 3: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Page 950: ...TC1784 Direct Memory Access Controller DMA User s Manual 11 132 V1 1 2011 05 DMA V3 03 ...
Page 1949: ...TC1784 General Purpose Timer Array GPTA v5 User s Manual 21 297 V1 1 2011 05 GPTA v5 V1 14 ...
Page 2350: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG Doc_Number ...