Ad Space — Top Banner

Truth Table Generator

Generate truth tables for logical expressions with AND, OR, NOT, XOR, NAND, and NOR operations.
Perfect for computer science and discrete math.

Truth Table

Boolean Logic Operations Boolean logic works with two values: True (1) and False (0). The fundamental operations combine these values in specific ways. Every digital circuit, programming condition, and logical argument uses these operations.

AND (conjunction): Returns True only when ALL inputs are True. Written as A AND B, A & B, or A * B. In a truth table: 0&0=0, 0&1=0, 1&0=0, 1&1=1. Think of it as “both must be true.”

OR (disjunction): Returns True when ANY input is True. Written as A OR B, A | B, or A + B. In a truth table: 0|0=0, 0|1=1, 1|0=1, 1|1=1. Think of it as “at least one must be true.”

NOT (negation): Flips the value. Written as NOT A or !A. NOT 0 = 1, NOT 1 = 0.

XOR (exclusive or): Returns True when inputs DIFFER. Written as A XOR B or A ^ B. 0^0=0, 0^1=1, 1^0=1, 1^1=0. Think of it as “exactly one must be true.”

NAND (not-and): The opposite of AND. Returns False only when all inputs are True. NAND is “universal” — any other gate can be built from NAND gates alone. This is why NAND flash memory uses this gate type.

NOR (not-or): The opposite of OR. Returns True only when all inputs are False. NOR is also universal — the Apollo Guidance Computer was built entirely from NOR gates.

Truth Table Construction For N variables, a truth table has 2^N rows. Each row represents one possible combination of True/False values for all variables. The rows are typically listed in binary counting order (000, 001, 010, 011, …).

Practical Applications Circuit design uses truth tables to define the behavior of digital logic gates. Programming uses boolean logic in every if/else statement. Database queries use AND, OR, NOT in WHERE clauses. Mathematical proofs in discrete math rely on logical equivalence via truth tables.


Ad Space — Bottom Banner

Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.