Main Content

Set-Reset Flip-Flop

Set-reset flip-flop or bistable multivibrator

  • Set-Reset Flip-Flop block

Libraries:
Simscape / Electrical / Control / General Control

Description

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.

SetResetQ!Q
00Last QLast !Q
0101
1010
11UndefinedUndefined

When the state is undefined, the priority is provided as an external parameter.

Ports

Input

expand all

Input signal that triggers a state change.

Data Types: Boolean

Input signal that resets a state change.

Data Types: Boolean

Output

expand all

Output signal Q, with the same dimensions and data type as the input signal.

Data Types: Boolean

Output signal !Q, with the same dimensions and data type as the input signal.

Data Types: Boolean

Parameters

expand all

Priority for the undefined state, that is, when both Set and Reset are true.

Initial condition for Q state.

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 -1. For discrete-time operation, set this parameter to a positive integer. For continuous-time operation, set this parameter to 0.

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.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2018b