Set-reset flip-flop or bistable multivibrator
Simscape / Electrical / Control / General Control
The Set-Reset Flip-Flop block implements a set-reset flip-flop or bistable multivibrator.
The block maintains the output signals, Q and !Q, unless an external trigger is applied. An external trigger (Set) produces a change of state, which is maintained until a second external trigger (Reset) is applied.
The table shows the relationship between the block input and output signals.
|0||0||Last Q||Last !Q|
When the state is undefined, the priority is provided as an external parameter.
Set — Set input signal
Input signal that triggers a state change.
Reset — Reset input signal
Input signal that resets a state change.
Q — Output signal
Output signal Q, with the same dimensions and data type as the input signal.
!Q — Complement output signal
Output signal !Q, with the same dimensions and data type as the input signal.
Priority when undefined state — State priority
Set (default) |
Priority for the undefined state, that is, when both
Set and Reset are
Initial condition for Q state — Initial value of the output Q
0 (default) |
Initial condition for Q state.
Sample time (-1 for inherited) — Block sample time
-1 (default) |
0 | positive scalar
Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.
For inherited discrete-time operation, set this parameter to
For discrete-time operation, set this parameter to a positive integer. For
continuous-time operation, set this parameter to
If this block is in a masked subsystem or a variant subsystem that supports switching between continuous operation and discrete operation, promote this parameter to ensure correct switching between the continuous and discrete implementations of the block. For more information, see Promote Block Parameters on a Mask.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Introduced in R2018b