JK flip-flop built from op amps?

Thread Starter

xox

Joined Sep 8, 2017
936
Seems like a lot of work for something of complex structure, very poor performance and limited use. :rolleyes:
That's not really true though. You can build a very reliable RS flip flop with just a single LM324, a few resistors and a capacitor. And it's been very useful. I've used it as a fail-safe switch in numerous circuits and haven't had a single failure.

And in fact it's the internal complexity of the op amp which makes it so stable. Individual transistors are notoriously sensitive to changes in temperature and what not, which is precisely why differential/op amp configurations offer so much more stability. A good video covering those issues:


So yes, you could just use logic chips but in my very limited experience at least they just seem to be a lot more fickle, requiring much more careful set up than say a simple op amp based circuit.

Now perhaps from the perspective of someone with a lot more expertise in electronics such as yourself that sort of approach might seem like total overkill but as a novice at least I just like the fact that op amps can be used as rugged building blocks in circuits for purposes which they may not be specifically designed to be used in but nonetheless turn out to be a quite handy substitute.
 
Last edited:

danadak

Joined Mar 10, 2018
4,057
I can see one advantage of using OpAmps/Comparators in a logic application, much higher
noise margin can be designed into the circuit. More precise switching thresholds as well.

This topic is an interesting thread.

Regards, Dana.
 

MrAl

Joined Jun 17, 2014
13,724
I can see one advantage of using OpAmps/Comparators in a logic application, much higher
noise margin can be designed into the circuit. More precise switching thresholds as well.

This topic is an interesting thread.

Regards, Dana.
Hi,

[sarcasm ON]
Yes it would be great to see modern CPU's turn to using op amps for all their internal logic.
We'd see CPU top speeds of at least 10kHz and taking up enough real estate to cover an entire motherboard.
[sarcasm OFF]
 

Thread Starter

xox

Joined Sep 8, 2017
936
Hi,

[sarcasm ON]
Yes it would be great to see modern CPU's turn to using op amps for all their internal logic.
We'd see CPU top speeds of at least 10kHz and taking up enough real estate to cover an entire motherboard.
[sarcasm OFF]
LOL. :p
 

Thread Starter

xox

Joined Sep 8, 2017
936
Hi,

[sarcasm ON]
Yes it would be great to see modern CPU's turn to using op amps for all their internal logic.
We'd see CPU top speeds of at least 10kHz and taking up enough real estate to cover an entire motherboard.
[sarcasm OFF]
I realize this is just a joke but it does help to raise a very important distinction. If you're mass-producing a circuit for example and have already calculated all of the required tolerances for everything then it obviously makes sense to keep things specific. On the other hand, situations where you just need things to work reliably without much fuss, using op amps for general purpose building blocks can be a very useful technique to keep things simple.

A good analogy is software development. When you're prototyping something it's useful to just use the built-in facilities of the language in the beginning. Once you've got the proof of concept working you can then move on to making things more efficient by hand-crafting a linked-list structure for instance.
 
Last edited:

Thread Starter

xox

Joined Sep 8, 2017
936
I can see one advantage of using OpAmps/Comparators in a logic application, much higher
noise margin can be designed into the circuit. More precise switching thresholds as well.

This topic is an interesting thread.

Regards, Dana.
Exactly. I remember working with some logic chips I kept having these difficulties like where the chip would malfunction if my hand came too close to the chip (some sort of static charge sensitivity I suppose) or if the chip was place too close to a warm component or what have you. Major pain in the arse.
 

danadak

Joined Mar 10, 2018
4,057
[sarcasm ON]
Yes it would be great to see modern CPU's turn to using op amps for all their internal logic.
We'd see CPU top speeds of at least 10kHz and taking up enough real estate to cover an entire motherboard.
[sarcasm OFF]
[sarcasm OFF]
Love the humor. And with modern OpAmp and comparator performance we
should be able to easily get into the Mhz area. All the while burning more power
which keeps more people employed and helps warm up the earth. Its all good.

[sarcasm ON]
Amazing how people have exceeded the intellectual capacity of gerbils. Next stop
beat the single cell protozoa at checkers :)

Regards, OpAmps forever, Dana.
 

MrAl

Joined Jun 17, 2014
13,724
Hi,

Yes i was just joking as i actually like op amps ever since i learned about them many years ago.
In particular, i like the way we can get precision by using negative feedback which is a very typical theme in using these devices.
I even have some favorite op amps there were once made by National Semiconductor.
 

crutschow

