Diode logic uses diodes to create Boolean logic gates in electrical circuits. The diodes act as electrical switches in these circuits because they can only conduct current in one direction. Diode logic can only be used to construct the Boolean logical "AND" and logical "OR" functions because of the simple nature of diodes.
Boolean logic in circuits and computer programming is similar to the more widely familiar Boolean logic used by search engines. If a searcher types ham AND eggs into a search engine, the results will contain both of the words. On the other hand, if the searcher types ham OR eggs, the search engine gives results that contain both of the words or only one of the words. This means that the AND function narrows results, but the OR function widens them.
In electrical circuits, voltages replace the search terms and results used in a search engine. The only results possible are a high voltage or a low voltage, represented by the numbers 1 and 0, respectively. An output of 1 represents a positive result, or an output of "true." The 0 represents a negative result, which outputs "false."
For an AND diode logic circuit, both inputs must have high voltages — that is, they must be "true" — in order for the output to also be true. A diode has a logical value of 1 if it is connected to a power source, and thus has voltage running through it, and a logical value of 0 if it is disconnected. When one or the other or both of the diodes in the AND circuit are disconnected, voltage cannot reach the output wire and it will have a logical value of 0. Only one out of four possible scenarios — 0 and 0, 1 and 0, 0 and 1, or 1 and 1 — results in voltage reaching the diode for an output of 1.
In an OR diode logic circuit, on the other hand, three out of the four possible scenarios result in a true output. Only the input of 0 and 0 returns an output of false. This happens because the diodes are connected in such a way that the output wire receives voltage when either one or both of the diodes are connected.
Diode logic gates are useful for simple AND and OR functions, but they cannot be used to connect multiple AND and OR functions together. This is because two logic gates connected to another logic gate leads to incorrect voltage readings at the output for the third gate. The effect becomes even worse if more gates are connected. Diode logic gates are only used one at a time to avoid these errors.