PublicSoftTools

Logic Gate Simulator — Build Digital Circuits

Drag and drop AND, OR, NOT, XOR, NAND, NOR, and BUFFER gates onto a canvas. Wire them together and toggle input signals to see how logic propagates through your circuit in real time. No signup, runs entirely in your browser.

Add:
A1B0ANDOROut10Out20
Signal HIGH (1) Signal LOW (0)Click an Input node to toggle it. Click a wire to delete it.

How to Use the Logic Gate Simulator

  1. 1Drag gates (AND, OR, NOT, XOR, NAND, NOR, BUFFER) and input nodes onto the canvas.
  2. 2Switch to Connect mode, click an output, then click a destination input port to wire them.
  3. 3Click input nodes to toggle 0/1; green wires carry HIGH, grey carry LOW.
  4. 4Use Delete mode to remove a gate or wire and iterate on your design.

Worked Example: Building a Half Adder

A half adder adds two single bits, A and B, and produces two outputs: a Sum and a Carry. Place two input nodes and wire both into an XOR gate — that output is the Sum, because XOR is 1 only when the inputs differ (0+0=0, 0+1=1, 1+0=1, 1+1=0 with a carry). Wire the same two inputs into an AND gate — that output is the Carry, which is 1 only when both bits are 1. Toggle the inputs through all four combinations and read the outputs: 1+1 gives Sum 0, Carry 1 — binary for 2, exactly right.

That two-gate circuit is the atom of all binary arithmetic: chain a full adder (which adds a carry-in too) eight times and you have a byte adder, the core of an ALU. The simulator is also the fastest way to see that NAND is universal — build a NOT from a single NAND by tying its inputs together, then an AND from two NANDs, and you can reconstruct every other gate. That is why real chips are fabricated largely from one repeated NAND cell.

Tips for Building Logic Circuits

Build a half adder

A half adder adds two single bits. Connect A and B to an XOR gate for the Sum output and to an AND gate for the Carry output. This is the fundamental building block of binary arithmetic.

De Morgan's theorem

De Morgan's law states: NOT(A AND B) = (NOT A) OR (NOT B). You can verify this using a NAND gate and comparing its output to two NOT gates feeding an OR gate — both produce the same truth table.

Universal gates

NAND and NOR are universal gates — any logic function can be implemented using only NAND gates or only NOR gates. This matters for chip manufacturing where a single gate type simplifies fabrication.

Read with the truth table

Use the Truth Table Generator tool to verify complex expressions. Build the circuit here, record the outputs for all input combinations, then compare to the expected truth table.

Frequently Asked Questions

What logic gates are supported?

The simulator supports AND, OR, NOT, XOR, NAND, NOR, and BUFFER gates. NOT and BUFFER are single-input gates; all others take two inputs.

How do I connect gates?

Switch to Connect mode, click the output node (source), then click the input port of the destination gate. Green wires carry a HIGH (1) signal; grey wires carry LOW (0).

How do I toggle an input signal?

Click any input node (the rectangular nodes labelled A, B, etc.) to toggle it between 0 and 1. The circuit updates immediately and signal propagation is shown through wire colours.

Can I delete a wire or gate?

Yes. Switch to Delete mode and click any gate node or wire to remove it. Connected wires are also removed when you delete a gate.

What is a NAND gate?

A NAND gate is a NOT + AND combination. Its output is HIGH unless both inputs are HIGH. NAND gates are universal — any logic function can be built entirely from NAND gates.

Is this suitable for CS coursework?

Yes. The simulator is designed for learning digital logic at A-level and undergraduate level. You can build combinational circuits like half adders, multiplexers, and decoders.