# Symmetric

## Versal ACAP DSP Engine Architecture Manual (AM004)

Document ID
AM004
Release Date
2022-09-11
Revision
1.2.1 English

Symmetric rounding is a method of quantization that accomplishes the more desirable effect of quantizing numbers to keep them from becoming biased in the wrong direction. For example, in symmetric rounding towards infinity, the midpoint number 2.5 rounds to 3.0 and –2.5 rounds to –3.

The C port in DSP58 is used to mark the location of the decimal point. The number of continuous ones in the C port bus plus 1 indicates the number of decimal places in the original number; for example, in the case of 4 decimal places, C is 00 … 0111. C can be used for dynamic or static rounding whereas RND is used for static rounding only. The sign bit determines the symmetric rounding towards infinity or zero. For rounding toward infinity, the midpoint negative and positive numbers are both rounded away from zero. For example, 2.5 rounds to 3 and –2.5 rounds to –3. Note that CARRYINSEL can select internal signals to implement the complemented sign bit and to avoid using CARRYIN and programmable logic. In case of rounding toward zero, positive and negative numbers at the midpoint are rounded towards zero. For example, 2.5 rounds to 2 and –2.5 rounds to –2. The following tables show examples of symmetric rounding.

Table 1. Round to Zero (Decimal Place = 4)
Multiplier Output C Sign Bit Output = Multiplier Out + C + Sign Bit
`0010.1000` (2.5) `0000.0111` `0` `0010.1111` (2 after truncation)
`1101.1000` (–2.5) `0000.0111` `1` `1110.0000` (–2 after truncation)
`0011.1000` (3.5) `0000.0111` `0` `0011.1111` (3 after truncation)
Table 2. Round to Infinity (Decimal Place = 4)
Multiplier Output C Sign Bit Complement Output = Multiplier Out + C + Sign Bit Complement
`0010.1000` (2.5) `0000.0111` `1` `0011.1111` (3 after truncation)
`1101.1000` (–2.5) `0000.0111` `0` `1101.1111` (–3 after truncation)
`0011.1000` (3.5) `0000.0111` `1` `0100.0000` (4 after truncation)