# XOR in electronics

I've tried to find the XOR gate created with transistors, and don't find any over google.

It's possible to create XOR with transistors or maybe some other elements? Can you draw a sketch?

Thank you very much!

• This design is in dire need of improvement. At least introduce complimentary operation. Commented Dec 18, 2011 at 15:01
• The diagram on the right in the last line looks like XNOR instead of XOR. Commented Dec 18, 2011 at 19:19
• @The Photon: You're right! Thanks to point out. I'll update the solution (get's even easier, because no OR gate is needed)
– Curd
Commented Dec 18, 2011 at 21:26

The diode-bridge RTL XOR is a pretty neat solution. Certainly easier on the parts count than trying to do combinatorial logic with discrete components .. though I'm sure there are very good reasons why this is not how XOR ICs like the 7486 are built.

simulate this circuit – Schematic created using CircuitLab

Tip: click "simulate this circuit" and run the time domain simulation to see the result:

Here you go.

(I searched for 7486, which is a 4 x XOR IC.)

The main logic element consists of two NPN-transistors whose collectors are connected together (the output) and via a resistor to Vcc. For the inputs the base of one transistor is connected to the emitter of the other and vice-versa.

If both inputs are low then no current flows through the bases, the transistors don't conduct, and the output is high.

If one input is high and one input is low then one transistor conducts and the other doesn't, and the output is low.

If both inputs are high then the output is high (there is no connection to ground other than through the inputs).

This is an XNOR, it is completed by inverting input and output stages, resulting in a logical XOR function.

• Cool. I don't know why I didn't see that answer, but I'm pleased to note that I'm not the only person to have come up with the concept of the two-transistor xor (the middle part of the chip is what actually does the xor operation). Commented Jun 10, 2016 at 14:06

Here's an XNOR gate using four NPN transistors. If the signals which are fed into the device aren't fed anywhere else, it may be possible to eliminate one or both of the input-stage transistors (eliminating one would turn it into an XOR gate). The circuit is based on a device I designed in 1977 to control the lights on a trailer pulled by a Buick (that device used just two PNP transistors, and used diodes to prevent back-feeding).

An XOR can be created out of NAND gates. A NAND gate can be created out of Transistors.

Fill in the gaps ;)

• Found how to create nand, and how to create xor from nand. Is this diagram working? XOR with transistors Commented Dec 18, 2011 at 1:06
• Apart from the lack of any power and resistors, the concept looks right Commented Dec 18, 2011 at 1:09
• Using discrete transistors, it's often possible to build things with fewer parts than would be required using discrete gates. For example, using resistor-transistor logic, one can construct a full-adder with inverted outputs (including a 3-input xnor!) using only two transistors and a bunch of resistors. Building it out of NAND gates would require many more transistors. Commented Oct 22, 2013 at 19:45