Skip to content
FiftyCalc Free calculators for all 50 states

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

Sample figures

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.

Logic Gate Calculator

Input A

Input A: choose 0 (LOW) or 1 (HIGH). Prefilled example: 1 (HIGH).

Input B

Input B: choose 0 (LOW) or 1 (HIGH). Prefilled example: 0 (LOW).

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Input A: choose 0 (LOW) or 1 (HIGH).
  2. Input B: choose 0 (LOW) or 1 (HIGH).
  3. Read the result: XOR (A ⊕ B); the panel also shows AND (A · B), OR (A + B), NAND, NOR, XNOR and NOT A.

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

  1. Xor={1if a≠b0otherwise
Symbols used in the formula
SymbolMeaning
aInput A (0: 0 (LOW); 1: 1 (HIGH))
bInput B (0: 0 (LOW); 1: 1 (HIGH))
XorXOR (A ⊕ B)

Worked example

Input A1 (HIGH)
Input B0 (LOW)
AND (A · B)0 (LOW)
OR (A + B)1 (HIGH)
NAND1 (HIGH)
NOR0 (LOW)
XNOR0 (LOW)
NOT A0 (LOW)
  1. Xor=1

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.

Related calculators