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, specify
discrete-time operation, specify a positive integer. For continuous-time operation,
If this block is in a masked subsystem, or other variant subsystem that allows you to switch between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures 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