Truth Table Generator
Truth Table Generator
Enter a logical expression using variables A, B, C, D and logical operations. The generator will automatically create a complete truth table with all possible combinations.
Supported Operations:
- AND (&, *): Logical "AND" - returns true if both operands are true
- OR (|, +): Logical "OR" - returns true if at least one operand is true
- NOT (!,~): Logical "NOT" - inverts the operand value
- XOR (^): Exclusive "OR" - returns true if operands are different
- NAND: "NOT-AND" - inversion of AND operation
- NOR: "NOT-OR" - inversion of OR operation
Expression Examples:
- A & B (A and B)
- A | B (A or B)
- !A (not A)
- A ^ B (A XOR B)
- (A & B) | C
- !(A & B)
How it works:
The truth table generator evaluates your logical expression for all possible combinations of input values. For n variables, there are 2^n rows in the truth table.
Applications:
- Digital circuit design
- Computer science logic courses
- Boolean algebra verification
- Logic gate analysis
- Programming conditional statements
Frequently Asked Questions
What is a truth table?
A truth table is a mathematical table that shows the result of a logical operation for all possible combinations of input values.
Which logical operations are supported?
Basic logical operations are supported: AND (&), OR (|), NOT (!), XOR (^), NAND and NOR. You can also use parentheses for grouping.
How many variables can I use?
You can use up to 4 variables (A, B, C, D). For more variables, the table becomes too large to display effectively.
How do I enter complex expressions?
Use parentheses for grouping operations, for example: (A & B) | (C & D). Operation precedence: parentheses, NOT, AND, XOR, OR.
What's the difference between NAND and NOR?
NAND is NOT-AND (outputs false only when both inputs are true), NOR is NOT-OR (outputs true only when both inputs are false).