RNDSIMPLE(arg) - 1.0 English

DSP Macro LogiCORE IP Product Guide (PG323)

Document ID
PG323
Release Date
2021-01-25
Version
1.0 English
RNDSIMPLE implements a non-symmetric round to negative; this is equivalent to the MATLABĀ® function ceil(arg-0.5).
Table 1. Illustration of RNDSIMPLE Return Values
arg RNDSIMPLE(arg)
<x.5 x
x.5 x
>x.5 x+1
>-x.5 -x
-x.5 -x-1
<-x.5 -x-1

The binary point of arg is defined by the full precision output width and the specified core output width; the core output is taken from the upper MSBs of the DSP Slice output with the remaining LSBs considered as the fractional portion. The binary point is taken as full precision p_width - p_width.

A rounding constant with a binary value of 0.0111...(or 0.499...) is added to arg and the LSBs removed by the process of reinterpreting the full precision output to the specified core output width. The LSBs remain on the accumulator.

Arg can include CARRYIN. This enables CARRYIN to determine the rounding direction. The assertion of CARRYIN is equivalent to adding 0.00...01. This modifies the rounding constant to 0.100.. (or 0.5) and therefore the rounding direction. This can be used to implement random rounding.