Engee documentation

Set-Reset Flip-Flop

Setup-reset trigger, or bistable multivibrator.

set reset flip flop

Description

The Set-Reset Flip-Flop block implements a set-reset trigger switch, or bistable multivibrator.

The block supports Q and !Q output signals unless an external trigger is applied. An external trigger (Set) causes a state change that persists until a second external trigger (Reset) is applied.

The table shows the relationship between the input and output signals of the block.

Set

Reset

Q

!Q

0

0

Last Q

Last !Q

0

1

0

1

1

0

1

0

1

1

Undefined

Undefined

Ports

Input

Set - input signal
0 | 1

Input signal that causes a change of state.

  • Data types:* Boolean.

Reset - input reset signal
0 | 1

Input signal that resets the state change.

  • Data types:* Boolean.

Output

Q - output signal
0 | 1

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

  • Data types:* Boolean.

!Q - complement of output signal
0 | 1

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

  • Data types:* Boolean.

Parameters

Main group

Priority when undefined state - state priority
Set (By default) | Reset

Priority when undefined state, i.e. when Set and Reset ports are set to 1(true).

Initial condition for Q state - initial value of Q output signal
0 (by default) | 1

Initial value of the output signal Q.

Sample time (-1 for inherited) - block sampling time
-1 (by default) | 0 | positive scalar

The time between consecutive executions of the block. During execution, the block produces output data and updates its internal state if necessary.

For legacy discrete-time operation, set the Sample time (-1 for inherited) 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 mask, throw the value of this parameter through the mask variables to ensure proper switching between continuous and discrete implementations of the block.

References

Additional options

C code generation: Yes