Home › Lessons › Digital logic › XOR gate

XOR gate

Digital logic · Beginner · about 10 minutes · part of Zen’s Electronics Design Mastery

Exclusive OR: 1 when the inputs differ. It is the heart of a binary adder and of parity checks.

XOR gate: the circuit on the simulator's bench

Open this lesson in the labFree, in your browser, no account needed.

How it works

Y = A ⊕ B

ABYbench
000—
011—
101—
110—

Flip the switches to try every row. “bench” fills in with what the chip actually did.

74HC86: quad 2-input xor in one 14-pin chip. Pin 14 is +5 V, pin 7 is ground. Every unused input should be tied to VCC or GND in a real build.

Try it on the bench

  1. Click switches 1 and 2 to step through 00, 01, 10 and 11. Each combination fills a row of the table.
  2. Select U1 and change its family to 74LS: the high output drops to about 3.5 V, because TTL outputs cannot pull all the way to VCC.
  3. Delete the wire to input B. A floating CMOS input is undefined: the output flickers. Switch the chip to 74LS and the floating input reads as 1.

Parts on the bench

In the course

Zen’s Electronics Design Mastery, module “Digital Electronics”.

More on digital logic