Truth Table Generator
Key Features:
- Supports basic logical operators (AND/&, OR/|, NOT/~)
- Handles multiple variables (up to 5 recommended)
- Step-by-step solution explanation
- Error handling
Keyboard-Friendly Symbols:
- AND: Use & (e.g., A & B)
- OR: Use | (e.g., A | B)
- NOT: Use ~ (e.g., ~A)
How to Use Truth Generator Tool:
- Input Variables:
- Enter variables as a comma-separated list (e.g., A,B,C).
- Input Expression:
- Use & for AND, | for OR, and ~ for NOT.
- Example: (A & B) | ~C
- Generate Table:
- Click "Generate Table" to see the truth table.
How It Works:
- Input Parsing:
- Variables entered as comma-separated list (e.g., "A,B,C")
- Expression using logical symbols (&, |, ~)
- Truth Table Generation:
- Creates all possible combinations (2^n rows)
- Evaluates expression for each combination
- Converts logical operators to JavaScript equivalents
Step-by-Step Process:
- For 2 variables (A, B):
- Generates 4 combinations (TT, TF, FT, FF)
- For expression A & B:
- Evaluates AND for each combination
- Only true when both A and B are true
Example Input and Output
Example Input:
- Variables: A,B
- Expression: A & B
Example Output Table:
A B Result (A & B)
T T T
T F F
F T F
F F F