# The difference between these two D latch circuits

I simulated both ones and could not see any difference in functionality. So, what is the need for that extra NOT gate? When it is preferred?

• That's a latch, not a D flip-flop. When E or CLK is high, the data passes through. A D flip-flop has outputs that only change on a particular clock edge (rising or falling, depending on the design). – Spehro Pefhany May 7 '20 at 17:46
• @SpehroPefhany hmmm, ok, then it should be edge triggered to be a flip flop, thanks, noted. Any idea on the use/necessity of that NOT gate? – muyustan May 7 '20 at 18:01
• It is obvious the two circuits are equivalent... but more important questions are, "What is the idea behind them?", "For what purpose were they created?". Related questions are, "Is it possible to create an asynchronous D latch? Is it possible to create a synchronous RS latch? Does it make sense?" – Circuit fantasist May 8 '20 at 15:55
• @Circuitfantasist nice questions to think about – muyustan May 8 '20 at 16:27

If you look closely at the circuits, the pin the NOT gate is driving is driven from the output of the NAND gate in the other circuit. Basically, they get a NOT gate for free with the NAND gate, and they're making use of it.

When is it preferred? I would say never. If it is possible to get the same functionality without the NOT gate without affecting performance, then there is no reason for it. Additionally, removing the NOT gate decreases the load on the input, and it only results in that one NAND gate driving two pins instead of one. However, at the same time, nobody builds latches or flip flops from logic gates these days, instead more optimized, transistor-level circuits are used to increase performance and reduce area.

If you're working with 7400 series logic, you would use a 7475, 7477, or similar latch or flip-flop chip, which gives you multiple latches in one chip instead of using a whole 7400 quad NAND gate chip for one latch.

They are more-or-less equivalent but the timing is not identical, especially for data stable and runt pulses on E in the second circuit. There may be other differences you can find.

• +1: For mentioning timing. – copper.hat May 8 '20 at 2:25

They are logically equivalent. The only apparent difference is at the bottom left NAND gate. For the top circuit the output of this NAND gate is obviously $$\overline{\overline{D}\cdot CLK}$$

In the bottom circuit the output of the NAND gate is $$\overline{\overline{(D\cdot E)}\cdot E} = \overline{(\overline{D}+\overline{E})\cdot E} = \overline{\overline{D}\cdot E + \overline{E}\cdot E} = \overline{\overline{D}\cdot E}$$ which is the same logic function if you substitute $$\E\$$ for $$\CLK\$$.

• Nice demonstration on how they are equal to each other mathematically. – muyustan May 7 '20 at 18:30

Probably, the first circuit was formally synthesized by a theorist who was not interested in how it would be implemented... while the second circuit was invented by an engineer who knew about the existence of 7400... This was exactly the reason we were guided by in the 90's, when we made setups for investigating various latches and flip-flops in the laboratory on digital circuits...

• Quad nand2 chip? – muyustan May 7 '20 at 20:18
• And apparently nobody heard of the 7475/7477, because that gives you four not-quite-independent D latches in one chip – alex.forencich May 7 '20 at 21:09