Electrical – Help understanding SR Flip-Flop

flipflop

The table in the bottom image is the solution for an exercise based on a NAND SR flip-flop.

"Complete the truth table for the SR flip-flop."

The "initially" row is given, and I was supposed to fill in the q and Q-bar values for the remaining rows.
I don't understand the solution – why does changing S to 0 result in Q switching to 1? And why does switching S and R to 0 result in Q = 1 and Q-bar = 1?

From my very limited understanding so far in this topic, I would have thought that applying 0 to S would leave Q and Q-bar unchanged, as S stands for "set" and we are not applying a current.

Any help much appreciated.

enter image description here

Solution:

enter image description here

Best Answer

You are making an assumption that might not be valid. You are assuming that forcing S high sets the latch...it's possible that S is active-low, and that a low value on S actually represents the SET input condition.

The key to understanding these latch circuits is to remember how a NAND gate works. The output of a NAND gate is low if and only if both inputs are high. If either input is low then we know that the output must be high, regardless of the value of the other input.

So, if S=0 then Q must be 1. If R=0 then Q-bar must be 1. If both S and R are low then both Q and Q-bar must be 1.