Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Embarrassing electronics problem (logic gates)

  1. Feb 2, 2013 #1

    I'm fairly new to and not very good at electronics (my A-level project was an LDR that turned on a light, LOL, and I got an A! {UK education for you}) and was wondering how the basic logic gates work.

    From hyperphysics this is an AND gate:

    Here's how I understand this
    Transistors work by producing one output iff there are two active inputs. So a current flows through A as well as the 6V voltage source, this produces an output that flows to the next transistor which, along with an active B - will produce an output in "out", assuming the ratios of the resistances are all accurate (and whatever parameters a transistor has). If I am accurate with this then a simple acknowledgement would be great with any relevant refinements or elaborations.

    Here's another AND gate.
    Here's how I understand this
    I don't. Diodes only allow current in one direction so how could this ever produce any output? Or does this work because diodes are imperfect and after a certain threshold voltage they will both allow a current. If so it seems strange that anyone would use this as the diodes are being used somewhat against their intended purpose.

    If you are willing could you please clear up all of my uncertainties? Would be greatly appreciated
    Last edited by a moderator: Feb 6, 2013
  2. jcsd
  3. Feb 2, 2013 #2


    User Avatar

    Staff: Mentor

    Hi wannab, http://img96.imageshack.us/img96/5725/red5e5etimes5e5e45e5e25.gif [Broken]

    Yes, that explanation is adequate (just) and works for this circuit.

    What's labelled V is supposed to be a constant supply voltage, say +6V. When you apply 0V to the input at one of the diodes, what is the voltage at "out"? When you apply +6V to both diode inputs, what is the voltage at "out"?
    Last edited by a moderator: May 6, 2017
  4. Feb 2, 2013 #3
    Try to look at the diodes as switches.
    When they conduct they are closed switches. If you use two level of voltage, 0 volts and V volts, you can get the diodes to conduct when you apply 0 volts to the corresponding terminal.

    You then have direct connection to 0 volt potential, that is mass. Output is 0 volts (if the diode is ideal) and resistor R is dissipating the power in the form of heat.
    This happens if at least one diode is conducting.

    If neither diode is conducting, i.e. their input a both high, no current is flowing through R, hence no voltage can drop across it, and the output is V volts, i.e. high.
  5. Feb 2, 2013 #4

    jim hardy

    User Avatar
    Science Advisor
    Gold Member

    Great question. I'll just try to add a teeny point to what's been said already.

    You'll find it helpful, i think, to imagine yourself very small and inside the circuit, 'feeling" the voltages tug at you as if you were a charge carrier.
    In your second example imagine yourself sitting at the bottom of that resistor.
    That's the node of R, OUT, and the two diode anodes.

    You feel the V+ pulling UP through the resistor, that's why it is called a "pullup resistor",
    and you feel nothing through the diodes as shown because there's nothing on other side of them to "pull down".
    IF you tie either diode to low, then you would feel that pull and it will overwhelm the V+ because the diode can pass more current than the resistor. Output will then be low.

    So your second circuit is an AND, ie to have high output both inputs must be not low but high.

    It is useful to accustom yourself to this kind of simple analysis.
    That is because some systems define TRUE as HIGH, others define TRUE as LOW.
    THAT gets confusing, especially when designers mix high-true and low-true in the same logic system.
    You need to be able to fall back on your basic circuit analysis.

    Keep up the good work .

    old jim
  6. Feb 2, 2013 #5
    Surely it doesn't matter because the diode is blocking the current? I'm confused. To me this looks like it will always give an output as the 6V goes straight to the output before meeting the diodes.
  7. Feb 2, 2013 #6


    User Avatar

    the diode connected to A will not be blocking if the input to terminal A is low. that diode will then conduct. same for B.
  8. Feb 3, 2013 #7
    That would be true if there were not a resistor in between. The role of the resistor is to "drop the voltage to zero" when the diodes are conducting.
    Again, I am assuming ideal diode behavior here.

    Try redraw the circuit using a closed switch connected to earth for D1, and an open switch (also connected to earth, but that's immaterial) for D2. What you see is just a resistor connected between +V and earth, and your output connected to earth. That is output voltage is earth's voltage.
  9. Feb 3, 2013 #8
    Why? I thought (at least ideal) diodes blocked all current? Or is it like I said before that it works because diodes aren't ideal?

    Also why is there a disconnected ground in the picture? What's that supposed to mean?
  10. Feb 3, 2013 #9
    Well, I think that you should back to basics.
    And try analysis this circuit

    Attached Files:

    • 0.PNG
      File size:
      2.7 KB
  11. Feb 3, 2013 #10
    I hate diodes. Do I have to understand them or can I just do everything with transistors?
  12. Feb 3, 2013 #11
    In this Diode AND gate circuit we force both A and B into HIGH state.
    We have this situation
    Both diodes are "OFF". No current flows through R1 resistor. If no current flow through resistor, there is no voltage drop across resistor. So the output voltage is in HIGH state (10V).
    But if for example we have A input at HIGH state and B input at LOW state. D2 diode is forward bias. So there must be a current flow through R1 resistor.
    So the Output is at LOW state (0.6V - D2 diode forward voltage drop).

    Attached Files:

    • 1.PNG
      File size:
      2.1 KB
    • 2.PNG
      File size:
      2.6 KB
  13. Feb 3, 2013 #12
    How can you understand transistor circuit if you don't understand how diode work?
    And base-emitter junction is just a diode (PN junction).

    Diode allows current to flow in one direction (called the diode's forward direction), while blocking current in the opposite direction (the reverse direction).

    http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48551&stc=1&d=1352653220 [Broken]
    Only small reverse current will flow and this current is essentially constant no matter what reverse bias is applied. If reverse bis voltage increased sufficiently beyond reverse breakdown voltage. Diode will begin to pass a large reverse current which can destroy the diode.
    Forward-biased diode ( the diode is ON)
    http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48547&stc=1&d=1352650592 [Broken]
    Reverse-biased diode (diode is OFF)
    http://forum.allaboutcircuits.com/cache.php?url=http://forum.allaboutcircuits.com/attachment.php?attachmentid=48548&stc=1&d=1352650592 [Broken]
    Last edited by a moderator: May 6, 2017
  14. Feb 3, 2013 #13
    I don't know, but all the pictures involving diodes in this thread don't make any sense to me.
  15. Feb 3, 2013 #14
    Why don't they just show the transistor AND gate like this?


    It's like they're making it confusing on purpose.
  16. Feb 3, 2013 #15
  17. Feb 3, 2013 #16


    User Avatar
    Gold Member

    Transistors are created from multiple PN junctions, which is what a diode is.

    There is voltage at the output when the diodes are both reversed biased. Which will happen if both A and B are high. If either A or B is low a diode conducts, if they are both low both will conduct. But it only takes one diode conducting to "steer" current left and there is less voltage available at the output than Vout(1) (that voltage which corresponds to a logic high).

    So - if either of the inputs is low, current is steered left through that diode to ground, there is not adequate voltage at the output to correspond to a logic high.
  18. Feb 4, 2013 #17


    User Avatar

    Staff: Mentor

  19. Feb 4, 2013 #18
    Have you even tried to replace the diodes with switches?
    Because it looks like you are experiencing problems with basic circuit theory, not diodes.

    In logic gates like the one you've shown here, diodes and transistors are nothing more than controlled switches. Transistors can act as closed or open switches by providing a suitable base or gate voltage. Diodes can act as closed or open switches by providing a suitable voltage at the 'gate input' terminal (if Vanode>Vcathode then it's a closed switch, otherwise it's open).

    Once you understood how the gate works with ideal devices, you can refine your analysis by considering the effects of real devices (like diode drop voltage, internal resistances, parasitic capacitances...).
    Last edited: Feb 4, 2013
  20. Feb 5, 2013 #19


    User Avatar

    wannab, think of diodes as one-way valves. if the applied voltage is positive (or exceeds about 0.6 v), it conducts and if the applied voltage is negative, it does not conduct.
  21. Feb 6, 2013 #20


    User Avatar
    Science Advisor
    Gold Member
    2017 Award

    I think your problem is that you think you can jump into a topic like Electronics half way through and pick it up from there. This is just not true. The basics are absolutely essential for making progress further on. To have the remotest clue about what a transistor is doing and how it can work in a circuit, you need to understand, first, how simple circuits with just resistors operate. If you think that you already have that sussed then you should be able to answer most of the questions in this link.. If not, then there is little point in trying to understand Logic Circuits at the component level (you can always design combinational logic circuits by treating the units as black boxes because all the different logic technologies follow the same 'rules' of logic).

    If you have started or completed any Physics or Electronics course then you should have or will have the knowledge. Otherwise, you will need to do a bit of self-education. There is no easy way to 'get' Electronics. Some people approach it by building and testing circuits on their own. That can work but you can't beat being taught the basics first.

    There is no point in saying that you just don't like diodes. You can't be selective in this way. The expression "blocking the current" means very little, in the wrong context.
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook