How to Build a NAND Gate
The NAND gate (or NOT-AND) is one of the basic building blocks of digital circuitry. Most basic Boolean (digital logic) functions may be made by combining NAND gates in different configurations.
One of the simplest circuits to demonstrate the NAND function is the Diode-Transistor-Logic (DTL) 3-input NAND gate. This circuit requires only four signal diodes, an NPN transistor, two resistors and a +5 volt DC power source.
Things You'll Need
- Breadboard with interconnect wires
- 1 NPN transistor
- 4 small signal diodes
- 1000 ohm resistor (1K, 0.25 Watt)
- 4700 ohm resistor (4.7K, 0.25 Watt)
- 5 volt DC power supply
- Digital multi-meter (DMM)
Instructions
-
-
1
A breadboard makes circuit testing simple and solderless. Place your breadboard (an electronics circuit test board that allows the technician to plug components and wires to quickly connect or modify circuits without soldering) on a flat, stable surface.
-
2
Insert the NPN transistor (2n2222a, or similar small signal, inexpensive NPN transistor will suffice for this circuit) making sure the Emitter, Base and Collector leads are isolated from each other.
-
-
3
Assemble the rest of the circuit (shown in the 3-input DTL NAND gate link) by connecting the Cathode of one of the diodes (inexpensive 1n914 diodes will be adequate) to the transistor Base lead.
Connect the Anodes of the other three diodes to the Anode of the first diode (connected to the transistor).
-
4
Connect one lead of the 4.7K resistor to the junction of the four diode Anodes. Connect one lead of the 1K resistor to the Collector of the transistor.
-
5
With the power supply turned off, connect the power supply ground to the transistor Emitter lead. Connect the +5 volt DC output of the power supply to the open ends of the two resistors.
-
6
Connect separate wires from the open (Cathode) ends of the three diodes not attached to the transistor, to the power supply ground point.
These are the three logic inputs to your NAND gate. By connecting them to ground, you are starting with three logic 0 inputs.
-
7
Connect the negative (- or black) lead of your DMM to the power supply ground.
Connect the positive (+ or red) lead of your DMM to the junction of the transistor's Collector lead and the 1K resistor. This is the logic output of your NAND gate.
-
8
Test your NAND gate by turning on the power supply.
The Truth Table for a 3-input NAND gate is where all three inputs being high (1), gives a low (0) output. Any other combination of inputs should give a high (1) output. (This is the NOT or inverted result of a logic AND gate. The AND gate only gives a high output when all three inputs are high as well.)
Test your NAND gate. Your initial set up has three low inputs and should give you a high output.
Move the wire connecting one of your three input diodes from the power supply ground to the +5 volt DC point, changing that input from a low to a high. The output should remain high.
Continue through the sequence, building your own Truth Table by changing each input and recording the output.
-
1
References
Resources
- Photo Credit circuit board image by Michael Shake from Fotolia.com electronic board image by Albert Lozano from Fotolia.com