Logic Gate Calculator
Evaluate the output of standard logic gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) for given inputs.
About Logic Gate Calculator
Logic gates are the building blocks of digital circuits. Each gate performs a specific boolean operation on one or two binary inputs to produce a single binary output.
Formulas
AND
A AND B = 1 iff A=1 and B=1
- A,B
- Binary inputs (0 or 1)
XOR
A XOR B = 1 iff A≠B
- A,B
- Binary inputs
Worked example
With the default values below, Logic Gate Calculator returns Output of 0. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Gate Typeone of AND, OR, NOT, NAND, NOR, XOR, XNOR
- AND
- Input Aone of 0 (False), 1 (True)
- 1 (True)
- Input Bone of 0 (False), 1 (True)
- 0 (False)
Results
- Output
- 0
- Gate Description
- Output is 1 only when both inputs are 1
Step by step
- 1Values used
- 2AND
- 3XOR
- 4Output= 0
- 5Gate Description= Output is 1 only when both inputs are 1
Assumptions and limits
- The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
What is a universal gate?
NAND and NOR are each universal — any boolean function can be built using only NAND gates or only NOR gates.
What is the difference between XOR and XNOR?
XOR outputs 1 when inputs differ. XNOR (equivalence gate) outputs 1 when inputs are the same. They are complements.
