If you are searching for a single, three-pin 'XOR transistor' to drop into a breadboard, you are chasing a ghost. In semiconductor physics and commercial manufacturing, there is no discrete component that performs an Exclusive-OR (XOR) logic function on its own. An XOR is a logic network—a mathematical function (Y = A⊕B) that outputs HIGH only when its inputs differ.

To achieve this, you either wire a network of discrete transistors (BJTs or MOSFETs) or use a dedicated integrated circuit (IC) that packages multiple transistors into a single silicon die. While the 74HC86 quad XOR IC is the undisputed champion for modern digital design, building an XOR gate from discrete bipolar junction transistors (BJTs) remains a vital bench exercise for understanding logic thresholds, saturation, and signal degradation.

The Direct Answer: If you just need an XOR function for a digital project, buy a 74HC86 (5V TTL/CMOS) or CD4030 (wide-voltage CMOS) IC. If you are building a custom analog-digital interface, learning transistor biasing, or repairing legacy RTL (Resistor-Transistor Logic) boards, use the discrete 4-BJT network detailed below.

Discrete BJT XOR Circuit: Node Map and Component Values

Because an XOR function requires both OR-like and NAND-like behavior, a robust discrete BJT implementation requires more than just two transistors. The most reliable hobbyist topology uses four NPN transistors configured as a hybrid phase-splitter and logic combiner. Unlike a standard IC with fixed pin numbers, a discrete network relies on a Node Map.

Network Node Map (Symbol & Pinout Equivalent)

  • Input A: Routed to the base of Q1 (via 10kΩ) and the base of Q3 (via 10kΩ).
  • Input B: Routed to the base of Q2 (via 10kΩ) and the base of Q4 (via 10kΩ).
  • Internal Node X (NAND stage): Collector junction of Q1 and Q2, pulled up to VCC via a 2.2kΩ resistor.
  • Internal Node Y (OR stage): Collector junction of Q3 and Q4, pulled up to VCC via a 2.2kΩ resistor.
  • Output Z (Final XOR): Taken from the collector of Q5 (an inverting stage driven by Node X and Node Y combined through diodes), pulled up via a 1kΩ resistor.

Note: For simplicity in low-speed hobby applications, many builders use a 4-transistor bridge design, but the 5-transistor (or 4-transistor + diode) topology prevents the 'floating output' state that plagues simpler RTL designs when both inputs are LOW.

Complete Application Circuit Component List

ComponentValue / RatingPurpose
Q1, Q2, Q3, Q42N3904 NPN BJT (40V, 200mA)Primary logic switching elements
R_Base (x4)10kΩ, 1/4WLimit base current, set logic threshold
R_Collector (x2)2.2kΩ, 1/4WPull-up for internal logic nodes
R_Out_Pullup1kΩ, 1/4WPull-up for final output stage
D1, D21N4148 Signal DiodePrevent reverse current between internal nodes
VCC5.0V DC (Regulated)Logic HIGH reference

Operation Regions and Biasing the Discrete XOR

Unlike MOSFETs, which are voltage-controlled, BJTs are current-controlled. To make a BJT act as a digital switch, you must bias it to toggle cleanly between Cutoff (open switch) and Saturation (closed switch). You must actively avoid the Active/Linear region, where the transistor acts as an amplifier and generates excess heat.

Operation RegionBase-Emitter Voltage (V_BE)Collector-Emitter Voltage (V_CE)State in XOR Logic
Cutoff< 0.5V~ VCC (5.0V)Transistor OFF (Logic HIGH at collector)
Active (Avoid)~ 0.6V to 0.7V1.0V to 4.0VAmplifying (Causes logic errors & heat)
Saturation~ 0.7V to 0.8V< 0.2V (V_CE(sat))Transistor ON (Logic LOW at collector)

How to Bias and Select the Base Resistor

To guarantee hard saturation, we calculate the base resistor ($R_B$) using the forced beta ($\beta_{forced}$) method. For a standard 2N3904 transistor, the datasheet lists a minimum DC current gain ($h_{FE}$) of 100 at 10mA. In switching applications, we use a forced beta of 10 to 20 to ensure saturation regardless of temperature.

The Math:
Assume $V_{IN} = 5V$, $V_{BE} = 0.7V$, and desired $I_C = 2mA$ (set by the 2.2kΩ collector resistor).
$I_B = I_C / \beta_{forced} = 2mA / 10 = 0.2mA$.
$R_B = (V_{IN} - V_{BE}) / I_B = (5V - 0.7V) / 0.2mA = 21.5k\Omega$.
We select the next standard lower value, 10kΩ, which provides $0.43mA$ of base current, driving the BJT deeply into saturation with a $V_{CE(sat)}$ of roughly 0.1V.

Bench Walkthrough: Driving a Relay (And What Went Wrong)

