Digital circuit simulator
Drag AND, OR, NOT, NAND, NOR and XOR gates, flip-flops, counters, multiplexers and displays, wire them and test the circuit with switches and clocks. Get the truth table, the Boolean expression and the timing diagram.
What you can do
- Gates, D, JK, T and SR flip-flops, counters and registers.
- Truth table and circuit expression.
- Timing diagram with clock.
- 7-segment display and decoders.
Frequently asked questions
What is a truth table?
The list of every input combination with the output the circuit produces for each one.
Guide: logic gates and digital circuits
Digital circuits work with two values, 0 and 1. A few basic gates build everything else: adders, multiplexers, memories and counters. This guide reviews the gates and the difference between combinational and sequential logic, and works the design of a full adder.
The basic gates
- AND: the output is 1 only if every input is 1.
- OR: the output is 1 if any input is 1.
- NOT: inverts the input.
- NAND and NOR: AND and OR followed by a NOT. They are universal: NAND alone (or NOR alone) can build any function.
- XOR: the output is 1 if the inputs differ (with two inputs). XNOR is its complement.
De Morgan's laws relate them: (AB)′ = A′ + B′ and (A + B)′ = A′B′.
Combinational and sequential
In a combinational circuit (adders, multiplexers, decoders) the output depends only on the current inputs. In a sequential one (latches, flip-flops, counters, registers) it also depends on what happened before: the circuit has memory, and it usually changes state in step with a clock.
Example: the full adder
A full adder adds three bits: A, B and the carry in Cin. It gives the sum S and the carry out Cout.
- Truth table: S = 1 when the number of ones is odd (minterms 1, 2, 4 and 7); Cout = 1 when there are two or more ones (minterms 3, 5, 6 and 7). For example, 1 + 1 + 1 = 11 in binary: S = 1 and Cout = 1.
- Sum: S = A ⊕ B ⊕ Cin. The Karnaugh map of S allows no grouping at all (it is a checkerboard), which is why XOR is used.
- Carry, minimal form: Cout = AB + ACin + BCin, the majority function.
- Carry, XOR form: Cout = AB + (A ⊕ B)Cin, which reuses the XOR from the sum: it is the usual circuit with two half adders and an OR.
Chaining four full adders, with each carry feeding the next, gives a 4-bit adder: for example, 0111 + 0101 = 1100 (7 + 5 = 12). The tool includes both circuits as examples, with the truth table and the expressions just derived.
Flip-flops and counters
A D flip-flop copies its D input to the Q output at each clock edge and holds it until the next. A JK can hold, reset, set or toggle; a T toggles its output when T = 1. Cascading T flip-flops gives an asynchronous binary counter: each stage divides the frequency by 2.
How to use the simulator
- Drag components from the panel: switches, push buttons, clock, LEDs, displays, gates, flip-flops, multiplexers, decoders, adders and registers. Wire by dragging from a pin.
- Click switches to change them and watch the LEDs; run the clock with ▶ or step it, and look at the timing diagram.
- For a combinational circuit, the tool derives its truth table and minimal expressions, and you can continue in the Karnaugh map tool.
Common mistakes
- Leaving inputs unconnected: their value is unknown (X) and it propagates.
- Tying two outputs to the same wire: if they drive different values there is a conflict.
- Confusing a latch with a flip-flop: the latch follows its input while enabled; the flip-flop only changes on the edge.
- Forgetting that a three-input XOR gives 1 for an odd number of ones, not "exactly one".
Further reading
M. M. Mano and M. D. Ciletti, Digital Design (Pearson); T. L. Floyd, Digital Fundamentals (Pearson). Simuveliq is not affiliated with these authors or publishers.
More tools
Versión en español
About Simuveliq · Privacy policy · Contact