PublicSoftTools
Tools6 min read

Logic Gate Simulator — Build and Test Digital Circuits Online

Logic gates are the fundamental building blocks of every digital computer. This guide covers all seven gate types, boolean algebra, and how to build real circuits using the free online logic gate simulator.

The 7 Logic Gates You Need to Know

GateSymbolOutput is HIGH when...Boolean
ANDD-shape with flat backBoth inputs are HIGHA · B
ORCurved D-shapeAt least one input is HIGHA + B
NOTTriangle with bubbleInput is LOW (inverts)Ā
XOROR with extra curveInputs are differentA ⊕ B
NANDAND with bubbleNOT both inputs HIGHNOT(A · B)
NOROR with bubbleBoth inputs are LOWNOT(A + B)
BUFFERTriangle without bubbleInput is HIGH (copies)A

How to Use the Logic Gate Simulator

  1. Open the Logic Gate Simulator
  2. Click a gate type button (AND, OR, NOT, etc.) to add it to the canvas
  3. Switch to Connect mode and click an output port, then an input port to wire gates together
  4. Click input nodes (A, B) to toggle them between 0 and 1 — green wires carry HIGH signal
  5. Switch to Delete mode to remove gates or wires

Building a Half Adder

A half adder adds two single bits and produces a Sum and a Carry output. It requires exactly two gates:

Connect inputs A and B to both an XOR gate (for Sum) and an AND gate (for Carry). Test all four input combinations to verify: 0+0=0 carry 0, 0+1=1 carry 0, 1+0=1 carry 0, 1+1=0 carry 1.

Universal Gates: NAND and NOR

Both NAND and NOR are universal gates — any logic circuit can be built using only one type. This is practically important for chip manufacturing, where using a single gate type simplifies fabrication.

Building AND from NAND gates

AND = NAND followed by a NOT (which is itself a NAND with both inputs tied together). Three NAND gates can implement any two-input AND gate.

De Morgan's theorem verification

De Morgan's laws state: NOT(A AND B) = (NOT A) OR (NOT B). Build this in the simulator: compare a NAND gate to a circuit with two NOT gates feeding an OR gate. Both should produce identical outputs for all input combinations.

Boolean Algebra Reference

LawAND formOR form
IdentityA · 1 = AA + 0 = A
NullA · 0 = 0A + 1 = 1
IdempotentA · A = AA + A = A
ComplementA · Ā = 0A + Ā = 1
De MorganNOT(A·B) = Ā+B̄NOT(A+B) = Ā·B̄

Common Questions

What is the difference between XOR and OR?

OR is HIGH when at least one input is HIGH (including when both are HIGH). XOR (exclusive OR) is HIGH only when exactly one input is HIGH — it outputs LOW when both inputs are HIGH. XOR is used in binary addition and parity checking.

Why is NAND more commonly used than AND in hardware?

NAND gates are slightly faster to fabricate in CMOS technology and consume less power. Since any logic can be built from NAND gates alone, chip designers often standardise on them for efficiency.

Can I simulate combinational and sequential circuits?

The simulator supports combinational logic (no memory, output depends only on current inputs). Sequential circuits (flip-flops, registers, counters) require feedback loops with clock signals, which are beyond the scope of this tool.

Try the Logic Gate Simulator

Build and test your own digital circuits in the Logic Gate Simulator — drag-and-drop gates, wire them together, and toggle inputs in real time.

Open Logic Gate Simulator