6
\$\begingroup\$

I figure there must be a way to understand it in terms of the three underlying latches somehow locking each other out, but I'm not getting it.

Edge-triggered flip flop circuit.

Is there a way to understand the edge-triggered flip flop circuit other than trying all the combinations and seeing that it works?

(Diagram from Wikipedia, CC BY-SA 3.0.)

\$\endgroup\$
6
  • 1
    \$\begingroup\$ Intuitive? Unlikely, but you definitely can try writing a function on each node in terms of "previous" and "current" values and see if you can derive anything making sense. \$\endgroup\$
    – Eugene Sh.
    Dec 30, 2019 at 18:44
  • \$\begingroup\$ it is unclear what you mean by "understand" and "getting it" \$\endgroup\$
    – jsotola
    Dec 30, 2019 at 18:44
  • \$\begingroup\$ perhaps all you need is to think of it as a black box with two inputs and two outputs \$\endgroup\$
    – jsotola
    Dec 30, 2019 at 18:46
  • 2
    \$\begingroup\$ Instead of trying to decipher the circuit as as a whole, try and figuring out what a NAND pair does, then use it as a building block to build up to the flip-flop. It appears three times after all which means it probably has serves a abstractable function. \$\endgroup\$
    – DKNguyen
    Dec 30, 2019 at 19:04
  • 2
    \$\begingroup\$ I suggest you look up how a DFF is made using CMOS (transmission) gates here . I find it more intuitive (and is how they are really made in VLSI) \$\endgroup\$
    – Oldfart
    Dec 30, 2019 at 19:12

1 Answer 1

12
\$\begingroup\$

I think there is always an intuitive way to understand a circuit... you just have to be willing to do it... Let's try it...

The situation is difficult but intriguing - there is an unknown circuit in front of us and we begin looking for something familiar in it. As OP have figured out, there are three \$R\neg\$\$S\neg\$ latches in total (for simplicity, I will name them "RS latches"). But how are they connected to each other?

1. Figuring out the structure. As we can see, there is one MAIN LATCH (on the right) assembled by NAND 5 and NAND 6. The other two latches are connected to its inputs. The S LATCH (NAND 1 and NAND 2) is inserted before the S input and the R LATCH (NAND 3 and NAND 4) - before the R input of the MAIN LATCH.

7474 D flip-flop

So, our first conclusion is that we see an RS latch wich inputs are latched by the same RS latches... shortly, а "latched latch". Why is this done?

Then we see something else interesting and quite odd - the Q output of the R LATCH is connected to the R input of the S LATCH, and then the Q output of the S LATCH is connected to the R input of the R LATCH. In other words, both input latches are connected in a "global" positive feedback loop... as they say, they are "cross-coupled" like the single RS LATCH where two NANDs are cross-coupled. The Data signal is inserted in the global loop so it acts as a sole input to the big latch. What does all that mean? What is the sense of this additional positive feedback as they have such?

2. Investigating the operation. It's time to look at the Clock. Initially it is low. Also, for completeness, assume some value of the Data input, e.g., "0".

Clock = 0. As the Clock is low, there are logical "0s" at the R input of the S LATCH (NAND 2) and at the S input of the R LATCH (NAND 3). They cause these outputs to be high... and this is the neutral input combination for the MAIN LATCH allowing it to hold undisturbed the previous Data. So the two input latches are blocked... and also, the BIG LATCH consisting of them is blocked (there are no positive feedbacks).

Clock = 1. When the clock signal goes high (logical "1"), NAND 2 and NAND 3 are enabled and the input latches are unblocked. The positive feedbacks - two local and one global, begin acting... and the BIG LATCH is set to the state corresponding to the input signal Data (S LATCH - "1", R LATCH - "0"). The data from its outputs is stored in the MAIN LATCH... that is forced to stay in this state (Q = "1") until the Clock is high.

And here is the key point of this circuit solution - from now on, the input latches can no longer be controlled by the input D... they are locked. So, if Data goes high until Clock is high, this will not change the latch states.

Clock = 0. When the Clock is low again, the NAND 2 and NAND 3 outputs are forced to be high... and the input latches are blocked again. There are two "1s" at the inputs of the MAIN LATCH; so it is released and begins holding its contents.

3. Final conclusion (answer). The trick of this clever circuit solution (7474 positive-edge triggered D latch) is to latch the inputs of an RS latch by RS latches. So this combination can be thought of as a gated D latch with latched input gates. While the Clock is low, the input latches are blocked; when the Clock is high, they are set by the Data input signal and can no longer be changed by it... the circuit is locked. Thus the circuit accepts the Data signal only during the rising edge.

So the circuit exploits the well-known property of the RS latch that the input signal (e.g., at the S input) can toggle it only once; that is why it has another input (R).

(I apologize for the rough drawing and the explanation currently made... but I had no clear idea of the answer at the beginning... and started developing it right now in front of you.)

.................

(I have replaced the picture with more qualitative... but I am not sure if this is better for the understanding...)

\$\endgroup\$
4
  • 2
    \$\begingroup\$ Thanks! That's just the sort of explanation I was looking for. \$\endgroup\$ Dec 31, 2019 at 6:31
  • 2
    \$\begingroup\$ Circuit fantasist, can I just add how lovely your schematics are - really reminds me of the old Forrest Mims sketch books. Contain exactly what a schematic should convey, and they look fantastic. \$\endgroup\$
    – awjlogan
    Dec 31, 2019 at 11:52
  • \$\begingroup\$ Readers should keep in mind that this is not how real flip-flops are made in modern processors. CMOS flip-flops are made with transmission gates and inverters, using much fewer transistors than the version show here. \$\endgroup\$ Jun 29, 2020 at 20:00
  • \$\begingroup\$ Transmission gates are interesting devices... \$\endgroup\$ Jun 30, 2020 at 14:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.