Truth Table Generator
Logic gates & custom boolean expressions · K-map · SOP simplification
Simplification uses a prime-implicant (Quine–McCluskey style) method and returns a minimal Sum-of-Products. Multiple equally-minimal forms can exist; the K-map grouping shown is one valid cover.
Logic Gate Truth Table Generator: Gates, Custom Expressions, K-Map and SOP Simplification
Whether you’re studying a single logic gate or simplifying a complex boolean expression, building the truth table and Karnaugh map by hand takes time. This tool builds truth tables instantly for standard gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) with 2 to 4 inputs, complete with ANSI/MIL or IEC-style gate symbols. A Custom Expression mode lets you type any boolean expression and get its full truth table, an auto-generated Karnaugh map with grouping shown and the simplified Sum-of-Products (SOP) expression.
How to Use
For a Single Gate:
- Select Single Gate mode, choose the gate type (AND, OR, NOT, NAND, NOR, XOR, or XNOR).
- Select the number of inputs (2, 3, or 4).
- Choose the symbol style – ANSI/MIL or IEC (rectangular).
- View the generated gate symbol and truth table instantly.
For a Custom Expression:
- Select Custom Expression mode.
- Type your expression using operators:
./AND,+/OR,'/!/NOT,^/XOR (e.g.,(A+B).C'). - Or click an example chip to try a sample expression.
- Click Generate Table & K-map to see the full truth table, K-map with grouping and simplified SOP expression.
Key Features
- Instant truth tables for 7 standard gates with 2, 3, or 4 inputs
- Toggle between ANSI/MIL and IEC gate symbol styles
- Custom boolean expression parser supporting multiple notations
- Supports 2-4 unique variables with parentheses for grouping
- Auto-generated Gray-code Karnaugh map with visual grouping overlay
- Simplified SOP expression using a prime-implicant (Quine-McCluskey style) method
- Ready-made example expressions to try instantly
- Export as PDF or copy the result
Formula / Logic Used
Truth Table Generation
For an expression with variables, the tool generates all input combinations and evaluates the expression for each row, following standard precedence: NOT, then AND, then OR (with parentheses respected).
Karnaugh Map
Outputs are mapped onto a grid where adjacent cells differ by only one variable (Gray-code ordering), making it visually easy to spot groups of 1s that can be simplified.
Simplified SOP
The tool uses a prime-implicant method (similar to Quine-McCluskey) to find the minimal set of product terms covering all “1” outputs, then shows the resulting simplified expression with the K-map grouping that produced it.
Note: more than one equally-minimal SOP can exist for the same truth table – the grouping shown is one valid, correct simplification.
Who Should Use This Tool
Diploma and B.Tech ECE/Electrical students learning digital logic, truth tables and boolean simplification. Also useful for anyone verifying a hand-drawn K-map before an exam or assignment.
Frequently Asked Questions (FAQs)
Type your expression using standard operators (. for AND, + for OR, ' for NOT) with variables (A, B, C, etc.) and click Generate Table and K-map. The tool evaluates every possible input combination automatically.
A K-map is a visual grid of a truth table’s outputs (Gray-code ordered) that makes it easy to spot groups of adjacent 1s, which can then combine into a simpler boolean expression. This tool auto-generates the K-map with the grouping used.
SOP simplification finds the shortest possible expression (as a sum of AND terms) that still produces the exact same truth table output as the original. This tool calculates the minimal SOP form using a prime-implicant method.
ANSI (MIL) symbols use distinct traditional shapes for each gate (curved OR, D-shaped AND), while IEC symbols use uniform rectangular boxes with a function label inside. This tool lets you toggle between both for the same gate.
This tool supports custom expressions with 2 to 4 unique variables (A through Z), with parentheses for grouping terms in any combination.
Related Tools
- Op-Amp Gain/Filter Designer – useful for the analog side of a mixed-signal design
- Electrical Symbol Finder – find matching schematic symbols for your logic gates
- RLC Color Code Calculator – verify component values used alongside digital logic circuits