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 Conversion Rounding Mode Hardware Resources LUT Adder Count Reduce 2 bits on LSB side: Convert sfix16_En14
tosfix14_En10
Ceiling
1 1 Convergent
1 1 Floor
0 0 Nearest
1 1 Round
1 1 Zero
1 1 Reduce 4 bits on LSB side: Convert sfix18_En14
tosfix12_En8
Ceiling
2 1 Convergent
2 1 Floor
0 0 Nearest
1 1 Round
2 1 Zero
2 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_En14
tosfix34_En14
33 Reduce 5 bits on MSB side: Convert sfix36_En14
tosfix31_En14
32 Reduce 6 bits on MSB side: Convert sfix36_En14
tosfix30_En14
32 Reduce 12 bits on MSB side: Convert sfix36_En14
tosfix24_En14
28 Avoid setting the Integer rounding mode parameter to
Simplest
.You can set the Integer rounding mode parameter to either
Zero
orFloor
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 toASIC/FPGA
, set the Integer rounding mode parameter toZero
.