This article is free to read. Creating a lesson uses your daily or stored credits; review the language and settings before starting.
How do logic gates work?
Quick answer
Logic gates are electronic circuits that take binary inputs (0 or 1) and produce a single binary output based on a logical rule. Common gates include AND, OR, and NOT, each with a unique truth table. They are built from transistors and combine to form processors, memory, and all digital devices.
Logic gates work by taking one or more binary inputs and producing a single binary output based on a fixed rule. Each gate type, such as AND, OR, or NOT, implements a specific logical operation that forms the building blocks of digital circuits.
Step by step
- Binary signals representing 0 (low voltage) or 1 (high voltage) are applied to the gate's input terminals.
- Inside the gate, transistors switch on or off according to the input voltages, creating a path to either the positive supply or ground.
- The arrangement of transistors determines the logical function, such as AND, OR, or NOT, by controlling when the output connects to high or low voltage.
- The output terminal then provides a voltage level corresponding to the logical result, which can feed into other gates.
Key things to understand
- Logic gates are physical devices that implement Boolean functions, taking binary inputs (0 or 1) and producing a binary output.
- The AND gate outputs 1 only when all its inputs are 1; otherwise it outputs 0.
- The OR gate outputs 1 if at least one input is 1; it outputs 0 only when all inputs are 0.
- The NOT gate, or inverter, outputs the opposite of its single input: 0 becomes 1, and 1 becomes 0.
- Gates are built from transistors that act as electronic switches, and combining them creates circuits that perform arithmetic and logic.
Labelled diagram
- Inputs
Binary signals (0 or 1) enter the gate through wires.
- Transistor network
Transistors switch on/off based on input voltages.
- Logic function
The arrangement implements AND, OR, NOT, etc.
- Output
A single binary signal exits, ready for the next gate.
Real-world examples
- In a smartphone, millions of logic gates in the processor execute instructions and process data.
- A simple security system uses an AND gate: the alarm sounds only if the motion sensor AND the door sensor are both triggered.
- Traffic lights use logic gates to sequence the red, yellow, and green lights based on timers and sensor inputs.
- In a calculator, logic gates perform binary addition and other operations to compute results from key presses.
Common mistake
✗ Myth: Logic gates are the same as logical operators in programming.
✓ Fact: Logic gates are physical electronic components that implement Boolean functions using transistors, while logical operators are abstract symbols in programming languages. However, both follow the same truth tables and can be used to model each other.
People also ask
What is a logic gate in simple terms?
How do logic gates use transistors?
Why are logic gates important in computers?
What is the difference between AND and OR gates?
How are logic gates made?
What is a truth table?
Can logic gates be combined to do arithmetic?
Part of the guide: How the Internet Works →

