The RS FlipFlop in the Simulink library is not working properly.
Ältere Kommentare anzeigen
Hello, The RS FlipFlop in the Simulink library is not working correctly, because when I set the input S = 1 and R = 1, the output Q = 1, but after that when I set S = 0 and R = 0 it does not remember the previous state, instead Q is equal to the value of the initial conditional RS setting. The correct is tha de flip flop RS remember the beofre state when R=0 anda S=0.The correct thing is that the RS flip-flop remembers the previous state when R=0 and S=0.
Antworten (1)
Fangjun Jiang
am 7 Jan. 2026
0 Stimmen
Double click the block, click "Help" to bring up the document.
It says when S=1 and R=1, both Q=0 and !Q=0, and this should be avoided.
4 Kommentare
Victor
am 9 Jan. 2026
Verschoben: Fangjun Jiang
am 9 Jan. 2026
Fangjun Jiang
am 9 Jan. 2026
Please construct a simple model to show the problem. Please not to include in any time when S=1 and R=1.
Victor
am 9 Jan. 2026
Fangjun Jiang
am 10 Jan. 2026
Bearbeitet: Fangjun Jiang
am 10 Jan. 2026
Your model did not show the problem.
The RS FlipFlop block did not have any problem.
Your input value for both the R and S are always 0 so the output Q should be Q(n-1).
If you double click the block and set the "Initial condition for Q state", which means Q(n-1) for your model, to be 1 or 0, then the simulation result keeps that value. This indicates the correct behavior.
Somehow, you must understand something wrong. The attached model should convince you.
By the way, the FlipFlop block you mentioned is from SimScape. It can specify whether "Set" or "Reset" has the priority. It does not have the problem when both R=1 and S=1, which applies to the generic Simulink Extras/Flip Flops/S-R Flip-Flop block.
Kategorien
Mehr zu General Applications finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!