r/AskComputerScience • • Feb 07 '25
How does a flip-flop circuit work?
Hi all. I'm having some trouble understanding how a flip flop circuit works. Now, I want to preface this with saying that I'm familiar with logic gates and feel like I generally understand the truth table for flip flop circuits at a high level, but there's one thing I'm having trouble wrapping my mind around.
When I try to work through the circuit in my head, I get caught in this circular loop. Take a NAND-NAND flip-flop circuit, for instance. When I try to trace through the diagram, I get stuck in this thought process:
Say we label the top NAND gate as A, and the bottom NAND gate as B.
Then we have the standard S(et) and R(eset) inputs.
When I imagine setting S to high and R to low, and then trace through the circuit, it seems like before I can get the output of A, I need the output of B (since it is wired up as one of the inputs to A). And to get the output of B, I need the output of A (for the same reason). So to get the output of A, I need the output of B, for which I need the output of A, for which I need the output of B, and so forth. It's just not clicking for me how I can ever get the result by following the signals through the circuit diagram.
Surely I am missing something here. Do I just assume the output of both gates is initially low before a signal is applied to S or R?
Sorry in advance, I know this is probably kind of a dumb question to have for such a simple circuit. And probably better suited for r/AskEngineers, but I guess I don't have enough karma or something to post the question there.
View all comments
Show parent comment
2
u/MasterGeekMX BSCS Feb 07 '25
Talkin' bout' Logisim, there is a new version of it maintained by the community, as the original project was abandoned. They improved it a bit and added extra things.
https://github.com/logisim-evolution/logisim-evolution