digiwleeaTools
LearnGlossaryAboutCheat sheetHow a CPU worksToolsOpen the lab →

XOR gate truth table

The XOR gate outputs 1 when its two inputs are different, and 0 when they are the same. Here is its full truth table, the boolean expression, and how it is actually built.

ABY
000
011
101
110

Boolean expression: Y = A ⊕ B. A 1 in the table means a high voltage (logic true) and a 0 means low (false). Read each row as: for these inputs, the output Y is this value.

What the XOR gate does

XOR (exclusive OR) is the heart of binary addition: the sum bit of a half adder is just A XOR B. It is also a controllable inverter, which is why it shows up everywhere from adders to parity checks to the ALU.

Build it yourself

Reading a table is one thing; watching the signals flow is another. Open the logic gate simulator and wire a XOR gate up from transistors, or read the full lesson on how this gate is designed. You can also generate the table for any expression with the truth table generator.

Other gates:

The XOR gate is one small step toward a working CPU. Build every gate from CMOS transistors and work up to an 8-bit processor in the free digiwleea lab and course.

Open the gate simulator →

Frequently asked

What is the truth table of a XOR gate?

The XOR gate outputs 1 when its two inputs are different, and 0 when they are the same. For inputs (A,B) the outputs are 0,0→0 0,1→1 1,0→1 1,1→0.

What is the boolean expression for XOR?

The XOR gate is written Y = A XOR B (symbolically Y = A ⊕ B).

How many transistors does a XOR gate take?

A standard CMOS XOR gate uses about 8 transistors. In digiwleea you build it from those transistors and the simulator verifies it against this exact truth table.