AND gate
Y = A AND B
Output is 1 only when both inputs are 1.
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Explore how digital logic gates process binary inputs. Toggle switches, test AND, OR, NOT, NAND, NOR, XOR and XNOR gates, connect gates into simple combinational circuits, and generate a truth table for your circuit.
Change the inputs and watch the output update immediately.
A binary input can be either 0 (LOW) or 1 (HIGH).
AND returns 1 only when both inputs are 1.
The output is recalculated when a switch or gate changes.
Both inputs are LOW, so the output is 0.
| A | B | Y |
|---|
The highlighted row matches your current input switches.
Add gates and connect each input to A, B, a constant, or an earlier gate output.
Every possible A/B combination is evaluated through your circuit.
This builder uses two external inputs, A and B.
Logic gates are the basic building blocks of digital electronics. They take one or more binary inputs and produce a binary output according to a Boolean rule. Digital circuits combine gates to perform operations used in processors, memory systems, control circuits and arithmetic units.
This logic gate simulator is useful for learning digital logic, checking truth tables, testing Boolean operations and exploring how a small combinational circuit behaves. It evaluates the logical behavior of a circuit; it does not model transistor-level electrical characteristics, propagation delays or voltage levels.
The following definitions describe the seven gate types available in this simulator. For two-input gates, A and B can each be 0 or 1.
Y = A AND B
Output is 1 only when both inputs are 1.
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Y = A OR B
Output is 1 when at least one input is 1.
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 1 |
Y = NOT A
Output is the inverse of the single input.
| A | Y |
|---|---|
| 0 | 1 |
| 1 | 0 |
Y = NOT (A AND B)
Output is 0 only when both inputs are 1.
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Y = NOT (A OR B)
Output is 1 only when both inputs are 0.
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 0 |
Y = A XOR B
Output is 1 when the two inputs differ.
| A | B | Y |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 1 |
| 1 | 0 | 1 |
| 1 | 1 | 0 |
Y = NOT (A XOR B)
Output is 1 when both inputs are equal.
| A | B | Y |
|---|---|---|
| 0 | 0 | 1 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
Use the examples in the builder to explore common circuit patterns. The output and truth table update whenever you change a connection.
The builder is intentionally limited to combinational circuits with two external inputs. It evaluates gates in dependency order and prevents a gate from connecting to its own output or a later gate, avoiding feedback loops that would require sequential simulation.
A logic gate is a digital circuit that applies a Boolean operation to binary inputs and produces a binary output. Gates are combined to build more complex digital systems.
AND outputs 1 only if all inputs are 1. OR outputs 1 if at least one input is 1. For two inputs, both gates output 0 for A = 0 and B = 0.
XOR outputs 1 when the inputs differ; XNOR outputs 1 when they match. XOR is commonly used for binary addition and parity logic, while XNOR is useful for equality comparisons.
Any Boolean logic function can be constructed using only NAND gates or only NOR gates. This makes them universal building blocks for digital logic.
This version is for combinational logic. Flip-flops, latches and counters depend on stored state, feedback or clock behavior, which this simulator does not model.
Yes. Use the download button to save a CSV file, or copy the CSV text and paste it into a spreadsheet or text editor.
Continue exploring binary arithmetic, Boolean logic and digital systems: