Skip to content

FixPt Unary Minus

Negate the input.

Description

The FixPt Unary Minus block is a masked S-function that negates the input. The block accepts only signed data types.

For signed data types, you cannot accurately negate the most negative value since the result 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 most negative value of the data type wraps to the most positive value. If not checked, the operation has no effect. If an overflow occurs, then a warning is returned to the MATLAB command line.

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 negation of -128 is not representable. If the Saturate to max or min when overflows occur check box is checked, then the negation of -128 is 127. If it is not checked, then the negation of -128 remains at -128.

Dialog Box Parameters

  • 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 (a nonzero bias is negated offline)
Direct Feedthrough No
Sample Time Discrete or continuous
Scalar Expansion Of inputs or initial conditions
States As many as there are outputs
Vectorized Yes