# D flip-flops, but no feedback loops: impossible?

Using JK or T flip-flops, it's easy to create a synchronous N-bit counter by cascading them as depicted here:

The above circuit has no feedback loops in it. I have run into a situation where I would prefer to use D flops, but I also want to avoid unnecessary loops because of wiring congestion. My intuition says doing both (using D flops and avoiding feedback loops) is impossible, but I can't really put my finger on why. Both types of flip-flops save 1 bit of state, right? Sticking a feedback loop in on top of the D flop feels like adding another piece of state, but the system as a whole doesn't store any extra data.

Am I thinking about loops incorrectly? What's different about the D flip-flop that makes it not work here? Last and most important, is it actually impossible to make a counter using only D flops and no feedback loops, or am I just too close to the problem to see it?

Edit to clarify my question: Both D and T flip-flops have some kind of internal feedback loop; I understand that. Both D and T flip-flops store one bit of information. What is different about the T flip-flop that allows it to be used in a counter without adding more feedback loops? Or, alternatively, what about the D flip flop makes it inadequate for this purpose when used alone?

• It's not synchronous. Feb 11, 2014 at 22:07
• Most likely, your T flip-flops are implemented as DFF's with feedback, as shown in Andy's answer. Feb 11, 2014 at 22:33
• Thanks Andy, I was in a hurry when I posted and didn't realize my mistake. Found another circuit that demonstrates the circuit I'm talking about. Feb 12, 2014 at 13:34

To make a T flip-flop, you take a D-flip flop and add feedback from the output to determine the next state.

The immage bellow shows the most basic operating logic of a T flip-flop. If you removed the feed back from Q and Q' you get a D flip-flop (And I know, you also have to invert the bit input on the lower and gate. Lets keep it simple, ok?)

So when you go to use a D flip-flop in a counter circuit instead of a T flip-flop, you have to manually add in the feedback that is now missing.

• Ok, this is a partial answer, but looking at it from a systems perspective: a D FF has a feedback loop in it already. Why do I need two feedback loops, one inside the FF and one external to it, when I need only one bit of state? Feb 12, 2014 at 17:04
• Actually, the most basic D FF does not have a feedback loop since the output state on the next clock cycle does not depend on the current output state. Like I said above, if you take the T Flip-flop pictured and remove the feedback from the output, you will get a D Flip-flop. Feb 12, 2014 at 17:39
• Any FF or latch needs a feedback loop in order to have state at all; I refer you to @OlinLathrop's answer. But I think I see why that doesn't apply in the way I thought it ought to. Feb 12, 2014 at 18:40
• I'm calling this the accepted answer because, while it doesn't exactly address my confusion, I'm seeing now that there's a difference between what the two (kinda 3) feedback loops do in that diagram. Thanks Feb 13, 2014 at 17:01

The D type flip flop needs feedback from its inverted Q output to divide frequency by two. That's the short and long story: -

The way a D flip flop works is simple. Positive clock edges latch the state of the D input at the time the edge rises. Therefore by the time the QBAR output has changed state (some few nano seconds later), its previous state has already been latched so there are no glitches.

• @trentcl: The D FF with feedback as Andy shows IS your T FF (as the Photon remarks). Hence adding that feedback wire is simply wiring your D FF (what you have) to behave as T FF (what you want). Those wires are present in your diagram too, but they are inside your T FF blocks. Feb 12, 2014 at 8:18
• (Changed the circuit in the original, in case you want to adjust your answer.) So adding a loop doesn't affect the... "statefulness" of the circuit? It just seems odd to me that a T flop can do by itself what a D flop can't, being that they both save one bit of state. But I guess it makes sense that the feedback loop is implicit in the T flop. Feb 12, 2014 at 13:36

If one is willing to make certain assumptions about propagation delays, and can generate a suitable-length pulse from each rising clock edge, a T flip flop doesn't need anything more than an XOR gate which feeds back to itself.

simulate this circuit – Schematic created using CircuitLab

The circuit above uses RC circuits to add propagation delay to the XOR gate; the comparator at the lower left generates various widths of clock pulses. If a clock pulse is too short, it won't make the output switch; if it's too long, it will switch more than once (as shown, pulses range from being too narrow to switch at all, to being wide enough to switch three times). Note that the default gates and logic buffers in this simulator have Schmidt trigger inputs (which implies the existence of internal feedback) but the analog comparators don't, so the circuit as drawn has no feedback path other than the single wire across the top.

In practice, trying to condition clock pulses to be just the right width is impractical, so flip flops add additional internal feedback structures. Such structures require more circuitry, but having a larger amount of robust circuitry is better than having a smaller amount of circuitry which requires precise tweaking to make it work.

• Interesting. As a matter of fact, in the technology I'm using (superconducting logic), it's possible to make a similar circuit without using RC circuits to finagle the pulse width. However, the tradeoffs are weird (DFFs are cheaper than XORs, for example). Thanks! Feb 20, 2015 at 13:29
• @trentcl: In NMOS technology, I would think an XOR whose inputs were used for no other purpose could be realized with two active transistors and a passive pullup; I don't know if any manufactured chips used such a circuit. I'll readily admit that because there are different realizations of XOR with different performance characteristics, using one in a schematic is perhaps a bit of a "cheat". Still, the RC circuits in the above schematic were not intended to be indicative of "deliberate" RC circuits so much as to parasitic RC behaviors. Since you mention superconductors, I'm curious... Feb 20, 2015 at 16:40
• ...what are the performance characteristics of superconducting gates? In this simulator, gates act as delay lines, which is IMHO highly unrealistic for any "normal" kind of logic; if I were designing a simulator, I'd define Tp(min) and Tp(max) and say that the output of a gate will go to mid-rail Tp(min) after any change to the input which could affect the output, and only become valid Tp(max) after the inputs have become valid; under such a simulation, some circuits which would in real life behave sensibly could get stuck with everything at mid-rail, but circuits that work under simulation... Feb 20, 2015 at 16:44
• ...with reasonable parameters defined on the underlying components would work in reality with any combination of of real-world behaviors between Tp(min) and Tp(max)--a situation which is not verifiable when simulators use a fixed propagation time. Do superconductors behave like delay lines, or inertial gates, or something in-between? Feb 20, 2015 at 16:45
• It depends on the specific logic family involved, but in general, you find that gates tend to have a latch or flip-flop "built-in", because their delay always depends on a clock. Notionally, they behave more like delay lines, but in context the clocked nature of the circuit dominates any question about the behavior of the actual gate. Beyond that, it depends on the implementation (RQL, or some RSFQ variant, which are numerous). Does this begin to answer your question? Feb 21, 2015 at 10:47

Every flip-flop inherently has some feedback inside. Consider the very simple case of a R-S flip-flop: