Kits
QRP Labs |
Other Radio Topics
Frequency Counters
Electronics
Guest Project Gallery
Discrete component logic |
![]() |
![]() |
![]() |
Written by Hans Summers | ||
Monday, 31 August 2009 21:33 | ||
I often use discrete component implementations of logic gates in my projects, often consisting of AND and OR gates made from diodes and resistors. I "invented" or "discovered" how to make these gates when I was about 14 and have been happily using them ever since. The reason I use these gates is often to save space: if all I need is one AND gate, for example to reset a counter, then I can easily implement it with 2 diodes and a resistor. It saves using a whole additional IC such as a 74HC08 containing four AND gates, of which I only need one. At other times, it can be convenient to be able to build a logic gate with as many inputs as I like. For example, a 7 input OR-gate is easily implemented just by adding more diodes to the basic 2-input gate. I might not have the IC's I would need in my junkbox, so I'd have to order them and wait for the delivery to arrive. But I'll always have resistors and diodes, so this is sometimes another reason for using logic gates made from discrete components. There are disadvantages to these very simple logic gates too. The most noticeable is that the output current ability of the gates is low. It is determined by the resistor used, and by the current handling ability of the signals driving the gate inputs. If the discrete logic gate output is driving a high impedance IC input such as are found on the modern 74HC-series IC's, there is no problem. The 0.7V voltage drop across the diodes means that you cannot cascade the simple discrete component logic gates, because you may easily violate the input voltage logic level specifications of the IC's following the gate: the voltage will fall below what is recognised as a "1" for example. Finally, the discrete component implementations of logic gates might be slower than their "proper" IC equivalents. I do not currently know how much of a problem this is likely to be. Now I'll try to explain the various types of gates which I commonly use. OR gate
AND gate
NOT gate (inverter)
NAND and NOR gatesThese are easy: just use AND or OR followed by a NOT (inverter). In the case of the NAND gate, the transistor's base resistor can be omitted since the maximum current is already limited by the 10K resistor in the diode-resistor AND gate. The base resistor is still needed in a NOR gate. XOR gateThis one is a little more complicated. If we start off imagining an OR gate, that works for the first three of the possible four states in the truth table. But not the final one, where both inputs are "1". So we need a way of forcing the output to zero. I accomplised this using a transistor as a switch, with its base driven by an AND gate on the two inputs. So that when both inputs are "1", the AND gate will activate the transistor, which will force the output to zero. So the XOR gate can be considered as an OR gate, plus an AND gate, plus a switch to zero the output. The additional diode in the base lead of the transistor is to create an additional 0.7V drop, without it the 0.7V of the AND gate output (even when one of the inputs is zero) would be enough to put the transistor into partial conduction. Signal gate
Other notes1. Gates with more than two inputs: Easy! Just add more diodes, one for each input! XNOR gateMany thanks to Harry Brunt, who took the time to write to me, with this interesting idea for an XNOR gate (like an XOR gate followed by an inverter). Harry writes: "I've just read your interesting article about making logic gates from diodes. I wanted to built a discrete XNOR gate using a minimum number of components (to avoid having to buy a quad XNOR IC for the sake of one gate). After messing around a bit with your XOR gate design, I found that by reversing the polarity of all diodes, substituting a PNP for the NPN transistor and swapping the earth for +V and vice versa, I obtained an XNOR gate - in fact the schematic is just a mirror image of the XOR gate. I've only tried it using SPICE so far, but I can't see why it wouldn't work in practice. I think making an XNOR gate using a single transistor is pretty neat!"
|
||
Last Updated on Saturday, 09 January 2010 00:15 |