# Need help in understanding flip flop

I have problem with understanding the feedback part in flip flop. Consider a flip-flop circuit containing just two NAND gates as shown in the picture below:

Problem 1) Let A & S' be the inputs of 1st NAND gate and B & R' be the inputs of the 2nd NAND gate. What will be the values of A & B when both S' & R' are 0? (To find output we need to know the inputs, but here the inputs are depended upon the outputs of each other which makes me confused!)

Problem 2) If A & S' are 0, Q will become 1. Since Q=B, B will also become 1. Now let R'=0, then Q' will become 1. Since Q'=A, A will change to 1 from 0. Is this analysis true?

• This is why it is not considered a valid state (it is certainly not a stable state) for both inputs to be 0. – Ignacio Vazquez-Abrams Nov 11 '15 at 11:38
• Do people in general consider this a flip-flop? To me, a flip-flop is always clock edge driven. This is a latch. – rioraxe Nov 12 '15 at 2:44

Problem 1)

Basically start by saying S' is 0, this means that Q will be 1 (as the NAND gate is high when Either A or S' is low), therefore B will be 1. As B is one the inputs to the second gate are 1 and 0 therefore Q' is 1. So A will be 1. The inputs to the first gate will be 1 and 0 so Q will still be 1.

Problem 2)

A will change from a 0 to a 1 but Q will still be high as S' is still 0

• Thanks. But in Problem 2 how Q will become low? It will remain as high instead, right? – Ambady Anand S Nov 12 '15 at 10:43
• Yes my mistake, Q will remain high. – Stuart Rayner Nov 12 '15 at 10:49

No, your analysis is NOT true. Even when Q' → A goes high, since the S' input is still low, the Q output remains high.

And despite the comment by Ignacio Vazquez-Abrams, the both-inputs-low condition (and both outputs high) is NOT an "unstable state" in itself, but the state that the circuit ends up in depends on the order in which the inputs go high. If they go high "simultaneously" (not really possible in practice), it's impossible to predict the output state, and the outputs may even become metastable for a period of time.

• Can you please point out what is exactly wrong with the analysis in the question? (I haven't said that Q will become 0) – Ambady Anand S Nov 13 '15 at 9:11
• Sorry, I didn't read it closely enough. The last thing you said was, "A will change to 1 from 0". What you meant to say was "A will change from 0 to 1" (the same as Q'). – Dave Tweed Nov 13 '15 at 11:49