Set-Reset Flip-Flop

Set-reset flip-flop or bistable multivibrator

  • Library:
  • 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? (Simulink) and Specify Sample Time (Simulink).

For inherited discrete-time operation, specify -1. For discrete-time operation, specify a positive integer. For continuous-time operation, specify 0.

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 Parameter to Mask (Simulink).

Extended Capabilities

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

Introduced in R2018b