QiLing Tools

🔀Logic Circuit Simulator - Gates, Flip-Flops, Truth Tables

Build digital circuits in the browser: place switches, clocks, AND, OR, NOT, NAND, NOR, XOR and XNOR gates, an SR latch and D, JK and T flip-flops, wire them up, and watch LEDs and 7-segment displays respond in real time. For combinational circuits the tool lists the truth table and simplifies each output to a minimal sum of products with the Quine–McCluskey method. Sequential circuits can run their clock or step half a period at a time, with a timing diagram. Examples include half and full adders, a 4-bit adder, a multiplexer, a decoder, a counter and a traffic light, and the circuit lives in the URL so you can share it.

Free · No sign-up · Runs in your browserLast updated:

Loading tool...

How to use Logic Circuit Simulator

  1. 1Pick an example, or start from a blank canvas and use Add part to place switches, gates and LEDs
  2. 2Drag from one pin to another to draw a wire (on a phone you can also tap one pin, then the other)
  3. 3Tap switches to flip them between 0 and 1 and watch the wires, LEDs and displays change
  4. 4Read the truth table and minimal expression for combinational circuits; press Run clock for counters and check the timing diagram

FAQ

Why does my NOR-gate SR latch not oscillate?
Many simple simulators update every gate at once, which makes two cross-coupled NOR gates flip between 00 and 11 forever. This tool is event-driven: a gate is recomputed only when one of its inputs changes, and gates are evaluated one at a time, much like real gates whose delays always differ slightly. So the latch settles into one state. Oscillation is reported only for genuinely unstable circuits, such as a ring of an odd number of inverters.
How are the truth table and expression produced?
Every switch is treated as an input and every LED as an output. The tool applies all 2ⁿ input combinations, simulates each from a fresh start until it settles, and records each LED. For each output the rows that give 1 (the minterms) go through the Quine–McCluskey algorithm to find prime implicants and a minimum cover, giving the simplest sum of products. A bar over a letter means NOT; you can also copy the expression in ¬A ∧ B form and paste it into the truth table tool.
Why is there no truth table for some circuits?
A truth table describes a combinational circuit, whose outputs depend only on the present inputs. If the circuit contains a flip-flop, a latch, a clock or a feedback loop, the outputs also depend on what happened before: it is sequential and one table cannot describe it. Run the clock or step it and use the timing diagram instead. With more than six input switches the table would be too large, so it is skipped as well.
What is the difference between D, JK and T flip-flops?
All three act on the rising clock edge. A D flip-flop stores the value at D into Q. A T flip-flop toggles Q when T = 1 and holds it when T = 0. A JK flip-flop holds on 00, resets on 01, sets on 10 and toggles on 11, so it can do everything the others can. The 3-bit counter example chains T flip-flops, clocking each stage from the previous Q̄, so Q0, Q1 and Q2 each halve the frequency and count up in binary.
How do I save and share a circuit?
The parts, positions, labels and wires are compressed into the part of the URL after #, and nothing is uploaded to a server. Press Copy share link and send the address to someone, and they will see the same circuit. Bookmarking the address lets you come back and keep editing.

Features

  • Eight gate types with 2–4 inputs, an SR latch and D, JK and T flip-flops; you can also build a latch from NOR gates
  • Event-driven simulation that detects oscillation, such as a ring of an odd number of inverters, and highlights the parts involved
  • Automatic truth table for combinational circuits (up to 6 inputs) with a simplified sum-of-products expression
  • Clocks with adjustable frequency, run, pause and half-period stepping, with a timing diagram
  • LEDs in four colours and a 7-segment display that shows 0–F from a 4-bit input
  • Examples: half adder, full adder, 4-bit ripple adder, 4-to-1 multiplexer, 2-to-4 decoder, counter and traffic light, all shareable by link