CS With NehalCS With Nehal

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

OUT = ((A · B) + C)

All inputs are on the left. All selected outputs are drawn on the right. Hover over a gate to see its Boolean expression.

Inputs

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.

A = 0 (click to change)A0B = 0 (click to change)B0C = 0 (click to change)C0(A · B)AB((A · B) + C)CAND gate: (A · B)ANDOR gate: ((A · B) + C)OROUTOUT

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.

MintermABC(A · B)((A · B) + C)OUT
m0000000
m1001011
m2010000
m3011011
m4100000
m5101011
m6110111
m7111111

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

  1. Write the Boolean expression for each output, for example F = A·B + C'.
  2. The truth table lists every combination of inputs (2ⁿ rows for n inputs) and the output for each.
  3. The minterms (rows where the output is 1) give the canonical SOP form; the maxterms (rows where it is 0) give the POS form.
  4. A Karnaugh map groups adjacent 1s in groups of 1, 2, 4 or 8 to find the simplest SOP expression.
  5. 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