Main Content

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 Floor consumes 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 ConversionRounding ModeHardware Resources
    LUTAdder Count
    Reduce 2 bits on LSB side: Convert sfix16_En14 to sfix14_En10Ceiling11
    Convergent11
    Floor00
    Nearest11
    Round11
    Zero11
    Reduce 4 bits on LSB side: Convert sfix18_En14 to sfix12_En8Ceiling21
    Convergent21
    Floor00
    Nearest11
    Round21
    Zero21

  • 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 ConversionLUT
    Reduce 2 bits on MSB side: Convert sfix36_En14 to sfix34_En1433
    Reduce 5 bits on MSB side: Convert sfix36_En14 to sfix31_En1432
    Reduce 6 bits on MSB side: Convert sfix36_En14 to sfix30_En1432
    Reduce 12 bits on MSB side: Convert sfix36_En14 to sfix24_En1428

  • Avoid setting the Integer rounding mode parameter to Simplest.

  • You can set the Integer rounding mode parameter to either Zero or Floor depending 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 to ASIC/FPGA, set the Integer rounding mode parameter to Zero.

Related Topics