16
\$\begingroup\$

Consider:

Enter image description here

I can make no sense in my head how this can work. How is it possible to have a current flow through normal diodes from cathode to anode and represent an AND if both are 1?

\$\endgroup\$
  • 3
    \$\begingroup\$ Note that this circuit typically works but it has no gain and as a result cannot restore noise margins. Typically, at slow to moderate speeds you can get away with doing something like this once in between conventional gates or other functional blocks having gain, but you can't really have a sequence of passive gates like these feeding one another without quickly running into problems. Still, tricks like this can be very useful when you have ICs that almost do what you need, but need a trivial amount of "glue" in between and the signals aren't too fast. Otherwise there's tinylogic. \$\endgroup\$ – Chris Stratton Oct 21 '17 at 17:29
30
\$\begingroup\$

Imagine A and B are both high. Then there is no current that flows out of A nor is there current that flows out of B, so S is high.

schematic

simulate this circuit – Schematic created using CircuitLab

Now if A is low, the diode allows A to draw current, which pulls down the node voltage of S, so the voltage of S corresponds to the voltage drop of the diode when current is flowing through the resistor and the diode... which is approximately 0.7V, or 'low'.

schematic

simulate this circuit

Same if B is low.

Same if A or B are low.

Therefore, both A and B must be high in order for S to be high... AND gate!

As stated by fukanchik in the comments, the role of the diodes is to prevent the inputs from interfering with one other when they are in different states, but the diode is only necessary with inputs that can sink and source current. If the inputs can only sink current, such as in an open-collector configuration, then the diode is not necessary

schematic

simulate this circuit

\$\endgroup\$
  • \$\begingroup\$ That's what I thought, too, but if there's no resistance between the source and S, why would anything ever flow through A or B? \$\endgroup\$ – Phil N DeBlanc Oct 20 '17 at 16:34
  • 1
    \$\begingroup\$ The 'source' is the 5V pull-up resistor. When A and B are high, S is only high because it is being pulled up by the resistor. No current is flowing through the diodes at all. When A or B is low, it has the result of pulling down the voltage of node S by sinking current, thus, (approximately) all of the 5V drop is across the resistor. \$\endgroup\$ – slightlynybbled Oct 20 '17 at 16:38
  • \$\begingroup\$ @PhilNDeBlanc current only flows left through those diodes, when the input is low, sourced from the pullup and from whatever follows. \$\endgroup\$ – Trevor_G Oct 20 '17 at 16:38
  • 2
    \$\begingroup\$ @PhilNDeBlanc I added a bit of clarification to the second paragraph. Hope it helps. Enjoy! \$\endgroup\$ – slightlynybbled Oct 20 '17 at 16:41
  • 3
    \$\begingroup\$ You should add that the role of diodes is to prevent current to flow from one input into another when inputs are not equal (01 or 10). \$\endgroup\$ – fukanchik Oct 20 '17 at 17:47
11
\$\begingroup\$

schematic

simulate this circuit – Schematic created using CircuitLab

Figure 1. Four possible input conditions.

The only one of the four switch combinations that allow the output to pull high is '11'. That is, by definition an AND function.

\$\endgroup\$
  • \$\begingroup\$ +1 Can always trust you to use great illustrations. :) Might be nice to add the voltages to the 0 and 1 flags for even more clarity. \$\endgroup\$ – Trevor_G Oct 20 '17 at 17:16
  • 3
    \$\begingroup\$ If all diodes are replaced by wires you get the same results. I think this illustration is not representative of how the gate works. \$\endgroup\$ – Jose Antonio Reinstate Monica Oct 20 '17 at 18:50
  • 2
    \$\begingroup\$ It directly answers the OP's question, "how its possible to current flow through normal diodes from cathode to anode and represent an AND if both are 1." Please feel free to write an improved answer. \$\endgroup\$ – Transistor Oct 20 '17 at 19:00
  • \$\begingroup\$ In addition, this AND gate is shown in isolation. The point of the diodes is to prevent one input pulling down the other and affecting other gates or logic connected to that input. Replacing with wires would not give the same result. \$\endgroup\$ – Transistor Jun 5 at 20:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.