Digital Logic Gate Simulator illustration

Digital Logic Gate Simulator

A digital circuit sandbox in your browser: place input switches, LEDs, the seven classic gates (AND, OR, NOT, NAND, NOR, XOR, XNOR), D flip-flops and a clock on a grid, then click pin to pin to draw wires. The circuit simulates continuously — wires glow green when carrying a 1 — and simple feedback circuits like a cross-coupled NAND SR latch settle correctly rather than crashing the simulator. Loadable presets build a half adder, full adder, 2:1 multiplexer, SR latch, D flip-flop demo and a 4-bit ripple counter for you, each worth studying wire by wire. A truth-table generator sweeps every input combination of a combinational circuit and tabulates the outputs automatically.

Runs 100% in your browser — nothing you paste leaves your device.

Notes

  • Evaluation runs repeated relaxation passes until the network stabilizes. Feedback loops with an even number of inversions (latches) settle to a stable state; a loop like a NOT gate feeding itself never settles and is flagged as oscillating.
  • The D flip-flop is edge-triggered: it samples D at the instant its clock input rises and holds Q until the next rising edge. Chain Q̄ back to D and it divides the clock frequency by two — stack four and you have the ripple counter preset.
  • An SR latch from two cross-coupled NANDs is the simplest possible memory: one bit stored purely in the feedback loop, no clock needed.
  • The truth-table generator only works for clock-free combinational circuits, and caps at 6 switches (64 rows) to stay instant.
  • Runs 100% in your browser — nothing you paste leaves your device.