Logic Gate Calculator
Test cases replayed : 3 of 3 match · Methodology · No outside source listed
Choose 0 or 1 for inputs A and B to read the output of each logic gate.
Result
XOR (A ⊕ B)
AND (A · B)
- OR (A + B)
- NAND
- NOR
- XNOR
- NOT A
Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.
This browser did not allow copying. The sentence is in the box below, already selected: copy it with your keyboard or the menu.
How to use this calculator
Fill in the fields in this order; each step takes you to its field.
How this calculator works
Boolean algebra: AND is 1 only when both inputs are 1; OR is 1 when at least one is 1; XOR is 1 when the inputs differ. NAND, NOR and XNOR are the inverses of AND, OR and XOR, and NOT flips a single input.
Truth table for A, B = 00, 01, 10, 11 — AND: 0 0 0 1; OR: 0 1 1 1; NAND: 1 1 1 0; NOR: 1 0 0 0; XOR: 0 1 1 0; XNOR: 1 0 0 1.
The formula
| Symbol | Meaning |
|---|---|
| Input A (0: 0 (LOW); 1: 1 (HIGH)) | |
| Input B (0: 0 (LOW); 1: 1 (HIGH)) | |
| XOR (A ⊕ B) |
Worked example
| Input A | 1 (HIGH) |
|---|---|
| Input B | 0 (LOW) |
| AND (A · B) | 0 (LOW) |
|---|---|
| OR (A + B) | 1 (HIGH) |
| NAND | 1 (HIGH) |
| NOR | 0 (LOW) |
| XNOR | 0 (LOW) |
| NOT A | 0 (LOW) |
XOR (A ⊕ B) 1 (HIGH)
Each step uses the unrounded value of the step before it; figures on this page are rounded for display.
Frequently asked questions
What is 1 XOR 1?
0. XOR outputs 1 only when the two inputs differ.
Why are NAND gates called universal?
Any other logic function can be built from NAND gates alone, for example NOT A = A NAND A.