Theory is clean; the workbench is not. Here is a real-world scenario demonstrating why understanding the output impedance of a discrete XOR transistor network is critical.

The Setup

I needed an XOR function to trigger a 5V automotive-style relay (coil resistance: 70Ω, requiring ~71mA to pull in) based on two limit switches. I built the 5-transistor discrete XOR network on a solderless breadboard using the 1kΩ output pull-up resistor specified above.

The Numbers and Outcome

Testing the output with a high-impedance digital multimeter (DMM) showed perfect logic: 4.9V for HIGH, 0.15V for LOW. However, when I connected the 70Ω relay coil between the output node and VCC (low-side switching configuration), the relay merely clicked and chattered. The DMM read 1.8V at the output when it was supposed to be pulling LOW.

What Went Wrong

The discrete output transistor (Q5) was trying to sink the relay current to ground. The relay demanded 71mA. However, the base drive into Q5 was limited by the preceding stage's 2.2kΩ pull-up resistors. Q5 was pushed out of saturation and into the Active region. It was dropping 3.2V across its Collector-Emitter junction ($V_{CE} = 5V - 1.8V$), dissipating $P = 1.8V \times 71mA = 127mW$ of heat, and failing to pull the relay coil voltage low enough to engage the armature.

The Fix

A discrete logic gate should never drive a heavy inductive load directly. I kept the XOR network intact but added a dedicated 2N2222 NPN transistor as a low-side switch. The XOR output (limited to ~2mA) drove the base of the 2N2222 (via a 1kΩ resistor), and the 2N2222 sinked the 71mA relay current. The relay engaged instantly, and the logic transistors stayed cool.

Failure Modes and Multimeter Testing

Discrete transistor logic fails differently than integrated CMOS logic. While an IC will simply output a flatline if an internal trace blows, discrete networks suffer from localized component degradation.

Common Failure Modes

  1. Base-Emitter Junction Blowout: If an input pin is accidentally subjected to a negative voltage spike (e.g., inductive kickback from a motor limit switch exceeding 5V reverse), the B-E junction undergoes Zener breakdown (typically around 6V to 8V for a 2N3904). This permanently destroys the transistor's gain ($h_{FE}$ drops to near zero).
  2. Thermal Runaway: If a transistor is stuck in the Active region due to poor biasing, it heats up. As silicon heats, $V_{BE}$ drops, causing it to draw more base current, which creates more heat, until the silicon die physically cracks or the bond wire melts.
  3. Storage Time Delay (Shoot-Through): When a BJT is driven into deep saturation, excess minority carriers store in the base region. When the input drops LOW, the transistor doesn't turn off instantly. In high-speed XOR networks, this delay can cause both the pull-up and pull-down networks to conduct simultaneously for a few nanoseconds, causing a massive current spike.

How to Test with a Multimeter

You do not need a curve tracer to test a BJT. Use your DMM's Diode Test mode.

  • Base to Emitter: Red probe on Base, Black on Emitter. Expect 0.60V to 0.75V. Reverse the probes; expect 'OL' (Open Line).
  • Base to Collector: Red on Base, Black on Collector. Expect 0.60V to 0.75V. Reverse; expect 'OL'.
  • Collector to Emitter: Expect 'OL' in both directions (assuming the transistor is out of circuit).
Safety Note: Always remove the transistor from the breadboard or desolder at least two legs before testing. Parallel resistors in an XOR network will create false low-resistance readings on your DMM, leading you to throw away perfectly good silicon.

Safe Default Part Numbers: Discrete vs. Integrated

When sourcing parts for an XOR function, your choice between discrete and integrated dictates your PCB real estate, power consumption, and propagation delay. For a deep dive into standard logic gate theory, All About Circuits provides an excellent breakdown of Boolean implementations.

CategoryPart NumberKey RatingsWhen to Use
Discrete NPN BJT2N3904 / BC54740V V_CEO, 200mA I_CLow-speed RTL, educational builds, custom analog thresholds.
Discrete N-CH MOSFET2N7000 / BS17060V V_DS, 200mA I_DWhen you need voltage-controlled logic with near-zero static gate current.
Integrated CMOS (5V)74HC862V-6V VCC, ~8ns delayStandard digital logic, microcontroller interfacing, high-speed clocks.
Integrated CMOS (Wide)CD4030 / CD40703V-15V VCC, ~50ns delayBattery-powered systems, 12V automotive logic, high-voltage thresholds.

Ultimately, while the 'XOR transistor' does not exist as a single component, mastering the discrete BJT network gives you an intuitive grasp of voltage drops, current sinking, and saturation that no black-box IC can teach. If you are driving anything heavier than an LED or a high-impedance CMOS input, always buffer your discrete logic output with a dedicated switching transistor or a logic-level MOSFET.