Short answer
A logic gate is a building block of a digital circuit that takes one or more binary inputs (0 or 1) and produces a single binary output according to a fixed rule. The seven core gates are AND, OR, NOT, NAND, NOR, XOR and XNOR. In practice you rarely design one from scratch — you specify a ready-made logic IC from a family such as 74LS, 74HC, 74HCT or 4000-series CMOS, chosen on supply voltage, speed, drive capability and noise immunity rather than on the gate function alone.
Logic gates are the foundation of every digital system, from a single Schmitt-trigger debounce to the control logic inside industrial equipment. This guide explains what each gate does, how the common logic families differ, and how to choose the right part for a real design — written for engineers and buyers who need the specification decisions, not just the theory.
- Seven core gates cover every combinational logic function: AND, OR, NOT, NAND, NOR, XOR and XNOR.
- The gate is the easy part. The design decision is the logic family — 74LS, 74HC, 74HCT or 4000-series CMOS.
- Choose on electrical fit: supply voltage, switching speed, fan-out and noise immunity, not on the logic symbol.
- Most field failures come from floating inputs, level mismatch between families and missing decoupling — all avoidable at design stage.
What is a logic gate and what are the seven types?
A logic gate implements a Boolean function. Each input and output is either logic 0 (low) or logic 1 (high), and the gate's truth table defines the output for every input combination. Real logic ICs package several gates together — a quad 2-input NAND, for example, gives you four independent gates in one 14-pin device.
| Gate |
Output is high (1) when… |
Typical use |
| AND |
all inputs are high |
enable and interlock logic |
| OR |
any input is high |
combining alarm or fault signals |
| NOT (inverter) |
the single input is low |
signal inversion, level restoration |
| NAND |
not all inputs are high |
universal gate — any logic can be built from NANDs |
| NOR |
all inputs are low |
latches and the other universal gate |
| XOR |
inputs differ |
adders, parity and comparison |
| XNOR |
inputs match |
equality checking |
NAND and NOR are described as universal because any other gate — and any combinational function — can be built entirely from one or the other. For example, wiring two NAND gates in series (a NAND feeding a second NAND used as an inverter) reproduces a plain AND gate. That is why NAND-heavy designs are common: standardising on a single gate type simplifies the bill of materials.
Logic gate truth tables and Boolean notation
A truth table lists the output for every possible input combination, and the Boolean expression is its shorthand. For two inputs A and B, the seven gates behave as follows:
| A |
B |
AND A·B |
OR A+B |
NAND A·B̅ |
NOR A+B̅ |
XOR A⊕B |
XNOR A⊕B̅ |
| 0 |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
| 0 |
1 |
0 |
1 |
1 |
0 |
1 |
0 |
| 1 |
0 |
0 |
1 |
1 |
0 |
1 |
0 |
| 1 |
1 |
1 |
1 |
0 |
0 |
0 |
1 |
The NOT gate takes a single input: its output is simply the inverse, written A̅, so an input of 0 gives 1 and an input of 1 gives 0.
How do 74LS, 74HC, 74HCT and 4000-series CMOS compare?
The logic function is identical across families; the electrical behaviour is not. The family you specify determines supply voltage, speed, power draw and how cleanly the device interfaces with the rest of your circuit. These are the four families you will meet most often across our semiconductor range.
| Family |
Supply voltage |
Relative speed |
Best for |
| 74LS (TTL) |
5V only |
fast |
legacy 5V TTL designs and repairs |
| 74HC (CMOS) |
2V–6V |
fast |
new designs; low power, wide supply range |
| 74HCT (CMOS) |
5V |
fast |
interfacing CMOS to 5V TTL logic levels |
| 4000-series (CMOS) |
3V–18V |
slower |
high-voltage, low-speed, battery and analogue-adjacent circuits |
As a rule of thumb: 74HC is the sensible default for a new digital design, 74HCT solves level-translation when you must talk to older 5V TTL, and 4000-series earns its place where you need a wide supply rail or very low static power. We stock all four in our logic IC range.
How do you choose the right logic family for your design?
Work through four specification checks before you commit to a part:
Supply voltage. Match the family to your rail. A 3.3V system rules out 74LS and plain 74HCT; a 12V rail points straight at 4000-series. Mismatched supplies are the most common reason a "correct" gate refuses to work.
Switching speed. Propagation delay matters once you are clocking above a few megahertz. 74HC and 74LS are quick; 4000-series is comparatively slow and is best kept to low-frequency control and interfacing rather than fast data paths.
Fan-out and drive. Each output can only drive so many inputs before logic levels degrade. Check the output current against the total input load, and add a buffer or driver if you are fanning out to many devices or off-board.
Noise immunity. In electrically noisy environments, CMOS families and Schmitt-trigger inputs give you more margin against false switching. For slow or noisy signals, a Schmitt-trigger gate is often the right call rather than a plain gate.
What are the common failure modes with logic ICs?
Most logic problems in the field are design oversights, not faulty parts. The recurring ones are worth designing out from the start:
- Floating inputs. Unused CMOS inputs left unconnected drift and cause erratic output and raised current draw. Tie every unused input high or low through a pull-up or pull-down.
- Level mismatch between families. A 74LS output does not reliably drive a 74HC or 4000-series input without a pull-up, because the logic-high thresholds differ. Use 74HCT as the translator when mixing 5V TTL and CMOS.
- Missing decoupling. Every logic IC needs a decoupling capacitor close to its supply pins to absorb switching transients. Without it you get glitches that are near-impossible to trace on the bench.
- Unused gates left open. Spare gates in a package should have their inputs tied off, not left floating, for the same reason as unused inputs.
When should you use discrete logic gates, a microcontroller or an FPGA?
Discrete logic ICs are not the only way to implement logic, and part of good design is knowing when to reach for something else. Use this as a rough guide:
- Discrete logic gates suit small, fixed functions — a handful of gates for an interlock, a clock buffer, level shifting or glue logic between larger devices. They are cheap, fast to specify and need no programming.
- A microcontroller makes more sense once the logic becomes complex, needs to change in software, or involves timing, counting or communication. Replacing a dozen gates with one programmable device usually cuts board space and cost.
- A CPLD or FPGA fits high-speed or highly parallel logic that a microcontroller cannot keep up with — but carries higher design overhead, so it is reserved for cases that genuinely need it.
For prototyping and education, a single-board computer or development board often stands in for discrete logic while a design is being proven. As a rule, stay with discrete gates while the function is simple and fixed, and move to a programmable device the moment it needs to flex.
Specify your logic ICs with confidence
74LS, 74HC, 74HCT and 4000-series CMOS logic in stock, ready to ship. Same-day despatch on thousands of stocked lines.
Shop logic ICs
Frequently asked questions
What are the seven basic logic gates?
The seven basic logic gates are AND, OR, NOT, NAND, NOR, XOR and XNOR. Each takes binary inputs and produces one binary output. NAND and NOR are universal — any logic function can be built from either one alone.
What is the difference between 74HC and 4000-series logic?
Both are CMOS, but 74HC runs on 2V–6V and switches fast, while 4000-series accepts a wider 3V–18V supply and switches more slowly. Choose 74HC for speed and 4000-series for high-voltage or low-power circuits.
Why do unused logic inputs need to be tied high or low?
A floating CMOS input has no defined logic level, so it drifts with noise and can switch the output unpredictably while raising current draw. Tying unused inputs high or low through a resistor gives a stable, defined state.
Can I mix TTL and CMOS logic in one circuit?
Yes, but you must manage the different logic-level thresholds. A 74LS TTL output driving a 74HC or 4000-series CMOS input usually needs a pull-up resistor, or a 74HCT device used as a level translator between the two.
Which logic family should I use for a new design?
74HC is the usual default for a new digital design: low power, a 2V–6V supply range and fast switching. Move to 74HCT for 5V TTL compatibility, or 4000-series where you need a higher supply voltage or minimal static power.
Are logic gates still used in modern electronic design?
Yes. Even where a microcontroller or FPGA handles the main logic, discrete gates remain widely used for glue logic, level shifting, clock buffering and simple interlocks. They are cheap, fast and need no programming, so they stay relevant in almost every design.