Main Content

Decrement Stored Integer

Decrease stored integer value of signal by one

  • Decrement Stored Integer block

Libraries:
Simulink / Additional Math & Discrete / Additional Math: Increment - Decrement
HDL Coder / Math Operations

Description

The Decrement Stored Integer block decreases the stored integer value of a signal by one.

Floating-point signals also decrease by one, and overflows always wrap.

Examples

expand all

This example shows how to increase and decrease the stored integer value of a signal by one.

  • The Increment Stored Integer block increases the stored integer value of the input signal by one.

  • The Decrement Stored Integer block decreases the stored integer value of the input signal by one.

If you change the value of the input signal to 127 (the maximum value representable by an int8 data type), incrementing the stored integer value by one causes an overflow. Because overflows in the Increment and Decrement Stored Integer blocks always wrap, the Increment Stored Integer block will output a value of -128.

Ports

Input

expand all

Input signal, specified as a scalar, vector, or matrix.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Output

expand all

Output is the stored integer value of the input signal decreased by one. Floating-point signals also decrease by one, and overflows always wrap. The output has the same data type and dimensions as the input.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Block Characteristics

Data Types

double | fixed point | integer | single

Direct Feedthrough

yes

Multidimensional Signals

no

Variable-Size Signals

yes

Zero-Crossing Detection

no

Extended Capabilities

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a