This article describes how Bipolar Junction Transistors can be easily configured to act as logic gates when used in their “on” and “off” states. Five popular logic gate types will be described and constructed in this article and accompanying video. The five types are the:
- Inverter (or NOT) gate
- AND Gate
- NAND Gate
- OR Gate
- NOR Gate
TTL Logic Levels
TTL (or Transistor-Transistor Logic) and its associated input/output voltage levels were widely adopted for computers and digital electronics. The input and output levels are as follows:
Input/Output | Voltage Range – Logic Level 0 | Voltage Range – Logic Level 1 |
Input | 0v – 0.8v | 2v – Vcc |
Output | 0v – 0.4v | 2.4v – Vcc |
Parts Needed (if you’d like to build these circuits)
Minimum breadboarding equipment (see here)
(9) General purpose LEDs
(1) 1/4 watt resistor kit (see here)
(10) 2n3904 general purpose NPN transistor
(2) Momentary pushbutton switches
Input Test Circuit
This project will utilize an input test circuit consisting of several resistors and two switches. This test circuit will be used to test and demonstrate each logic gate. Below are both the schematic for the test circuit and picture of the breadboard. It will provide voltage outputs that represent logic levels 0 and 1. The voltage for logic level 0 is 0 volts, while the logic level 1 will be about 3 volts, which both fall into the standard TTL ranges for input voltages.
Click here for a our recommended programmable bench power supply.
Inverter (NOT Gate)
Below is shown the truth table for the Inverter (NOT) gate. Per the table, you can see that the the output state is just the opposite of the input. The circuit design is that of a simple bipolar junction transistor (BJT) switch. The 470 ohm collector resistor provides a low enough output impedance to drive an LED directly as will be shown in the demonstration video. While the transistor is turned (off), it pulls the output high. When the transistor is turned on, the collector of the transistor drops to about 0.2 volts. The base resistor of 2.7k is a 6x multiple of the 470 ohm resistor, which is well within the range that will place the transistor into saturation when as low as 1 volt is applied to that base resistor. This is based on the fact that the 2n3094 transistor typically has a gain of greater than 150.
Click here for a our recommended programmable bench power supply.
AND Gate
The AND gate requires that both inputs be high for the output to be high. Any other combination of inputs results in a low output. In the circuit, both transistors on the left must be “on” or in saturation for the final transistor to be switched off. When it is switched off, the 470 ohm resistor pulls the collector high – resulting in a logic 1 output.
NAND Gate
The NAND gate output is the inverse of the AND gate. Comparing the two truth tables, you can see this to be the case. Since the circuit for the AND gate required an inverter stage, the circuit for the AND gate is the same circuit, less the inverter stage.
Click here for a our recommended programmable bench power supply.
OR Gate
The OR gate only requires one input to be high in order for the output to be high. This is accomplished by the circuit arrangement below.
NOR Gate
The output of the NOR gate is the inverse of the OR gate, as shown by the truth table below. The circuit for the NOR gate is the same as that for the OR gate, except that the inverter stage is omitted.
Summary
Bipolar Transistor logic gates are easy to build – and can demonstrate how, at a fundamental circuit level, logical operations can be accomplished. Traditional TTL logic gates which are found in the 7400 series of integrated circuits use bipolar transistor technology, and are limited to 5 volt operation. The logic level 0 input is specified at between 0 and 0.8 volts, whereas the logic level 1 input is between 2 and 5 volts (Vcc). The logic level 0 output is specified at between 0 to 0.4 volts and the logic level 1 output at 2.4 to 5 volts (Vcc). The discrete circuits described in this article come fairly close to those specifications.
Please see the matching video for this article on our Youtube Channel below.
For a better experience building breadboarded circuits, please see our page detailing the minimum recommended lab equipment for your electronics bench. Also, don’t forget to review the recommended safety procedures to follow when building and testing breadboarded circuits.
Finally, for other interesting breadboarded circuits please visit the home page here or our YouTube channel here. SM
We are a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to Amazon.com and affiliated sites.
We are a participant in the Commission Junction Affiliate Program, an affiliate advertising program designed to provide a means for us to earn fees by linking to affiliated sites.