ECParts Toolkit LogoECParts Toolkit

Logic Gate Truth Table Calculator

Generate standard Boolean truth tables for AND, OR, NOT, NAND, NOR, XOR, and XNOR gates. Use it to check logic behavior, compare gate outputs, and evaluate custom input combinations.

DIG-001 models ideal Boolean logic only. It does not calculate analog voltage thresholds, propagation delay, power consumption, noise margin, FPGA implementation, HDL output, or timing closure.

Engineering tool

Logic Gate Truth Table Calculator

Generate truth tables, Boolean expressions, gate descriptions, comparisons, and custom input results for standard digital logic gates.

Calculator mode

Select the primary Boolean logic gate.

NOT is limited to one input. Other gates support two, three, or four inputs.

Result console

Number of Combinations
4rows
Boolean Expression
A · B
Gate Type
AND
Input Count
2inputs
AND gate outputs HIGH only when all inputs are HIGH.

Truth table

AND truth table
Input AInput BOutput
000
010
100
111

This calculator models ideal Boolean logic states only. Real hardware uses voltage thresholds, timing limits, loading, and noise margins.

Formula reference

Logic Gate Boolean Definitions

The calculator uses standard Boolean definitions and generates every input combination from 2^n rows.

AND: Y = A · BOR: Y = A + BNOT: Y = ¬ANAND: Y = ¬(A · B)NOR: Y = ¬(A + B)XOR: Y = A ⊕ BXNOR: Y = ¬(A ⊕ B)Truth table rows = 2^n

Variable definitions

A, B, C, D
Boolean input states
Y
Boolean output state
0
LOW logic state
1
HIGH logic state
n
number of Boolean inputs
Truth table
complete input and output mapping

Worked Examples

AND 2-input

A · B outputs 1 only for input combination A=1, B=1.

OR 2-input

A + B outputs 1 when A=1, B=1, or both are 1.

NOT

¬A inverts the input, so 0 becomes 1 and 1 becomes 0.

NAND

¬(A · B) is the inverse of AND and outputs 0 only when both inputs are 1.

NOR

¬(A + B) is the inverse of OR and outputs 1 only when all inputs are 0.

XOR

A ⊕ B outputs 1 when the two inputs are different.

XNOR

¬(A ⊕ B) outputs 1 when the two inputs are the same.

3-input AND

A · B · C outputs 1 only when A=1, B=1, and C=1.

Compare XOR and XNOR

XOR and XNOR differ for every 2-input combination because one is the inverse of the other.

Custom evaluation

For XOR with A=1 and B=0, the logic result is 1.

Engineering Notes

  • A truth table describes all possible input combinations for a Boolean function.
  • Digital logic normally uses binary states: LOW as 0 and HIGH as 1.
  • Real hardware has voltage thresholds, not perfect mathematical 0 V and 1 V states.
  • This calculator models Boolean behavior only and does not model propagation delay, power, loading, or noise margin.
  • Input count changes truth-table size by powers of two. A 4-input gate has 16 input combinations.
  • NAND and NOR gates are inverted outputs of AND and OR functions.
  • Two-input XOR is different from OR because XOR is LOW when both inputs are HIGH.
  • Multi-input XOR is treated as odd parity, where the output is HIGH when an odd number of inputs are HIGH.

Common Mistakes

  • Confusing XOR and OR.
  • Forgetting that NAND and NOR are inverted-output gates.
  • Assuming XOR and OR are identical for every input combination.
  • Ignoring that each additional input doubles the truth-table row count.
  • Treating Boolean 0 and 1 as exact analog voltage levels.
  • Using ideal truth tables as a substitute for hardware timing analysis.

Support reference

FAQ

What is a truth table?

A truth table lists every possible input combination for a logic function and shows the resulting output for each combination.

How does an AND gate work?

An AND gate outputs 1 only when all of its inputs are 1. If any input is 0, the output is 0.

What is the difference between XOR and OR?

OR outputs 1 when at least one input is 1. Two-input XOR outputs 1 only when the inputs are different.

What is NAND gate?

A NAND gate is the inverse of an AND gate. It outputs 0 only when all inputs are 1.

What is NOR gate?

A NOR gate is the inverse of an OR gate. It outputs 1 only when all inputs are 0.

What is XNOR gate?

A two-input XNOR gate outputs 1 when both inputs are the same. It is the inverse of XOR.

How many rows are in a truth table?

A truth table has 2^n rows, where n is the number of Boolean inputs.

Can this calculate real gate timing?

No. This calculator models ideal Boolean behavior only. Propagation delay and setup or hold timing belong to digital timing analysis.

What is Boolean logic?

Boolean logic is a mathematical system that uses true and false states, commonly represented as 1 and 0 in digital electronics.

Why are digital signals represented as 0 and 1?

Digital circuits use two logical states because binary representation provides robust switching behavior and simple logic composition. Real hardware maps those states to voltage thresholds.

Boolean Logic Calculator

Coming_Soon

Planned calculator for evaluating Boolean expressions and generated truth tables.

Karnaugh Map Simplifier

Coming_Soon

Planned calculator for minterms, don't-care terms, K-map grids, and simplified SOP output.

Flip-Flop Calculator

Coming_Soon

Planned calculator for SR, JK, D, and T flip-flop state transitions and characteristic tables.

Digital Timing Calculator

Coming_Soon

Planned calculator for setup margin, hold margin, clock period, and maximum clock frequency.

Hex Decimal Binary Converter

Available

Convert number bases and inspect bit patterns without duplicating Digital Logic calculator scope.

Planned guide topics for digital logic gates and Boolean design:

  • - Logic Gates Explained
  • - Boolean Algebra Basics
  • - Truth Tables in Digital Electronics
  • - XOR and XNOR Applications
  • - Logic Gate Applications

Engineering Disclaimer

This calculator provides ideal Boolean truth tables. Verify real hardware behavior with component datasheets, voltage thresholds, timing specifications, loading, and lab measurements.