Skip to content

Logic gate: meaning and examples

A logic gate is a device, physical or drawn, that computes one Boolean operator: it takes one or more binary inputs and produces one binary output according to a fixed truth table.

The basic gates are NOT, AND, OR, NAND, NOR, XOR and XNOR, each with a standard symbol in circuit diagrams and each defined entirely by its truth table. A gate has no memory: its output at any moment depends only on its inputs at that moment, which is why networks of gates form combinational logic. Any Boolean expression can be drawn as a network of gates, with each operator becoming one gate and each shared input fanning out to every gate that reads it.

The artefact on this page is the two-input NAND gate, NAND(A, B), which the engine's reading describes as false only when both parts are true. The 4-row table reads true, true, true, false. The tautology check is violated with the counterexample A = TRUE, B = TRUE, the one row where NAND gives false, and the satisfiable check holds with the witness A = FALSE, B = FALSE. The contradiction check is violated with the same witness. NAND is shown here because it is the gate from which every other can be built.

Gates are the vocabulary of digital hardware, and the engine's logic diagram draws any formula as a gate network; the NAND-only and NOR-only converter rewrites a formula for a technology that offers one gate type. Programmers meet gates indirectly, as the operators &&, || and !. The term is confused with the operator it implements (the abstract function rather than the device) and with a transistor, the component from which gates are built.

Example

f := NAND(A, B) · output

Exact checks

Always true (tautology)? No Counterexample: A = T, B = T · Exhaustively checked and solver cross-checked · 4 rows
Always false (contradiction)? No Counterexample: A = F, B = F · Exhaustively checked and solver cross-checked · 1 rows
Can be true? Yes Example assignment: A = F, B = F · Exhaustively checked and solver cross-checked · 1 rows

Truth table (4 rows)

Logic gate: meaning and examples
#ABf
0FALSEFALSETRUE
1FALSETRUETRUE
2TRUEFALSETRUE
3TRUETRUEFALSE

Plain-language reading

Beginnerf is true exactly when A and B are not both true.
In every other case, f is false.
About the operators:
- NAND (“not and”) is false only when both parts are true.
Intermediatef is true exactly when A and B are not both true.
In every other case, f is false.
Advancedf is true exactly when A and B are not both true [Sheffer stroke ↑ (NAND)].
In every other case, f is false.
Formal notation: NAND(A, B)

The common slip

Reading the NAND symbol as “NOT and then AND”. NAND negates the result of the AND, so NAND(A, B) is NOT (A AND B), false only when both inputs are true; applying NOT to the inputs first gives a different gate, NOT A AND NOT B, which is NOR.

Questions

How many inputs can a gate have?

Two is the textbook case, but AND, OR, NAND and NOR extend to any number of inputs because their operators are associative. The engine's word notation writes a multi-input gate as a chain, A AND B AND C, or as NAND(A, B) for the named form.

Related

Guides

Practice

See also

Glossary

Generated from the Tangibool engine, semantics tangibool-semantics/1, engine 1.0.0, build . Every table, map, simplification and verdict on these pages was computed by the Tangibool engine when the site was built, and every claim was re-checked by the same exact checker the app uses. Limits are stated where they apply. © 2026 Foreranger LTD.