RNDSYM(arg) - 1.0 English

DSP Macro LogiCORE IP Product Guide (PG323)

Document ID
PG323
Release Date
2021-01-25
Version
1.0 English
RNDSYM implements a symmetric round to highest magnitude; this is equivalent to the MATLAB function round(arg).
Table 1. Illustration of RNDSYM Return Values
arg RNDSYM(arg)
<x.5 x
x.5 x+1
>x.5 x+1
>-x.5 -x
-x.5 -x-1
<-x.5 -x-1

The binary point of arg is defined in the same manner as for the RNDSIMPLE(arg) function.

A rounding constant with a binary value of 0.0111.... (or 0.499...) is added to argalong with a carryin, defined as the inverse sign bit of arg. The LSBs are removed by the process of reinterpreting the full precision output to the specified core output width. The LSBs remain on the accumulator. For multiply operations, the XNOR of the multiplier inputs is used instead of the inverse sign bit of arg, performing multiply rounding toward infinity.

When carryin is 1, this is equivalent to adding 0.00....01. This modifies the rounding constant to 0.100.. (or 0.5) and therefore the rounding direction.