Guidelines for Using Rounding and Saturation Settings for Fixed-Point Data Types
This guideline describes the design considerations when using rounding modes and saturate-on-integer overflow settings for fixed-point data types.
Each guideline has a severity level that indicates the level of compliance requirements. To learn more, see HDL Modeling Guidelines Severity Levels.
Guideline ID
2.10.6
Severity
Recommended
Description
When you use fixed-point data types in your design for HDL code generation, select the appropriate rounding mode and saturate-on-integer setting. Using the rounding or saturation settings may require additional circuits for computation and consume more hardware resources.
When you use blocks that have Integer rounding mode or Saturate on integer overflow parameters and use fixed-point data types, follow these considerations:
Setting Integer rounding mode parameter to a setting other than
Floorconsumes more lookup tables (LUTs) and requires an additional adder operation. The table shows the LUT and adder count for different rounding modes when performing data type conversion for fixed-point data types. When you want to reduce the number of bits on least-significant bit (LSB) side, the generated code and hardware resources depend on the rounding mode setting.Fixed-point Data Type Conversion Rounding Mode Hardware Resources LUT Adder Count Reduce 2 bits on LSB side: Convert sfix16_En14tosfix14_En10Ceiling1 1 Convergent1 1 Floor0 0 Nearest1 1 Round1 1 Zero1 1 Reduce 4 bits on LSB side: Convert sfix18_En14tosfix12_En8Ceiling2 1 Convergent2 1 Floor0 0 Nearest1 1 Round2 1 Zero2 1 When you reduce the bits on most-significant bit (MSB) side, the generated code and hardware resources vary depending on the Saturate on integer overflow setting. If you enable Saturate on integer overflow, the block consumes more LUTs. The table shows the consumption of LUTs when you enable the Saturate on integer overflow.
Fixed-point Data Type Conversion LUT Reduce 2 bits on MSB side: Convert sfix36_En14tosfix34_En1433 Reduce 5 bits on MSB side: Convert sfix36_En14tosfix31_En1432 Reduce 6 bits on MSB side: Convert sfix36_En14tosfix30_En1432 Reduce 12 bits on MSB side: Convert sfix36_En14tosfix24_En1428 Avoid setting the Integer rounding mode parameter to
Simplest.You can set the Integer rounding mode parameter to either
ZeroorFloordepending on the settings of the Device vendor or Signed integer division rounds to model configuration parameters in the Configuration Parameter dialog. When you set Device vendor parameter toASIC/FPGA, set the Integer rounding mode parameter toZero.