b2KIT

Logic Gate Simulator

Build digital circuits with AND, OR, NOT, NAND, NOR, XOR gates. Wire inputs to outputs and generate truth tables automatically.

Tested tool guide Tested browser tools Checked August 16, 2026

What Logic Gate Simulator does, with a checked example

Place gates on a canvas, drag wires between their pins, and the simulator computes what the whole circuit does. AND, OR, NOT, NAND, NOR, and XOR each implement one Boolean function, wiring outputs into inputs composes them, and the tool responds with a truth table covering every input combination. The surprise for most users: the table proves functional equivalence, not physical equivalence - identical tables can still behave differently in real hardware, and any circuit whose output feeds back into an input stops being a truth-table circuit at all.

Worked example

A concrete input and expected output from the current implementation.

Input

Inputs A and B feed an AND gate (output X). X and a third input C feed an OR gate (output Y).

Expected output

A B C | Y
0 0 0 | 0
0 0 1 | 1
0 1 0 | 0
0 1 1 | 1
1 0 0 | 0
1 0 1 | 1
1 1 0 | 1
1 1 1 | 1

X is 1 only when both A and B are 1, and OR outputs 1 whenever either input is 1, so Y is 0 only in the three rows where C is 0 and the AND condition fails: 000, 010, and 100. All eight rows follow from that rule.

How the result is produced

1

Gate functions

Each gate computes a Boolean function of the values arriving on its input wires. AND outputs 1 only when every input is 1; OR outputs 1 when any input is 1; NOT inverts its single input; NAND and NOR are the inverted versions of AND and OR; XOR outputs 1 when exactly one of its two inputs is 1. Connecting a gate output to another gate's input composes these functions into larger expressions.

2

Truth table generation

For a circuit with n independent inputs the tool enumerates 2^n rows covering every combination of 0s and 1s, so each added input doubles the table. Every row is pushed through the network, each gate evaluates its function on the incoming wire values, and one output column appears per circuit output. Three inputs yield 8 rows, four yield 16, and so on.

Good uses

  • Check Boolean-algebra identities such as De Morgan's law: build NOT(A AND B) and (NOT A) OR (NOT B) side by side and confirm the two output columns match in every row.
  • Design a circuit on screen before building it, like a half adder: A XOR B drives the sum bit while A AND B drives the carry bit, with the truth table confirming all four input pairs against hand-written binary addition.
  • Debug homework or a colleague's circuit: wire it exactly as drawn and compare the generated truth table with the expected one, which separates wiring mistakes from conceptual errors.

Limits and checks

  • Feedback loops: a gate output wired back into an input it feeds makes the circuit sequential, not combinational, and it has no single truth table - the generated table will not describe the circuit.
  • Dangling inputs: a gate pin with no wire attached has no defined value. Connect every input pin, and treat rows involving an unconnected input as meaningless rather than reading them as truth.
  • Equivalence is functional only: identical truth tables do not guarantee identical behavior in silicon, since propagation delay, glitches, and fan-out limits still differ between designs with the same table.

Common questions

Why does my NAND gate output 0 when both inputs are 1?

That is correct behavior. NAND means AND followed by inversion, so its output is 0 in exactly the row where all inputs are 1, and 1 in every other row. If you expected a 1 there, you want the AND gate, or a NOT gate placed after the NAND.

Can I simulate a latch or flip-flop with this?

Not in a way you can trust. Latches hold state by feeding an output back into an input, and a truth table only describes combinational circuits, where output is a fixed function of the current inputs. Expect feedback to produce an unstable or meaningless table; use a simulator with clock and timing support for sequential logic.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools