Digital Logic Simulator
untitled.json

Digital Logic Simulator Guide

Build and simulate AND, OR, NOT, NAND, NOR, XOR gates and more — drag from the palette, wire them together, press Run.

1. Palette

  • I/O: Input, Output, Clock, Logic 1 / Logic 0 constants, LED, 7-segment display.
  • Gates: AND, NAND, OR, NOR (each has a ▾ flyout for a 3-input variant), XOR, XNOR, NOT, BUF, tri-state buffer, 2:1 and 4:1 multiplexers.
  • Arithmetic: Half Adder, Full Adder.
  • MSI: 2-to-4 and 3-to-8 decoders, 4-to-2 encoder, 4-bit counter.
  • Sequential: D, T, JK, SR, and gated-SR flip-flops; D-latch.
  • Click any palette button to drop that block onto the canvas.

2. Connecting gates with wires

  • Hold and pull: put the pointer on the outer end of a gate's pin stub (a small blue dot appears), hold the button (or your finger) down, pull the wire across to the destination pin, and let go — the connection is made.
  • Everything sits on the grid: gates, pins and wire corners all snap to the background dots, so wires between lined-up pins come out perfectly straight and end exactly on the pin.
  • Or wire hands-free: tap a pin once and release. The loose wire end now follows your bare cursor around the canvas — no button held. A click on the destination pin completes the connection; a click on blank canvas plants a corner exactly where you want one. Escape or a right-click abandons the wire.
  • Corners take care of themselves: whenever your path turns, the wire folds into a clean right angle on its own, and the loose end jumps onto any legal pin as soon as you come near it.
  • Dashed alignment guides appear while dragging a gate when one of its pins lines up exactly with another gate's pin — release near the guide for a straight run.
  • Fan-out: drop a second wire onto an existing one from the same source pin — a junction dot marks the true branch point.

3. Editing

  • Select a block or wire, then press Delete/Backspace, or right-click / long-press for a context menu: Delete, Duplicate, rotate (gates), or set LED colour.
  • Cmd/Ctrl+Z undo, Cmd/Ctrl+Shift+Z (or Cmd/Ctrl+Y) redo.
  • Double-click a gate with a ▾ variant (AND/NAND/OR/NOR) to switch between its 2- and 3-input form.

4. Running the simulation

  • ▶ Run evaluates the circuit. Click Input blocks to toggle 0/1 while running; LED and 7-Seg blocks update live.
  • While running, every wire carrying a 1 lights up green, so you can follow a signal through the circuit at a glance. Wires at 0 keep their normal colour, and a disabled tri-state output (Z) shows as a dashed purple line.
  • Gates are ideal: every output changes at the same instant as its inputs, with no propagation delay. Signals are only 0 or 1 — an unconnected input reads as 0, and flip-flops start with Q = 0. The one exception is a tri-state buffer, whose output is Z (high-impedance) while it is disabled.
  • Setting S = R = 1 on an SR latch (or S' = R' = 0 on an S'R' latch) is the forbidden state: both Q and Q' go to 0 and a note on the canvas explains why. A feedback loop that never settles, such as a NOT gate wired to its own input, is stopped and reported the same way.
  • ■ Stop ends the run and returns to editing.

5. Waveforms, truth tables & Boolean expressions

The panel below the canvas has three tabs, all computed from your circuit automatically:

  • Waveform: a timing diagram of every net. Use Play / pause and the speed selector to step through the circuit one change at a time.
  • Truth Table: every input combination and the resulting outputs, generated from the circuit's logic — click a row to preview it live on the canvas.
  • Expressions: the minimised Boolean sum-of-products (SOP) for each output, with a Karnaugh map.

If a run finds a wiring problem (an unconnected input, two outputs driving one wire), a note appears at the top right of the canvas so you can fix it before it causes a "Truth Table unavailable" state. Close it with ✕.

6. Files & examples

  • File ▾: New, Open, Save / Save As (native file picker on Chromium; download fallback elsewhere), Import / Export JSON.
  • Cmd/Ctrl+S quick-saves to the currently open file.
  • Examples ▾: load a ready-made circuit — basic gates, adders, decoders, counters — to explore or build on.
  • Your circuit auto-saves to the browser locally as you work — nothing leaves the device.

Keyboard shortcuts

Del / Backspace
Delete selected block or wire
Esc
Cancel current wire draw
Cmd/Ctrl+Z
Undo
Cmd/Ctrl+Shift+Z
Redo
Cmd/Ctrl+S
Save