Joined Mar 14, 2008
38,568
So yes, you could just use logic chips but in my very limited experience at least they just seem to be a lot more fickle, requiring much more careful set up than say a simple op amp based circuit.
Perhaps.
But you can build a pretty unfinicky RS latch with a couple of 2-input NAND/NOR CD4000 series gates that will reliably work from 3V to 15V with no added passive parts.
The passive parts required for the opamp circuit likely cost more than the opamp. :rolleyes:
 

Thread Starter

xox

Joined Sep 8, 2017
936
The passive parts required for the opamp circuit likely cost more than the opamp. :rolleyes:
Well I paid less than a nickle apiece for the LM324's (4 op amps per chip) and a fraction of a cent for each passive part. Pretty sure a single CD4001 would cost me about ten times as much. In any case though, neither option works out to be too expensive, so...

Not to mention that the biasing resitors and pull down capacitor can be used by multiple circuits and so the only "dedicated" passive components are really just the two resistors tying together the op amps.
 
Last edited:

MisterBill2

Joined Jan 23, 2018
27,714
Just because you CAN make some logic elements from opamps does not make it a good idea. For starters, cmos logic is perhaps a thousand times faster than inexpensive opamps, and it uses far less power. AND, BUILDING LOGIC THAT WAY TAKES UP A LOT MORE ROOM. So while it would certainly be an interesting science fair effort, I really don't see any practical motivation to go in that direction. So the combination of much more complexity, much slower speed, and much greater power consumption should steer one away from this sort of interesting idea.
 

Thread Starter

xox

Joined Sep 8, 2017
936
Just because you CAN make some logic elements from opamps does not make it a good idea. For starters, cmos logic is perhaps a thousand times faster than inexpensive opamps, and it uses far less power. AND, BUILDING LOGIC THAT WAY TAKES UP A LOT MORE ROOM. So while it would certainly be an interesting science fair effort, I really don't see any practical motivation to go in that direction. So the combination of much more complexity, much slower speed, and much greater power consumption should steer one away from this sort of interesting idea.
Well I wouldn't advocate it for high-speed applications for sure. But more space? I don't know about that. I've got some really tiny surface-mount op-amp chips and resistors that could be used to implement my flip flop in a space smaller than a human fingernail. As far as power consumption, the design I submitted consumes so little power that I couldn't even measure it with my multimeter. (And could easily be configured to consume much less if desired). And again, I have incorporated this into multiple circuits and found it to be quite useful.

Of course that's just an RS flip flop. Converting it to a JK may well be a lot more complex and not worth the trouble.
 
another one & better:)

These are the circuits that I've designed for myself, and the purpose behind them was making a Frequency Divider. These are just a few examples, and I think you can change them.

Anyway...these just show that it's possible, but as some of you mentioned before, despite existing fast and small flip-flop ICs, it's not reasonable to use op-amps. However, by being creative, you can do lots of things and there's no limitation.
 

OBW0549

Joined Mar 2, 2015
3,565
So yes, you could just use logic chips but in my very limited experience at least they just seem to be a lot more fickle, requiring much more careful set up than say a simple op amp based circuit.
If you find digital logic ICs to be "fickle" then you're doing something VERY wrong. Used properly, following a few very simple rules, they're rock-solid.

I remember working with some logic chips I kept having these difficulties like where the chip would malfunction if my hand came too close to the chip (some sort of static charge sensitivity I suppose) or if the chip was place too close to a warm component or what have you. Major pain in the arse.
I concur with @crutschow: that's what happens when you leave unused logic gate inputs unconnected. And in my experience with using logic chips, that's about the ONLY time it ever happens.
 

Thread Starter

xox

Joined Sep 8, 2017
936
If you find digital logic ICs to be "fickle" then you're doing something VERY wrong. Used properly, following a few very simple rules, they're rock-solid.

I concur with @crutschow: that's what happens when you leave unused logic gate inputs unconnected. And in my experience with using logic chips, that's about the ONLY time it ever happens.
I think it was Dick (Cappels) who helped me out on that one, and yes, I do believe it was a floating input.

But I also had some issues where the chips were getting zapped (I wasn't using any ESD protection at the time). My fault of course but it still irked me that these seemed to be the only components I'd ever used which required such careful handling. And so naturally when I started to incorporate this op amp based RS into circuits as a switch I was quite happy with it. Easy to put together and always seemed to work without fail. True, fairly useless for true logic applications, but not a bad fill-in for situations where you just need something robust which serves the basic functionality of a flip flop.

Another advantage I found was, whereas the CMOS chip requires a logic low, the op amp version reacts the same with an unconnected input which sort of simplified the whole using it as a switch type affair. Just a bit less complex anyway.
 
Last edited:
Top