Talk:Circuit Idea/Revealing the secret of diode AND logic gate

Revealing the secret of diode AND logic gate
I have moved the text below from the related Wikipedia talk page. Circuit-fantasist (discuss • contribs) 17:23, 20 September 2011 (UTC)

The mystery of diode AND gate


Diode logic gates were introduced in 50's; I met them for the first time in the late 60's when I went to technical school. I remember I understood the explicit diode OR gate but I was in a maze by this so odd, exotic and absurd diode AND gate... I asked myself many questions as: "Why the diodes were back to front? Why the resistor was connected to +V instead to ground? Why there was no input current when the input voltage was high? And why there was input current when the input voltage was low? But why the current went out of the diodes and went in the input source? What was this absurd? Why it was impossible to make inverting diode gate? Why AND gate was supplied by an additional voltage source while OR gate had not such a source?...and so on...and so on...

It is interesting fact that many years later I continued to not understand what the basic idea behind diode AND was. I perfectly knew the circuit but I didn't understand it... I "saw the trees but I didn't see the forest for them"... And what is more interesting I didn't see any reasonable explanations of this humble circuit somewhere to answer my childhood questions... instead I was seeing thousands of "not seeing the forest" explanations...

Finally (imagine it was this autumn, only three months ago), during the laboratory exercises with my students on Digital circuits, I began realizing the great idea behind these legendary diode circuits. I was amazed how simple it was. I shared and considered my insights with these young people and they approved of them; they admired this "elegant simplicity". We decided to share the truth about diode AND gates with wikipedians and Wikipedia readers. That is why, I have written these explanations in the article. In addition, I have listed (in bold) and explained (in italic) below the key points of understanding diode AND gates extracted from the main article.

Is it an original research? I have already explained it in the article about Miller theorem. Yes, it is... but in the common sense of this term, not in the specific Wikipedia OR sense. Really, I have exposed my insights about this circuit solution but I have managed to reduce them to extremely clear, evident and simple explanations that should not be treated as original research in the Wikipedia OR sense; they do not need to be referenced. If you do not agree with me, please insert your comments below the items. Circuit dreamer (talk, contribs, email) 18:10, 15 January 2011 (UTC)

Key points of explaining diode AND gate

 * In logic gates, logical functions are performed by parallel or series connected switches controlled by input logical variables. ''It is well-known truth, see also, , , , etc.


 * In diode logic, the switches are implemented by diodes: when forward biased, a diode switch is closed; when backward biased, the switch is open. ''It is well-known truth, see also, , , etc.


 * OR logic gates are implemented by parallel connected switches. It is well-known truth, see the sources above.


 * In a diode OR logic gate, diode switches are connected so that they act as normally open switches: if the input voltage is high (input logical 1), the according diode switch is closed; if the input voltage is low (input logical 0), the diode switch is open. It is obvious, there is no problem to understand it in the case of a diode OR gate.


 * Diode OR logic gates consume current from input sources with high voltages and they do not inject current to input sources with low voltages; so, they belong to so-called current-sourcing logic. We will discuss this phenomenon thoroughly below; for now see . See also the text I have extracted from this forum (we will use it when explaining diode AND gate):


 * "...If you take one of the simple power source, a battery. If the battery is 9V, and you put a load across the two poles, then the current flows through the load. The current will go in one direction. One pole could be referenced as GND, the other as Vcc. Now, take two batteries - one is the above 9V battery, the other is a 12V battery. You connect the negative poles together, let it be the GND reference. Then, if you connect a load between the two positive poles (one pin on 9V battery + pole, the other pin on the 12V battery + pole), then, current will flow, but will go in the *other* direction, in the 9V battery, than in the first case. When the 9V battery provides current, which goes out of 9V (using conventional current), the battery is said to *source* current. When the battery is absorbing current, it is said to *sink* current. Source and Sink really only does tell in which direction the conventional current flow..." (I have corrected only some spelling mistakes)


 * AND logic gates should be implemented by series connected switching elements. It is a well-known truth, see the sources above.


 * In contrast to transistors, diodes are two-terminal switching elements, in which the input and output are not separated; they are the same. As a result, series connected diode switches cannot be driven by grounded input voltage sources. The 4-terminal relays are the most suitable electrically-controlled switches since their input and output circuits are completely separated. The 3-terminal transistors can still be used as 4-terminal switches by grounding the emitter (source); thus, the input and output circuits have a common point (the ground) but they do not interfere in each other's operation. The situation with 2-terminal diodes is the worst - here the input source and the load are connected in the same circuit and there is no way to connect the diodes in series and to drive them by grounded voltage sources.


 * To solve this problem, diode AND logic gates are constructed in the same manner as OR diode gates - by parallel connected diode switches (the same idea is used in the input stage of TTL logic gates where base-emitter junctions are connected in parallel). If you find it difficult to see the parallel connection, imagine that all the input voltages are low (i.e., all the inputs are connected to ground).


 * In a diode AND logic gate, diode switches are connected so that they act as normally closed switches in respect to the input voltage: if the input voltage is high, the switch is open; if the input voltage is low, the switch is closed... To realize this idea, the diodes are reverse connected and forward biased by an additional voltage source +V (a power supply) through the pull-up resistor R1. This is a key concept in understanding the diode AND logic gate; so, I will explain it thoroughly.


 * The name of this circuit technique is biasing (it is not only electrical; it is a general idea that can be seen around us in this world). To be more precise, this is "biasing with the same but opposite to the input quantity" with the purpose to reverse the behavior of some element. In this arrangement, we apply not the genuine input voltage across the element; we apply the difference between the input and biasing (offset) voltage, i.e., we apply the inverted input voltage. As a result, the current flowing through the element is inverted as well.


 * ''First, see the extracted forum text above that explains the same concept. Or imagine another problem: we have a relay with normally open contact but we need a relay with normally closed contact. What do we do? We can invert the relay behavior by connecting the one coil terminal to +V instead to ground. This means that we have inserted an additional voltage that is equal but opposite to the input voltage (traveling along the loop +V -> VIN -> coil). As a result of this biasing, when applying +V to the other coil terminal, the resulting voltage drop across the coil will be zero and no current will flow trough it; and v.v., when applying 0 to the coil terminal, the resulting voltage drop across the coil will be -V and current will flow trough it in opposite direction (+V -> coil -> input source -> ground). The relay with normally open contact has become a relay with normally closed contact.


 * We may see the same trick in a CMOS logic gate, in a PNP transistor stage or in any complementary transistor stage that are driven and supplied by positive voltages. In these circuits, the upper PMOS or PNP transistor is actually driven by negative input voltage (with respect to +V), which is the inverted positive input voltage. From this viewpoint, a diode AND gate with positive input voltages is actually a diode OR gate with negative input voltages.


 * '''To obtain AND instead OR function according to De Morgan's laws, the input and output logical variables are inverted:


 * Y = NOT ((NOT (X1) OR NOT (X2)) = NOT (NOT (X1 AND X2)) = X1 AND X2.


 * Finally, we have only to describe the diode AND structure by logical expressions and to simplify them by applying De Morgan's laws. There are a lot of sources about such transformations (e.g., ).


 * Therefore, the diode AND logic gate is a modified diode OR logic gate: the diode AND gate is actually a diode OR gate with inverted inputs and output. This final conclusion evolves from the considerations above.


 * As diode AND logic gates do not consume current from input sources with high voltages and they inject current to input sources with low voltages, they belong to so-called current-sinking logic. We have just explained this phenomenon above. There are also a lot of sources about current-sinking logic.

Circuit dreamer (talk, contribs, email) 18:10, 15 January 2011 (UTC)