gizmobench

Logic Gate Simulator

Add switches, add gates, wire the pins, and the stage prints what every gate is reading the moment anything changes. Three things here work differently from the usual applet. A pin with nothing wired into it reads as unknown, drawn as a question mark, instead of being counted as a silent zero that quietly changes every value downstream; a 0 into an AND or a 1 into an OR still settles the answer, because those gates need no second value to decide. A wire that loops back into an earlier gate is refused and the gates in the loop are named, because feedback is a sequential circuit that has to settle over time and that needs a clock this page does not have. And the circuit is plain text on the stage and plain JSON behind the Copy button, so what the tool computed is something you can read, check and keep. Up to 32 gates and 8 switches, every control reachable from the keyboard, all of it in your browser with no account and nothing uploaded.

3 gates2 switchesCombinational
A = 1   B = 0

G1  AND   A, B    = 0
G2  OR    A, B    = 1
G3  XOR   G1, G2  = 1   output

OUT = 1   (G3)
Gates
3
Inputs
2
Output
1 (G3)
Cycles
None

3 gates, 2 switches. G3 reads 1, recomputed on every flip.

Switches

Flip a switch and every gate that depends on it is worked out again. A pin left open reads as unknown, drawn as a question mark on the stage.

Gates and wires

Each row is one gate: its kind, what is wired into each pin, and whether it is the output the stage reads. Wire a pin to a gate that already depends on it and the circuit is refused, with the loop named.

  • G1
  • G2
  • G3

AND 1 only when both inputs are 1OR 1 when either input is 1NOT flips its single inputXOR 1 when the inputs differNAND AND with the output flippedNOR OR with the output flipped

Try these

  • A=1 B=0, ANDtwo switches
    0
  • Same inputs, XORtwo switches
    1
  • Wire looped backoutput to input
    refused: G1 and G2 loop

Truth tables

Every row below is computed by the same function the stage uses, so the table and the canvas cannot disagree. NOT has one input: NOT 0 is 1, NOT 1 is 0.

ABANDORXORNANDNOR
0000011
0101110
1001110
1111000
Accuracy. Exact Boolean evaluation of the circuit you draw, recomputed the moment a switch moves. It handles combinational circuits only: a loop back into an earlier gate is refused and named rather than simulated, because that needs a clock this page does not have.

Common questions

How do I build a circuit?
Add the switches you need, then add gates with the buttons under the canvas: AND, OR, NOT, XOR, NAND and NOR. Each gate gets a row with its kind and one drop-down per pin, and a pin can be wired to any switch or any other gate. Choose which gate the stage reads as the output with the radio on its row. Flipping a switch re-evaluates everything that depends on it straight away, so the values on the stage are always the values of the circuit in front of you.
Why does a gate show a question mark instead of 0 or 1?
Because one of its pins has nothing wired into it, and an open pin has no value. Treating it as 0 would be a guess, and the guess would travel through every gate downstream, so this page marks the pin as open and the gate as unknown. Unknown spreads only where the answer really depends on it: a 0 into an AND is still 0 and a 1 into an OR is still 1 whatever the other pin turns out to be, while XOR needs both pins every time. The line under the canvas names the first open pin so you know exactly which drop-down to fill.
Why will it not let me wire a gate's output back to its own input?
It lets you wire it, and then it refuses to pretend it knows the answer. A wire that runs back into a gate the signal already passed through is feedback, which is what latches and flip-flops are made of, and feedback settles over time rather than instantly: it needs a clock, and a clock is out of scope here. So the stage names the gates in the loop, says to unwire one of those inputs, and shows no value for any gate while the loop is there. That refusal is the honest answer, and it is worth more than a number picked from whichever pass happened to run first.
What is a NAND gate, and why is NAND(1,1) equal to 0?
NAND is an AND gate with its output flipped, so it gives 0 only when both inputs are 1, and 1 in every other case. NOR is an OR gate flipped the same way: 1 only when both inputs are 0. They matter because either one on its own can build every other gate, which is why real chips are full of them. The truth tables printed under the tool are computed by the same function the canvas uses, so the table and your circuit can never disagree.
Can I build a flip-flop, a latch or a counter?
No, and the page says so rather than producing something that looks like an answer. Those are sequential circuits: their output depends on what happened a moment ago, which means feedback and a clock. This simulator is combinational only, so it evaluates each gate once, in an order that follows the wires, and refuses any circuit with a loop in it. Half adders, full adders, multiplexers, parity checkers and anything else built from gates alone all work.
How many gates and switches can I use?
Up to 32 gates and 8 switches, named A to H. Those are limits on the drawing rather than on the arithmetic: the stage prints one line per gate, and a longer circuit would be a scroll bar rather than a diagram. Nothing is silently dropped to fit, either: at the limit the Add button stops and the page says the canvas is full, and a circuit read back from a saved or copied file that is over the limit is refused whole, with a message naming the limit and the size of the file, rather than trimmed.
Can I save or export what I built?
Copy JSON hands you the whole circuit as readable JSON: the switches and their positions, every gate with its type and its wires, and which node is the output. If the browser will not give the page the clipboard, the page says so and that same JSON opens in a box under the readout, ready to select and copy by hand. The same JSON is what this browser keeps for you, so the canvas comes back as you left it the next time you open the page, and the Start over button above the tool forgets it. Nothing is uploaded and no account is involved: the evaluation, the drawing and the export all happen in your browser.
Is it accurate?
The Boolean part is exact. There are only six gates and three possible pin values here, and every combination is checked against the standard truth tables in the tool's test file, so the values on the stage are the values the gates define, not an approximation. What the page cannot do is time: it has no clock, no propagation delay, no glitch or race behaviour, and no sequential elements, so it says nothing about how a real circuit behaves while it is settling.

Exact Boolean evaluation of the circuit you draw, recomputed the moment a switch moves. It handles combinational circuits only: a loop back into an earlier gate is refused and named rather than simulated, because that needs a clock this page does not have.