Logic Gate Truth Table Generator + K-Map and SOP Simplifier

Truth Table Generator

Logic gates & custom boolean expressions · K-map · SOP simplification

Operators: . or AND, + or OR, ' or ! or NOT, ^ or XOR. Variables A–Z (2–4 unique). Parentheses OK. e.g. (A+B).C'

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:

  1. Select Single Gate mode, choose the gate type (AND, OR, NOT, NAND, NOR, XOR, or XNOR).
  2. Select the number of inputs (2, 3, or 4).
  3. Choose the symbol style – ANSI/MIL or IEC (rectangular).
  4. View the generated gate symbol and truth table instantly.

For a Custom Expression:

  1. Select Custom Expression mode.
  2. Type your expression using operators: ./AND, +/OR, '/!/NOT, ^/XOR (e.g., (A+B).C').
  3. Or click an example chip to try a sample expression.
  4. 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 nn variables, the tool generates all 2n2^n 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)

1. How do I create a truth table for a custom boolean expression?

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.

2. What is a Karnaugh map (K-map) used for?

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.

3. What does “Sum-of-Products (SOP)” simplification mean?

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.

4. ANSI vs IEC logic gate symbols – what’s the difference?

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.

5. How many variables can I use in a custom boolean expression?

This tool supports custom expressions with 2 to 4 unique variables (A through Z), with parentheses for grouping terms in any combination.


Related Tools

Read More>>>

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top