Connecting logic gates

Thread Starter

JingleJoe

Joined Jul 23, 2011
186
ahoy,
I just have a few questions about connecting logic gates, I'm pretty certain I won't blow anything up but I just wanted to check with you chaps to make sure.
Is it okay to connect different logic gate's inputs to one output?
Like this:

Rich (BB code):
           +---[XOR input]
[out]------¦
           +---[AND input]
I also wonder whether pulldown resistors would be required on the inputs?
 

davebee

Joined Oct 22, 2008
540
In general, yes, that is what logic gates are designed for.

Logic gates have a parameter called fanout that says how many inputs one output can drive. It may be 3, or 4, or 10 more more, depending on the type of gates you are working with.

If you mix logic types, like CMOS, or TTL or LS-TTL, what output can drive what input depends totally on the specific parts. Some mixed types can connect directly and some cannot without additional parts.

Open collector gates usually will need a pullup.

The only way to get the best answer is to look at the data sheets of the specific gates you are using.
 

SgtWookie

Joined Jul 17, 2007
22,230
Some logic families seem like they should hook right up, but they don't.

For example, 74LSxx are not compatible with 74HCxx, however they ARE compatible with 74HCTxx.

The fanout of one logic family does not mean it will be the same if you try to interface it to a different logic family.

One of the nice things about 4000 series logic is that the input impedance of the gates are so high, that you can drive a LOT of them with very little current.
 

Thread Starter

JingleJoe

Joined Jul 23, 2011
186
Brilliant :) I'm sticking to 4000 series cmos chips for that very reason. Thankyou for the help chaps.

What would one do if multiple outputs were to be connected to one input? I'm thinking perhaps a diode OR gate with a pulldown resistor or just use many individual gates for each output.
 

ErnieM

Joined Apr 24, 2011
8,377
What would one do if multiple outputs were to be connected to one input?
Fire. Explosions. Earthquake. End of the world as per the Mayans.

Seriously, while it *may* be OK to connect multiple inputs together it is generally a bad thing to connect multiple outputs together.

The input problem is determioned by which logic family you are using, or if families are being mixed. Generally it is fine but you can connect too many together in some families.

Unless an output is an open collector or tri-state type (which by design are made to connect multiple outputs together) some sort of gate is needed to connect them.

What kind of gate? That depends on what you are doing.
 

SgtWookie

Joined Jul 17, 2007
22,230
They are somewhat tolerant to abuse, but connecting two or more outputs together directly is very poor form.

You could use diodes to block the outputs from "seeing" each other, and use 10k pull-up or pull-down resistors on the other side of the diodes.

If the cathodes are towards the outputs, then you'll need a pull-up resistor.

If the anodes are towards the outputs, you'll need a pull-down resistor.
 

MrChips

Joined Oct 2, 2009
30,706
Presumably the reason one would want to connect the output of two gates is to perform the OR function. One would use a 2-input OR gate instead.
 

SgtWookie

Joined Jul 17, 2007
22,230
You're welcome.

You can use diodes and a pull-up or pull-down resistor to AND or OR just about any number of inputs together.

You should follow such a diode AND/OR with another gate, as you lose ~0.7v across the diode(s)
 

davebee

Joined Oct 22, 2008
540
If you're really curious about what would happen if you connected outputs of logic gates together, remember that they are are just transistor circuits inside a package.

Connecting two outputs that were driven to different logic levels would just configure several transistors to conduct current through internal resistances between the power supply and ground.

The transistors would get hot just like a resistor conducting current. Heat input from the Ohmic heating will be balanced by heat loss to the surrounding chip package. Depending on how much heat goes in and how much heat can be transferred away will determine whether enough temperature builds up to destroy the parts.

Many logic gates are pretty forgiving about being temporarily connected wrong - having an output connected to another output, power or ground, as anyone who has incorrectly wired a breadboard circuit can tell you.

Some parts show no effect at all, some parts gradually get hot but once the circuit is fixed, continue to work, some parts will immediately fail with little or no external effect, and some parts will actually blow the tops off the plastic package in their failure.

All this I know from experience, but also, I have read that parts can be stressed by overvoltage or overheating such that they still work, but work poorer than before, due to something like internal migration of atoms within the semiconducter material, so be warned that experimentation with chips can damage them.

One trick you can do if you want to safely experiment is to connect logic with a small resistor, maybe 100 to 1000 ohms, between the logic outputs and your test circuits. With a healthy circuit, the resistor has minimal effect, but it the test circuit shorts out, the resistor protects your logic chip from too great a current flow.
 

Thread Starter

JingleJoe

Joined Jul 23, 2011
186
due to something like internal migration of atoms within the semiconducter material,
I have a feeling it's something more like internal migration of electrons into the gate insulation layer.

One trick you can do if you want to safely experiment is to connect logic with a small resistor, maybe 100 to 1000 ohms, between the logic outputs and your test circuits. With a healthy circuit, the resistor has minimal effect, but it the test circuit shorts out, the resistor protects your logic chip from too great a current flow.
Good idea, thankyou :) and thankyou all for the help again :D

P.S. having very recently connected my inverting schmit triggers all weirdy wirey, I am aware of how much improper use they can take :rolleyes:
 

Georacer

Joined Nov 25, 2009
5,182
Fascinating! When you get the strength can you elaborate a bit on the topic? Maybe post a link for more info or something?

I find myself playing around with the 74XX series more than I would like to.

Thx
Some logic families seem like they should hook right up, but they don't.

For example, 74LSxx are not compatible with 74HCxx, however they ARE compatible with 74HCTxx.

The fanout of one logic family does not mean it will be the same if you try to interface it to a different logic family.

One of the nice things about 4000 series logic is that the input impedance of the gates are so high, that you can drive a LOT of them with very little current.
 

PaulEE

Joined Dec 23, 2011
474
If you wanted to connect the outputs purely for the purpose of looking at the logical effects (as in, the resulting boolean effects from doing so), the closest thing to "hooking them all together" logically would be (correct me if I'm wrong folks) a multi-input OR gate.

In analog land, hooking various lower impedance logic gate outputs to one another will be, in some cases, like shorting the power supply, less the output impedances of the gates...which would be bad news for the gates...
 
Top