Limit input signal to dynamic upper and lower saturation values
Simulink / Discontinuities
HDL Coder / Discontinuities
The Saturation Dynamic block produces an output signal that is the value of the input signal
bounded to the saturation values from the input ports up
and
lo
.
Input  Output 

lo ≤ Input value ≤ up  Input value 
Input value < lo  Lower limit 
Input value > up  Upper limit 
u
— Input signalThe input signal to the saturation algorithm.
Data Types: double
 single
 int8
 int16
 int32
 int64
 uint8
 uint16
 uint32
 uint64
 fixed point
up
— Signal that provides the upper saturation limitDynamic value providing the upper saturation limit. When the input is greater than up then the output value is bound to up.
Data Types: double
 single
 int8
 int16
 int32
 int64
 uint8
 uint16
 uint32
 uint64
 fixed point
lo
— Signal that provides the lower saturation limitDynamic value providing the lower saturation limit. When the input is less than lo then the output value is bound to lo.
Data Types: double
 single
 int8
 int16
 int32
 int64
 uint8
 uint16
 uint32
 uint64
 fixed point
y
— Output signalOutput signal that is the value of the input signal, upper saturation limit, or lower saturation limit.
Data Types: double
 single
 int8
 int16
 int32
 int64
 uint8
 uint16
 uint32
 uint64
 fixed point
To edit the parameters for the Saturation Dynamic block, doubleclick the block icon.
Click the Show data type assistant button to display the Data Type Assistant, which helps you set the data type attributes. For more information, see Specify Data Types Using Data Type Assistant.
Output minimum
— Minimum output value for range checking[]
(default)  scalarLower value of the output range that Simulink^{®} checks.
Simulink uses the minimum to perform:
Parameter range checking (see Specify Minimum and Maximum Values for Block Parameters) for some blocks.
Simulation range checking (see Specify Signal Ranges and Enable Simulation Range Checking).
Automatic scaling of fixedpoint data types.
Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, see Optimize using the specified minimum and maximum values (Embedded Coder).
Note
Output minimum does not saturate or clip the actual output signal. Use the Saturation block instead.
Block Parameter:
OutMin 
Type: character vector 
Values: '[ ]' 
scalar 
Default: '[ ]' 
Output maximum
— Maximum output value for range checking[]
(default)  scalarUpper value of the output range that Simulink checks.
Simulink uses the maximum value to perform:
Parameter range checking (see Specify Minimum and Maximum Values for Block Parameters) for some blocks.
Simulation range checking (see Specify Signal Ranges and Enable Simulation Range Checking).
Automatic scaling of fixedpoint data types.
Optimization of the code that you generate from the model. This optimization can remove algorithmic code and affect the results of some simulation modes such as SIL or external mode. For more information, see Optimize using the specified minimum and maximum values (Embedded Coder).
Note
Output maximum does not saturate or clip the actual output signal. Use the Saturation block instead.
Block Parameter:
OutMax 
Type: character vector 
Values: '[ ]' 
scalar 
Default: '[ ]' 
Output data type
— Specify the output data typeInherit: Same as input
(default)  Inherit: Inherit via back propagation
 double
 single
 int8
 int32
 uint32
 int64
 uint64
 fixdt(1,16,2^0,0)
 <data type expression>
 ...Choose the data type for the output. The type can be inherited, specified directly, or
expressed as a data type object such as Simulink.NumericType
.
Block Parameter:
OutDataTypeStr 
Type: character vector 
Values: 'Inherit: Same as
input' , 'Inherit: Inherit via back
propagation' , 'single' , 'int8' ,
'uint8' , int16 ,
'uint16' , 'int32' ,
'uint32' , 'int64' ,
'uint64' , fixdt(1,16,0) ,
fixdt(1,16,2^0,0) ,
fixdt(1,16,2^0,0) . '<data type
expression>' 
Default: 'Inherit: Same as
input' 
Lock output data type setting against changes by the fixedpoint tools
— Prevent fixedpoint tools from overriding Output data typeoff
(default)  on
Select this parameter to prevent the fixedpoint tools from overriding the Output data type you specify on the block. For more information, see Use Lock Output Data Type Setting (FixedPoint Designer).
Block Parameter:
LockScale 
Type: character vector 
Values:
'off'  'on' 
Default:
'off' 
Integer rounding mode
— Specify the rounding mode for fixedpoint operationsFloor
(default)  Ceiling
 Convergent
 Nearest
 Round
 Simplest
 Zero
Choose one of these rounding modes.
Ceiling
Rounds both positive and negative numbers
toward positive infinity. Equivalent to the
MATLAB^{®}
ceil
function.
Convergent
Rounds number to the nearest representable
value. If a tie occurs, rounds to the nearest even
integer. Equivalent to the FixedPoint Designer™
convergent
function.
Floor
Rounds both positive and negative numbers
toward negative infinity. Equivalent to the
MATLAB
floor
function.
Nearest
Rounds number to the nearest representable
value. If a tie occurs, rounds toward positive
infinity. Equivalent to the FixedPoint Designer
nearest
function.
Round
Rounds number to the nearest representable
value. If a tie occurs, rounds positive numbers
toward positive infinity and rounds negative
numbers toward negative infinity. Equivalent to
the FixedPoint Designer
round
function.
Simplest
Automatically chooses between round toward floor and round toward zero to generate rounding code that is as efficient as possible.
Zero
Rounds number toward zero. Equivalent to the
MATLAB
fix
function.
Block Parameter:
RndMeth 
Type: character vector 
Values:
'Ceiling' 
'Convergent' 
'Floor' 
'Nearest' 
'Round' 
'Simplest' 
'Zero' 
Default:
'Floor' 
For more information, see Rounding (FixedPoint Designer).
Saturate on integer overflow
— Choose the behavior when integer overflow occursoff
(default)  on
Action  Reasons for Taking This Action  What Happens for Overflows  Example 

Select this check box. 
Your model has possible overflow, and you want explicit saturation protection in the generated code. 
Overflows saturate to either the minimum or maximum value that the data type can represent. 
The maximum value that the 
Do not select this check box. 
You want to optimize efficiency of your generated code. You want to avoid overspecifying how a block handles outofrange signals. For more information, see Troubleshoot Signal Range Errors. 
Overflows wrap to the appropriate value that is representable by the data type. 
The maximum value that the 
When you select this check box, saturation applies to every internal operation on the block, not just the output or result. Usually, the code generation process can detect when overflow is not possible. In this case, the code generator does not produce saturation code.
Block Parameter:
DoSatur 
Type: character vector 
Value: 'off' 
'on' 
Default: 'off' 
Data Types 

Direct Feedthrough 

Multidimensional Signals 

VariableSize Signals 

ZeroCrossing Detection 

^{[a]} This block is not recommended for use with Boolean signals. 
HDL Coder™ provides additional configuration options that affect HDL implementation and synthesized logic.
This block has a single, default HDL architecture.
ConstrainedOutputPipeline  Number of registers to place at
the outputs by moving existing delays within your design. Distributed
pipelining does not redistribute these registers. The default is

InputPipeline  Number of input pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is

OutputPipeline  Number of output pipeline stages
to insert in the generated code. Distributed pipelining and constrained
output pipelining can move these registers. The default is

You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.