
GD32F403xx User Manual
201
Summation units can produce up to
20 bits (256 x 12-bit), which is first shifted right. The upper
bits of the result are then truncated, keeping only the 16 least significant bits rounded to the
nearest value using the least significant bits left apart by the shifting, before being finally
transferred into the data register.
Figure 12-9. 20-bit to 16-bit result truncation
Raw 20-bit data
19
15
11
7
3
0
15
11
7
3
0
Shifting
Truncation and
rounding
Note:
If the intermediate result after the shifting exceeds 16 bits, the upper bits of the result
are simply truncated.
Figure 12-10. Numerical example with 5-bits shift and rounding
shows a numerical
example of the processing, from a raw 20-bit accumulated data to the final 16-bit result.
Figure 12-10. Numerical example with 5-bits shift and rounding
2
A
C
D
6
Raw 20-bit data
19
15
11
7
3
0
1
5
6
6
15
11
7
3
0
Final result after 5-bit shift and rounding
to nearest
The
Table 12-6. Maximum output results vs N and M Grayed values indicates truncation
below gives the data format for the various N and M combination, for a raw conversion data
equal to 0xFFF.
Table 12-6. Maximum output results vs N and M Grayed values indicates truncation
Oversa
Max
No-shift
1-bit
2-bit
3-bit
4-bit
5-bit
6-bit
7-bit
8-bit