DevTools Logo

Digital Logic Gate & Circuit Simulator

About this tool

The Logic Gate & Circuit Simulator runs a real discrete-event simulation, not a static truth-table evaluator. Every gate, latch and flip-flop has a propagation delay; changes ripple through the netlist as timed events on a priority queue, so you can watch a signal actually take several ticks to cross a chain of gates the way it would on real silicon.

Signals carry four values — 0, 1, Z (high-impedance) and X (unknown/conflict) — so tri-state buffers and driver conflicts behave correctly: two outputs fighting over the same net are detected and flagged rather than silently resolved to whichever wire was drawn last.

Beyond gates (AND/OR/NAND/NOR/XOR/XNOR/NOT/BUFFER/TRISTATE), the palette includes SR and D latches, D flip-flops with configurable clock edge, 2:1 and 4:1 multiplexers, switches and clocks as sources, and OUTPUT/seven-segment sinks — enough to wire adders, counters and small state machines from scratch.

For purely combinational circuits, the tool derives a full truth table and a Karnaugh map with Quine-McCluskey minimization, giving you both the brute-force behavior and the simplified Boolean expression side by side.

When you're ready to leave the browser, export the circuit as Verilog, VHDL, an annotated JSON netlist (with a documented schema for round-tripping), or an SVG schematic reflecting live signal colors.

How to use

  1. Place components

    Click a palette entry, then click the canvas to drop it; click again to cancel placement.

  2. Wire pins

    Click an output pin, then an input pin, to connect them; clicking the same pin twice cancels the pending wire.

  3. Toggle inputs

    Click an INPUT switch to flip it between 0 and 1 while the simulation runs.

  4. Run or step

    Run advances the simulator continuously; Step advances exactly one event tick for precise timing inspection.

  5. Edit properties

    Select a component to adjust its propagation delay, input count, clock period or flip-flop edge in the side panel.

  6. Read the outputs

    Switch to the Truth Table or K-Map tab for combinational circuits, or Export for Verilog/VHDL/SVG/JSON.

Use cases

Digital logic coursework

Build the exact circuit from a homework problem and read off its truth table or minimized K-Map instead of hand-deriving both.

Interview prep

Prototype adders, muxes and small state machines live, then verify propagation and driver conflicts before whiteboarding them.

HDL bootstrapping

Sketch a small module visually, export Verilog or VHDL as a starting point, then continue in your normal toolchain.

Teaching tri-state buses

Deliberately create a driver conflict to show students what bus contention looks like and why enable lines matter.

Common mistakes

Mistake:Expecting a static truth table for clocked circuits

Fix:Circuits with CLOCK, DFF or latch elements depend on prior state and timing — the Truth Table tab warns and still shows a snapshot, but Step through the simulation instead to see real behavior.

Mistake:Wiring two outputs to the same input pin

Fix:Each input pin accepts one wire; to combine signals, use a gate (OR, MUX) or a tri-state bus with enable lines, not two direct wires.

Mistake:Ignoring propagation delay when reading the canvas

Fix:A newly wired gate doesn't show its output instantly — Step or Run to let the event queue settle before judging the result.

Mistake:Building more than 10 input variables

Fix:Truth tables and K-Maps cap at 10 and 6 input variables respectively (2^10 rows, readable K-Map grid) — beyond that, verify behavior by stepping the simulation instead.

Frequently asked questions

References & standards

Distributed Systems & Network Topology Simulator

Build a network topology from load balancers, API gateways, microservices, message queues, distributed databases and caches, then inject chaos — kill nodes, partition the network, packet loss, latency spikes, circuit breaker trips — and watch Raft leader election, split-brain and Hystrix-style breaker state react live. Export the topology as Docker Compose, Kubernetes manifests, Mermaid or PlantUML. Entirely client-side, educational simulation.

Typography Anatomy & Variable Font Lab

Load a TTF/OTF/WOFF/WOFF2 font and inspect glyph Bézier outlines, baseline/x-height/cap-height guides, kerning pairs, OpenType features and live variable-font axis sliders — export CSS @font-face, font-variation-settings and fallback metric overrides.

Pixel Art Sprite Studio

Draw retro pixel art on an 8x8 to 64x64 grid with pencil, flood-fill, ordered-dither and symmetry tools, curated PICO-8/Game Boy/NES/C64/Endesga-32 palettes, multi-layer compositing, and a frame timeline with onion skinning. Export static PNG, animated PNG, GIF, a sprite-sheet atlas (Pixi/Phaser/Godot/Unity JSON), or a CSS steps() animation snippet.

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

GLSL Shader Art & Visual FX Playground

A live GLSL fragment-shader laboratory running on WebGL2 with the full Shadertoy uniform set (iResolution, iTime, iTimeDelta, iFrame, iMouse, iChannel0..3). Write shaders with syntax highlighting and see them recompile on every keystroke, with compiler errors mapped back to your line numbers and highlighted in the editor, plus a live FPS counter. The gallery ships raymarched spheres, tori and a Mandelbulb fractal, Voronoi and FBM procedural noise, cyberpunk grids, plasma waves, a neon audio visualizer and matrix rain. Export any shader as Three.js ShaderMaterial code, a React Three Fiber component, a standalone single-file WebGL2 HTML page or plain GLSL — or record the canvas straight to WebM video. A Canvas2D plasma fallback keeps the tool usable where WebGL2 is unavailable.

Web Audio Modular Synthesizer & Sound FX Generator

A full synth voice designer running entirely in your browser: seven oscillator flavors (sine, saw, triangle, square with real PWM duty control, white/pink/brown noise), a visual ADSR envelope, resonant biquad filtering, an LFO routed to pitch, filter or gain, and an effects chain of tanh overdrive, stereo ping-pong delay and Schroeder reverb. Play the two-octave keyboard with your mouse, the printed computer keys (A W S E D…) or a Web MIDI controller, watch the live FFT spectrum and scrolling waterfall spectrogram, fire retro game SFX one-shots (jump, laser, coin, powerup, explosion, click), then export your sound as 8/16/24-bit WAV or as dependency-free Web Audio code you can paste into any project.