Table Of Contents

Numeric Coercion in the Fixed-Point Data Type

Last Modified: September 26, 2017

In the fixed-point data type, coercion is the forcing of a set of bits to meet the restrictions of a particular fixed-point data type configuration. Configuring the coercion behaviors of fixed-point operators allows you to control data loss within your code. The results of those operations can often be greater than the maximum value, less than the minimum value, or more precise than the delta for the specified configuration. Whenever a value does not exactly match a representable value in a particular fixed-point configuration, The value is coerced to match a representable value.

By default, the output of an operator auto-adapts to the data type of the input. Bits are added to your fixed-point configurations and the word length of the output values of operations are adjusted to retain as much data as possible. However, data loss is unavoidable if the word length required to represent the output value exceeds the maximum you specify or the maximum total word length of 64 bits.

For any operator, you can configure the Precision, Overflow, and Rounding to prevent the output of the operator from auto-adapting to the input type and strategically control data loss within your code. The logic to support that configuration is automatically added to the code that compiles to your FPGA. Determining the methods of coercion that best match the needs of your specific application is an important step in using the fixed-point data type effectively. Setting coercion strategies allows you to control data loss in your operators and prevent the word lengths of the fixed-point operators in your code from growing unboundedly.

You set coercion behaviors in the Terminals section of the Item tab when you select an operator on the diagram. You can only specify fixed-point coercion behaviors when configuring operators.


The logic to support coercion consumes FPGA resources when implemented on hardware.

Recently Viewed Topics