a logic gate
A logic gate is a small circuit that takes one or two yes/no signals and produces one yes/no signal according to a fixed rule. Think of it as a tiny decision-maker wired in advance: 'output a 1 only if both my inputs are 1' (that is AND), or 'output a 1 if either input is 1' (OR), or 'flip whatever I am given' (NOT). Here a 1 means a high voltage and a 0 means a low voltage, so the gate is just transistors arranged so the output voltage follows the rule. Gates are the alphabet of hardware — a handful of them, repeated and connected, spell out everything a computer can compute.
The basic gates are NOT (inverts: 0 becomes 1), AND (1 only when all inputs are 1), OR (1 when any input is 1), and their inverted cousins NAND (not-AND), NOR (not-OR), and XOR (exclusive-OR: 1 when the inputs differ). Each is built from a few transistors. For example, a 2-input NAND is two n-type transistors in series pulling the output down only when both inputs are high, with two p-type transistors in parallel pulling it up otherwise — so the output is low exactly when both inputs are high, which is 'not AND'. The full behaviour of any gate is captured by its truth table, the little chart listing the output for every input combination.
Why it matters: gates are the layer where the messy analog transistor becomes a clean, reusable digital building block. Once you trust a gate to turn inputs into the right output, you stop thinking about voltages and start thinking in logic. Real gates are not instantaneous, though — each takes a small propagation delay to settle after its inputs change, and these delays add up along a chain. That delay is exactly what later limits how fast a whole circuit, and ultimately a processor, can be clocked.
A doorbell that rings only when the front door AND the back door are both closed uses an AND gate: input A = front closed, input B = back closed, output = ring. If A=1 and B=1 the bell rings (1); any 0 keeps it silent (0). Swap to OR and it rings if either is closed.
AND, OR and NOT cover the everyday words 'both', 'either' and 'not' — gates are logic made physical.
A common confusion: OR in logic is inclusive — it is 1 when one OR both inputs are 1. The everyday 'or' that means 'one or the other but not both' is actually XOR, a different gate.