Skip to content

FixPt Absolute Value

Output the absolute value of the input.

Description

The FixPt Absolute Value block is a masked S-function that outputs the absolute value of the input.

For signed data types, the absolute value of the most negative value is problematic since it is not representable by the data type. In this case, the behavior of the block is controlled by the Saturate to max or min when overflows occur check box. If checked, the absolute value of the data type saturates to the most positive value. If not checked, the absolute value of the most negative value has no effect.

For example, suppose the block input is an 8-bit signed integer. The range of this data type is from -128 to 127, and the absolute value of -128 is not representable. If the Saturate to max or min when overflows occur check box is checked, then the absolute value of -128 is 127. If it is not checked, then the absolute value of -128 remains at -128.

Dialog Box Parameters

FixPt Absolute Value

  • Saturate to max or min when overflows occur - If checked, fixed-point overflows saturate. Otherwise, they wrap.

Characteristics

Characteristic Description
Input Port Any data type supported by the blockset
Output Port Same as the input
Direct Feedthrough Yes
Sample Time Inherited from driving block
Scalar Expansion N/A
States 0
Vectorized Yes