What Is a Logic Gate?
People often ask, “What is a logic gate?” It may sound technical and intimidating, but the concept behind it is actually quite simple. Logic gates are like the tiny decision-makers hidden inside every digital device. They don’t think, of course, but they constantly make decisions using only 0s and 1s. So, if you’ve always wanted to gain a deeper understanding of how digital systems work, you’ve come to the right place. Read on to learn:
- What a logic gate is;
- How common logic gate symbols represent inputs and outputs;
- Why the truth tables of all logic gates matter; and
- How logic gates connect to form real circuits, from simple inverters to counters and arithmetic units.
Ready? Let’s dive in!
🙋 To quickly test different input combinations, you can also use our truth table calculator to generate outputs automatically.
So, what is a logic gate, exactly? In brief, a logic gate is a digital electronic circuit performing logical (Boolean) operations on a sequence of bits. This sequence is quite often provided by a slot-modulated input signal (a square wave), and a clock circuit or a quartz oscillator precisely synchronizes it.
Essentially, “what a logical gate is” comes down to how electronic systems make decisions using 0s and 1s.
The primary method for building logic gates involves using diodes or transistors as electronic switches. Today, most logic gates are constructed from MOSFETs (metal-oxide-semiconductor field-effect transistors). They can also be built using vacuum tubes, electromechanical relays in relay logic, fluidic logic, pneumatic logic, optical logic, molecular logic, acoustic logic, or even mechanical or thermal elements.
Logic gates can be combined to create sequential logic circuits using flip-flops or inverters. Given the integration capabilities in electronics, an integrated circuit typically contains several gates.
A logic gate is represented using standardized logic gate symbols, which visually describe how inputs are processed. For example, logical negation (NOT) is represented by a triangle, following the ANSI convention, because it is implemented by a simple transistor mounted as an inverter. This is why the inverter logic gate, also known as a NOT gate logic circuit, has only one input.
Some logic gates, including AND and OR, require at least two inputs. The logic gate AND gate outputs a 1 only when all inputs are 1, while other gates follow different rules, as described in the truth tables of all logic gates.
To make these differences concrete, the following table summarizes the most common logic gates, their symbols, Boolean expressions, and output behavior.
Type | ANSI symbol | Boolean algebra between A and B | Truth table |
|---|---|---|---|
Buffer | A | [A01Q01] | |
NOT (inverter) | A or ¬A | [A01Q10] | |
AND | A⋅B or A∧B | [A0011B0101Q0001] | |
OR | A+B or A∨B | [A0011B0101Q0111] | |
NAND | A⋅B or A↑B | [A0011B0101Q1110] | |
NOR | A+B or A↓B | [A0011B0101Q1000] | |
XOR | A⊕B or A⊻B | [A0011B0101Q0110] | |
NXOR | A⊕B or A⊙B | [A0011B0101Q1001] | |
IMPLY | A+B or A→B | [A0011B0101Q1101] | |
NIMPLY | A⋅B or A↛B | [A0011B0101Q0010] |
The truth tables show how each logic gate responds to every possible input combination, forming the foundation for more complex digital circuits.
All of these operations are rooted in Boolean logic, which is explained in more detail in our related article: “What Is Boolean Algebra?”
Logic gates are a constituent of digital technologies (as opposed to analog technologies), which helps answer the foundational question of what a logic gate is in real-world systems. They are omnipresent in computers, digital filters, clocks, and digital chronometers.
They provide a multitude of functions, including arithmetic and logic units, addressing and reading memory circuits, analog-to-digital and digital-to-analog conversion, DCB conversion, decoding Gray codes, and many others. At this scale, what a logic gate is becomes less abstract and more practical, as each logic gate performs a specific Boolean role.
Let's see how to use logic gates to make a counter. A DC (direct current) generator powers the circuit shown below, while the clock signal gives the time base. The 74LS107D circuits are simple Schottky diode-based inverters that illustrate the role of an inverter in logic gates. They detect every change of state (from 0 to 1 or from 1 to 0) in their input and send a signal of 1 each time a change occurs (trigger function). This behavior is typical of an inverter logic gate, also known as a NOT gate logic circuit, and is commonly shown using standard logic gate symbols.
The principle of the DCD_HEX digital display at the top right is simple. Based on the four-bit binary word it receives at its input, it displays the decimal value of the corresponding number (e.g., 0110 = 0x2³ + 1x2² + 1x2 + 0x2⁰ = 6) by lighting up the segments of a seven-segment display.
To understand the operation of this circuit, assume the inputs are initially 0 and proceed from left to right in the diagram. Each emission of a slot by the generator produces an alternation from 0 to 1, then from 1 to 0, which triggers a signal from the inverter circuits.
Using the truth tables of all the logic gates in the circuit, one can determine the state (0 or 1) of the four input bits of the display circuit for each of the four slots emitted in sequence. These truth tables are often paired with logic and Venn diagrams to visually represent logical relationships.
The comparator circuit is hardly any more difficult to understand. It is enough to construct the truth table of the four proposed outputs based on the input values (0 or 1) of A and B. This comparison logic relies on the same principles that define what a logic gate is, regardless of circuit complexity. The notation “!=” means ≠.
![]() |
If you want to practice building them yourself, this guide on “How to Make a Truth Table” walks through the process step by step.
The following circuit allows arithmetic operations to be performed in base 2. It takes two 2-bit words as inputs, for example, A and B. The unit bit is denoted A[0] for A and B[0] for B, while the most significant bit is coded A[1] and B[1]. At this stage, the circuit illustrates how multiple instances of a logic gate operate in conjunction with one another.
![]() |
The inputs A and B are sent to the four logic gates on the left of the diagram. From top to bottom, the gates are XOR, AND, OR, and XOR. This configuration includes both an XOR logic gate and an AND logic gate, forming part of an XOR gate logic circuit used in arithmetic operations. The final XOR gate serves as the input stage of an adder circuit, while related designs may also use a NAND gate logic circuit for efficiency.
In addition to inputs A and B, the circuit considers a possible hold resulting from a previous operation (CARRY IN). Similarly, if the circuit performs an operation that results in an overflow, it outputs a carry-out (CARRY OUT) bit. In the stack of a microprocessor, these special bits are stored in a state register, reinforcing what the logic gate is as a fundamental building block of computation.
Each bit is finally sequenced by a multiplexer (the two rectangular blocks to the right of the diagram) to form the result. The nature of the function to be performed is given by the OP signal, encoded on three bits by a control unit:
OP = 000 → XOR;OP = 001 → AND;OP = 010 → OR; andOP = 011 → Addition.
This logic relies heavily on the logic gates, including the XOR gate, and other standard gate combinations working together.
Ultimately, logic gates are simpler than they appear at first glance. Each one follows a few straightforward rules, but together they make modern digital systems possible. Once you understand how logic gates work, the behavior of computers and electronic circuits begins to make much more sense.
The basic logic gates are AND, NAND, OR, NOR, XOR, XNOR, and NOT. They are the basic building blocks of digital electronics. They are the components we use to "do things" with 1s and 0s. You can combine them to create other building blocks such as flip-flops, adders, shift registers, etc.
NAND is short for “NOT AND”. A two-input NAND gate logic circuit is a digital combinational logic circuit that performs the logical inverse of an AND gate. While an AND gate produces a logical “1” only if both inputs are logical “1”, a NAND gate produces a logical “0” for the same combination of inputs.
This article was written by Claudia Herambourg and reviewed by Steven Wooding.

