Connecting logic gates

Discussion in 'The Projects Forum' started by JingleJoe, Dec 31, 2011.

  1. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    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:

    Code ( (Unknown Language)):
    1.  
    2.            +---[XOR input]
    3. [out]------¦
    4.            +---[AND input]
    5.  
    I also wonder whether pulldown resistors would be required on the inputs?
     
  2. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    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.
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  4. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    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.
     
  5. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    Why do you want to connect multiple outputs to one input?
     
  6. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    SCIENCE! :p
    Just curious really, it was merely another thing I didn't know. However, I am currently using logic gates in lunetta synths.
     
  7. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    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.
     
  8. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    That does not deter me at all. :D

    Thankyou all for the info :)
    I'm just experimenting really, finding out the limitations and extents of what I can do with these chips.
     
  9. bertus

    Administrator

    Apr 5, 2008
    15,647
    2,346
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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.
     
  11. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    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.
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Diodes and a pull-down resistor can be used as an OR gate.
    Diodes and a pull-up resistor can be used as an AND gate.

    Like this:

    [​IMG]
     
    PaulEE likes this.
  13. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    Fantastic, thankyou :)

    I have some similar schematics already but without the helpful o'scope demonstration :)
     
  14. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    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)
     
  15. davebee

    Well-Known Member

    Oct 22, 2008
    539
    46
    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.
     
  16. JingleJoe

    Thread Starter Member

    Jul 23, 2011
    185
    10
    I have a feeling it's something more like internal migration of electrons into the gate insulation layer.

    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:
     
  17. Georacer

    Moderator

    Nov 25, 2009
    5,142
    1,266
    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
     
  18. PaulEE

    Member

    Dec 23, 2011
    423
    32
    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...
     
Loading...