To build discrete transistor logic gates, use Resistor-Transistor Logic (RTL) with standard NPN BJTs like the 2N3904 or 2N2222. A basic 2-input RTL NOR gate requires two transistors in parallel, a 4.7kΩ collector pull-up resistor, and two 10kΩ base resistors, operating on a standard 5V supply. While integrated circuits like the 74HC series have largely replaced discrete logic in commercial products, building transistor logic gates from scratch remains the ultimate exercise in understanding digital switching, biasing networks, and noise margins at the component level.
The Safe Default Parts for Discrete Transistor Logic Gates
When selecting components for discrete logic, you need transistors that switch fast, saturate deeply at low voltages, and are immune to the static charges common on a hobbyist workbench. Avoid high-voltage power transistors (like the TIP31); their high base-emitter capacitance will destroy your propagation delay and cause severe switching lag.
Here are the safe default part numbers for 5V and 12V discrete logic designs, complete with their critical ratings. As of 2026, these remain the most cost-effective and widely available options, typically pricing between $0.04 and $0.12 each in bulk reels.
| Part Number | Type | Vce / Vds Max | Ic / Id Max | hFE (Min) / Rds(on) | Best Application |
|---|---|---|---|---|---|
| 2N3904 | NPN BJT | 40V | 200mA | 100 (at Ic=10mA) | General 5V RTL gates, low-current signal routing |
| 2N2222 (or PN2222) | NPN BJT | 40V | 800mA | 100 (at Ic=150mA) | Logic gates that must directly drive relays or high-brightness LEDs |
| BS170 | N-Ch MOSFET | 60V | 500mA | 5.0Ω (at Vgs=10V) | Low-static-power logic, high-impedance input stages |
| 2N7000 | N-Ch MOSFET | 60V | 200mA | 5.0Ω (at Vgs=4.5V) | 5V-compatible MOSFET logic (better threshold voltage than BS170) |
Biasing and Operating Regions for RTL Gates
In analog amplifiers, we bias a transistor to sit in the active (linear) region. In digital transistor logic gates, we only care about two operating regions: Cutoff (switch open, Logic 0) and Saturation (switch closed, Logic 1). The active region is merely a brief transition state we want to pass through as quickly as possible to minimize heat dissipation.
| Region | Base-Emitter Voltage (Vbe) | Collector-Emitter Voltage (Vce) | Collector Current (Ic) | Logic Output State |
|---|---|---|---|---|
| Cutoff | < 0.5V | ~5.0V (Vcc) | ~0A (leakage only) | HIGH (pulled up via Rc) |
| Active (Transition) | ~0.6V to 0.7V | 0.7V to 4.5V | Proportional to Ib * hFE | Undefined (Avoid steady-state here) |
| Saturation | ~0.7V to 0.85V | < 0.2V (Vce_sat) | Limited by external load / Rc | LOW (pulled to GND) |
How to bias for hard saturation: To ensure the transistor acts as a dead short when turned ON, you must overdrive the base. The rule of thumb for discrete logic is to assume a forced beta ($\beta_{forced}$) of 10 to 20, rather than the datasheet's linear hFE of 100+.
Worked Example: If your collector pull-up resistor (Rc) is 4.7kΩ on a 5V supply, the maximum collector current when saturated is roughly $I_c = (5V - 0.2V) / 4700\Omega = 1.02mA$. To guarantee saturation, design for a base current of $I_b = I_c / 10 = 0.102mA$. Assuming a logic HIGH input of 5V and a Vbe drop of 0.7V, your base resistor should be $R_b = (5V - 0.7V) / 0.102mA \approx 42k\Omega$. We standardize on 10kΩ base resistors to provide an overdrive factor of 4, ensuring crisp switching edges even with parasitic capacitance.
Step-by-Step: Building a 2-Input Discrete NOR Gate
We will build a 2-input RTL NOR gate. In RTL, a NOR gate is the fundamental building block because it places transistors in parallel. (Building a NAND gate in pure RTL requires transistors in series, which introduces complex base-biasing issues since the top transistor's emitter is not at ground potential).
Component List
- 2x 2N3904 NPN Transistors (Q1, Q2)
- 2x 10kΩ Resistors (R1, R2 - Base input resistors)
- 1x 4.7kΩ Resistor (Rc - Collector pull-up)
- 1x 5V DC Power Supply
Pinout Reference
Hold the 2N3904 with the flat face toward you and the leads pointing down. Pin 1 (Left): Emitter (E). Pin 2 (Center): Base (B). Pin 3 (Right): Collector (C).
Wiring Steps
- Ground the Emitters: Connect the Emitter (Pin 1) of both Q1 and Q2 directly to your common ground (GND) rail.
- Install Base Resistors: Connect one end of R1 (10kΩ) to the Base (Pin 2) of Q1. Connect one end of R2 (10kΩ) to the Base (Pin 2) of Q2. The free ends of R1 and R2 are your Logic Input A and Logic Input B.
- Tie the Collectors: Connect the Collector (Pin 3) of Q1 directly to the Collector (Pin 3) of Q2. This shared node is your Logic Output.
- Add the Pull-Up: Connect Rc (4.7kΩ) between the shared Collector node and the 5V Vcc rail. This resistor pulls the output HIGH when both transistors are OFF.
- Verify and Test: Apply 5V to Input A (Output should drop to ~0.2V / LOW). Apply 5V to Input B (Output should drop to ~0.2V / LOW). Leave both at 0V (Output should rise to ~5V / HIGH). This confirms NOR logic: Output is HIGH only when A=0 AND B=0.
For a deeper theoretical breakdown of why RTL relies on parallel transistors for NOR operations, the All About Circuits digital logic chapter on RTL provides excellent schematic comparisons between RTL, DTL, and TTL architectures.
Failure Modes and Multimeter Testing
Discrete logic gates fail differently than integrated circuits. While an IC might suffer from internal bond-wire lift-off or latch-up, discrete transistor logic gates usually fail due to thermal overstress, secondary breakdown, or floating-input oscillation.
How to Test a Suspect Transistor In-Circuit and Out-of-Circuit
Set your digital multimeter to Diode Test mode. If testing in-circuit, ensure the power is OFF and capacitors are discharged. For accurate results, desolder at least the base and collector leads.
- Base-to-Emitter Junction: Place the Red probe on the Base, Black on the Emitter. You should read a forward voltage drop between 0.600V and 0.750V. Reverse the probes; it should read 'OL' (Over Limit).
- Base-to-Collector Junction: Place Red on Base, Black on Collector. Expect 0.600V to 0.750V. Reverse probes; expect 'OL'.
- Collector-to-Emitter Path: Place probes across Collector and Emitter in both directions. Both must read 'OL'. If you read a short (near 0.00V) or a low resistance in either direction, the transistor has suffered secondary breakdown and is dead.
If your multimeter shows a forward voltage drop significantly lower than 0.5V across any junction, the transistor is internally shorted. If it reads 'OL' in the forward direction, the internal bond wire has blown open. For official thermal and electrical limits, always cross-reference the Texas Instruments 2N3904 datasheet to ensure you aren't exceeding the 625mW maximum power dissipation rating at room temperature.
Transistor Logic Gates FAQ
Why use discrete transistor logic gates instead of 74HC series ICs?
In modern production, you wouldn't. However, discrete transistor logic gates are invaluable for three specific scenarios: educational fundamentals (understanding the physical layer of digital abstraction), repairing vintage computing hardware (like 1960s Apollo guidance computers or early IBM mainframes that used discrete RTL/DTL), and designing ultra-high-radiation environments where commercial CMOS ICs suffer from single-event latch-ups, but thick-die discrete BJTs can survive.
How do I prevent shoot-through and oscillation in discrete logic gates?
Shoot-through (where the pull-up resistor and the saturated transistor form a low-resistance path to ground, wasting power) is inherent to RTL, but it is managed by sizing the collector resistor (Rc) high enough (e.g., 4.7kΩ to 10kΩ) to limit static current to 1-2mA. Oscillation is prevented by never leaving inputs floating. Always use pull-down resistors (e.g., 100kΩ to GND) on any input that might be disconnected, such as a mechanical switch or an open-collector output from a previous stage.
Can I cascade discrete RTL gates without signal degradation?
Yes, but with strict fan-out limitations. When an RTL gate outputs a LOW (transistor saturated), the Vce_sat is roughly 0.2V. If you cascade this into the base of the next stage, 0.2V is safely below the 0.6V turn-on threshold, so it holds the next transistor OFF. However, when outputting a HIGH, the voltage is determined by the voltage divider formed by your 4.7kΩ pull-up and the 10kΩ base resistors of the subsequent gates. If you connect too many inputs to one output (high fan-out), the HIGH voltage will sag below the reliable switching threshold. Keep your fan-out to 3 or 4 maximum for standard 5V RTL.
What is the propagation delay of a discrete transistor logic gate?
A standard RTL gate built with a 2N3904 typically exhibits a propagation delay ($t_{pd}$) of 50ns to 150ns, depending on the parasitic capacitance of your breadboard and wiring. The delay is largely dictated by the time it takes to charge and discharge the base-emitter junction capacitance through the 10kΩ base resistor. You can reduce this delay to roughly 20ns by adding a small 'speed-up capacitor' (typically 47pF to 100pF) in parallel with the base resistor, which injects a spike of current to rapidly charge the base during switching transitions.






