![Infineon Technologies TC1784 Скачать руководство пользователя страница 814](http://html.mh-extra.com/html/infineon-technologies/tc1784/tc1784_user-manual_2055446814.webp)
TC1784
Peripheral Control Processor (PCP)
User´s Manual
10-149
V1.1, 2011-05
PCP, V2.09
Note: When using this scheme, each channel program must ensure prior to channel exit
that the R6.CPPN field contains the appropriate value, so that when the channel
is next invoked, it will run at the correct priority.
10.21.4
Implementing Divide Algorithms
, a divide algorithm
must
always start with a DINIT
instruction followed by a number of DSTEP instructions (up to four depending on the
data width that is required). Prior to execution of any DSTEP instruction, R0 always
contains either 0 (if this is the first DSTEP instruction in a divide sequence R0 contains
0 due to the preceding DINIT instruction, or the remainder from the previous DSTEP
instruction). The dividend to be used in this step is generated in R0 by taking 256
×
the
remainder of the last DSTEP instruction (R0 << 8) and adding the most significant byte
of Rb (Rb >> 24) as the LSB of the new dividend.
Since the remainder of the last DSTEP instruction is by definition always less than the
divisor (Ra), it can be guaranteed that the result of the division of the dividend (calculated
as above) by the divisor (Ra) can always be contained within an 8-bit result. The
description given on
only holds true under this condition. If the restrictions on
the use of the DSTEP instruction (specified on
) are adhered to, the above
condition will always be met and this description of the instruction is correct. Failure to
adhere to these conditions will lead to invalid results, which are outside the scope of this
document.
During execution of a divide sequence, Rb is used both to compile the final divide result
and to hold the remnants of the original dividend. For example, in a 32-/32-bit divide
sequence (which consists of 4 DSTEP instructions - see below), Rb will have the
following content:
•
After the 1
st
DSTEP instruction:
The least significant 3 bytes (24 bits) of the original 32-bit dividend (held in the most
significant 3 bytes of Rb) and the most significant byte of the final result (held in the
least significant byte of Rb).
•
After the 2
nd
DSTEP instruction:
The least significant 2 bytes (16 bits) of the original 32-bit dividend (held in the most
significant 2 bytes of Rb) and the most significant 2 bytes of the final result (held in
the least significant 2 bytes of Rb).
•
After the 3
rd
DSTEP instruction:
The least significant byte of the original 32-bit dividend (held in the most significant
byte of Rb) and the most significant 3 bytes of the final result (held in the least
significant 3 bytes of Rb).
•
After the final DSTEP instruction:
The 32 bit final result.
Note that the DSTEP instruction
always
uses the divisor as a 32 bit value. In any divide
sequence, the dividend can be 8, 16, 24 or 32 bits (according to the number of DSTEP
Содержание TC1784
Страница 1: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 3: ...User s Manual V1 1 2011 05 Microcontrollers TC1784 32 Bit Single Chip Microcontroller ...
Страница 950: ...TC1784 Direct Memory Access Controller DMA User s Manual 11 132 V1 1 2011 05 DMA V3 03 ...
Страница 1949: ...TC1784 General Purpose Timer Array GPTA v5 User s Manual 21 297 V1 1 2011 05 GPTA v5 V1 14 ...
Страница 2350: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG Doc_Number ...