ST STM32G4 Series Reference Manual page 478

Advanced arm-based 32-bit mcus
Hide thumbs Also See for STM32G4 Series:
Table of Contents

Advertisement

CORDIC co-processor (CORDIC)
Function
Sinh, Cosh,
Atanh, Ln
Sqrt
1. Max residual error is the maximum error remaining after the given number of iterations, compared to the
identical calculation performed in double precision floating point. An additional rounding error may be
incurred, of up to 2
2. For modulus > 0.5. The achievable precision reduces proportionally to the magnitude of the modulus, as
quantization error becomes significant.
3. SCALE = 1. If a higher scaling factor is used, the achievable precision is reduced proportionally.
4. SCALE = 0. If a higher scaling factor is used, the achievable precision is reduced proportionally.
17.3.6
Zero-overhead mode
The fastest way to use the co-processor is to pre-program the CORDIC_CSR register with
the function to be performed (FUNC), the desired number of clock cycles (PRECISION), the
size of the input and output values (ARGSIZE, RESSIZE), the number of input arguments
(NARGS) and/or results (NRES), and the scaling factor (SCALE), if applicable.
Subsequently, a calculation is triggered by writing the input arguments to the
CORDIC_WDATA register. As soon as the correct number of input arguments has been
written (and any ongoing calculation has finished) a new calculation is launched using these
input arguments and the current CORDIC_CSR settings. There is no need to re-program
the CORDIC_CSR register if there is no change.
If a dual 32-bit input argument is needed (ARGSIZE = 0, NARGS = 1), the primary input
argument, ARG1, must be written first, followed by the secondary argument, ARG2. If the
secondary argument remains unchanged for a series of calculations, the second write can
be avoided, by reprogramming the number of arguments to one (NARGS = 0), once the first
calculation has started. The secondary argument retains its programmed value as long as
the function is not changed.
Note:
ARG2 is set to +1 (0x7FFFFFFF) after a reset.
If two 16-bit arguments are used (ARGSIZE = 1) they must be packed into a 32-bit word,
with ARG1 in the least significant half-word and ARG2 in the most significant half-word. The
packed 32-bit word is then written to the CORDIC_WDATA register. Only one write is
needed in this case (NARGS = 0).
For functions which take only one input argument, ARG1, it is recommended to set
NARGS = 0. If NARGS = 1, a second write to CORDIC_WDATA must be performed to
trigger the calculation. The ARG2 data in this case is not used.
478/2126
Table 115. Precision vs. number of iterations (continued)
Number of
iterations
4
8
12
(3)
16
20
24
4
(4)
8
12
-16
for q15 format or 2
Number of
cycles
1
2
3
4
5
6
1
2
3
-20
for q31 format.
RM0440 Rev 4
RM0440
Max residual error
q1.31 format
q1.15 format
-2
-2
2
2
-6
-6
2
2
-10
-10
2
2
-13
-13
2
2
-17
-15
2
2
-18
-15
2
2
-7
-7
2
2
-14
-14
2
2
-19
-15
2
2
(1)

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the STM32G4 Series and is the answer not in the manual?

Table of Contents

Save PDF