Logic Gate Circuit Builder
Build simple logic circuits, truth tables, K-maps, and simplify boolean expressions
Number of Outputs
Default is one output. You can use up to 6 outputs. Supported operators: AND, OR, NOT, NAND, NOR, XOR, +, ·, *, !, ~, apostrophe notation, and brackets.
Quick Examples
Output Expression
Variables
A, B, C
3 input variable(s)
Rows
8
2^3 combinations
Simplified OUT
C + AB
Final equation
Boolean Algebraic Form
All inputs are on the left. All selected outputs are drawn on the right. Hover over a gate to see its Boolean expression.
Click A, B, C on the diagram (or the buttons above) to switch an input between 0 and 1, or click a row of the truth table to load its inputs. Click a wire to highlight it.
The purple columns show the output of each gate (sub-expression) on the way to the final output. Click a row to load its inputs into the circuit.
| Minterm | A | B | C | (A · B) | ((A · B) + C) | OUT |
|---|---|---|---|---|---|---|
| m0 | 0 | 0 | 0 | 0 | 0 | 0 |
| m1 | 0 | 0 | 1 | 0 | 1 | 1 |
| m2 | 0 | 1 | 0 | 0 | 0 | 0 |
| m3 | 0 | 1 | 1 | 0 | 1 | 1 |
| m4 | 1 | 0 | 0 | 0 | 0 | 0 |
| m5 | 1 | 0 | 1 | 0 | 1 | 1 |
| m6 | 1 | 1 | 0 | 1 | 1 | 1 |
| m7 | 1 | 1 | 1 | 1 | 1 | 1 |
About This Simulation
This logic gate simulator turns Boolean expressions into truth tables, logic circuits and simplified forms. Enter up to six outputs and see the SOP and POS forms, K-maps and simplification steps for each.
Features
- Up to 6 output expressions at once
- Operators AND, OR, NOT, NAND, NOR, XOR and symbols such as + and ·
- Truth tables generated automatically
- Combined and separate logic circuit diagrams
- Sum of Products (SOP) and Product of Sums (POS) forms
- Karnaugh map simplification steps
Explanation
Logic gates are the building blocks of digital circuits. Each gate takes one or more binary inputs and produces an output: AND outputs 1 only when all inputs are 1, OR outputs 1 when any input is 1, NOT inverts its input, and NAND, NOR and XOR are combinations of these.
How it works
- Write the Boolean expression for each output, for example F = A·B + C'.
- The truth table lists every combination of inputs (2ⁿ rows for n inputs) and the output for each.
- The minterms (rows where the output is 1) give the canonical SOP form; the maxterms (rows where it is 0) give the POS form.
- A Karnaugh map groups adjacent 1s in groups of 1, 2, 4 or 8 to find the simplest SOP expression.
- The simplified expression is drawn as a circuit with fewer gates.
Why it matters
Logic gates and Boolean simplification are the foundation of digital logic design, used in every processor and digital device. They are core topics in CSE230 and CSE260 as well as IGCSE, O Level and A Level Computer Science.
Frequently Asked Questions
What are the universal logic gates?
NAND and NOR are universal gates: any Boolean function, including AND, OR and NOT, can be built using only NAND gates or only NOR gates.
What is the difference between SOP and POS?
Sum of Products (SOP) is an OR of AND terms, built from the rows where the output is 1. Product of Sums (POS) is an AND of OR terms, built from the rows where the output is 0.
How does a Karnaugh map simplify an expression?
Neighbouring cells in a K-map differ in only one variable. Grouping adjacent 1s in powers of two removes the variable that changes within the group, giving a simpler term.
How many rows does a truth table have?
A truth table with n inputs has 2ⁿ rows, one for each input combination.
Topics covered
- Logic Gates
- Boolean Algebra
- Truth Tables
- Karnaugh Maps (K-Maps)
- SOP and POS
- Combinational Circuits
Tags
- and
- or
- not
- nand
- nor
- xor
- truth table
- karnaugh map
- k map
- sop
- pos
Related Simulations
Number Systems
Number System Converter
Convert between binary, decimal, hex, octal
Number Systems
Two's Complement Simulator
Convert between denary and two's complement binary, with the invert-and-add-one steps and the negative place value shown.
Number Systems
Bitwise Operations Simulator
Apply AND, OR, XOR, NOT, logical and arithmetic shifts and rotations to 8-bit values, and use masks to set, clear and test bits.
Number Systems
Number System Operations
Add, subtract and multiply two or more numbers in binary, octal, denary or hexadecimal, with carries, borrows, overflow and underflow shown.

