075582814553
Logic Gates: Types, Symbols, Truth Tables, and Applications

FREE-SKY (HK) ELECTRONICS CO.,LIMITED / 10-10 16:16

Logic gates are the basic building blocks of digital circuits because they allow electronic systems to process binary signals, make decisions, and control other parts of a system. Although their Boolean functions are simple, real logic design involves more than knowing symbols and truth tables. You also need to understand voltage levels, logic families, propagation delay, output drive, loading, and power. This article explains the main logic gates, shows how truth tables and Boolean expressions are turned into working circuits, compares NAND and NOR implementations, examines a practical 3.3 V-to-5 V logic interface, and discusses when discrete gates, MCUs, CPLDs, or FPGAs are the better choice.


Catalog

1. How Logic Gates Work in Digital Circuits
2. Logic Gate Symbols, Truth Tables, and Boolean Expressions
3. From a Truth Table to a Working Logic Circuit
4. NAND and NOR as Universal Gates
5. Logic Gate Parameters
6. CMOS Logic Families and TTL Compatibility
7. Design Example: 3.3 V MCU Driving 5 V Logic
8. Logic Gates vs. MCU, CPLD, and FPGA Implementation

Figure 1. Common Distinctive-Shape Symbols for AND, NAND, OR, NOR, NOT, XOR, and XNOR Gates.

Figure 1. Common Distinctive-Shape Symbols for AND, NAND, OR, NOR, NOT, XOR, and XNOR Gates.

How Logic Gates Work in Digital Circuits

A logic gate is a digital circuit that applies a Boolean function to one or more input signals and produces a corresponding output. Digital logic uses two abstract states, normally represented as 0 and 1, or LOW and HIGH. These states allow electronic circuits to make decisions, process binary information, and control other parts of a digital system.

Logical 0 and 1 should not be treated as exact voltage values. In physical hardware, they are represented by voltage ranges that the device recognizes as LOW or HIGH. The acceptable input and output levels depend on the logic device, supply voltage, and logic family. This means a logic 1 is not necessarily exactly equal to the supply voltage, and a logic 0 is not necessarily exactly 0 V. The specific voltage limits and compatibility requirements are discussed later in the article.

When several gates are connected, the output of one gate can become the input of another. In combinational logic, the resulting output is determined by the present combination of input states. This basic input-processing-output relationship is the foundation for larger digital circuits, while the following sections explain how individual gate functions are represented, combined, and implemented in practical hardware.

Logic Gate Symbols, Truth Tables, and Boolean Expressions

The table below uses A and B for the inputs and Y for the output throughout. AND, OR, NAND, NOR, XOR, and XNOR are shown as two-input gates, while NOT uses only input A.


Logic Gate
Operator / Notation
Boolean Expression
Output Condition
Common Uses
AND
·
Y = A·BHIGH only when both A and B are HIGH
Interlocks, enable logic, multiple-condition control
OR
+
Y = A + BHIGH when A, B, or both are HIGH
Alarm logic, multiple-condition control
NOT
Overbar or prime

Y = A = A′

Produces the opposite logic state of A
Signal inversion, active-high/active-low conversion
NAND
Inverted AND

Y = A · B

LOW only when both A and B are HIGH
Universal logic, control circuits, memory logic
NOR
Inverted OR

Y = A + B

HIGH only when both A and B are LOW
Universal logic, latch circuits, inactive-condition detection
XOR
⊕
Y = (A ⊕ B)
HIGH when A and B are different
Binary addition, parity checking, difference detection
XNOR
Inverted XOR
Y = ¬ (A ⊕ B)
HIGH when A and B are the same
Equality comparison, matching logic

Logic Gate Truth Table

A
B
AND
OR
NOT A
NAND
NOR
XOR
XNOR
0
0
0
0
1
1
1
0
1
0
1
0
1
1
1
0
1
0
1
0
0
1
0
1
0
1
0
1
1
1
1
0
0
0
0
1

From a Truth Table to a Working Logic Circuit

A truth table becomes more useful when it is connected to a practical control requirement. Consider a conceptual machine-enable example. The machine should receive a RUN command only when the START command is active, the GUARD is closed, and no FAULT is present.

For this example, define the signals as follows: START = 1 when a start command is active, GUARD = 1 when the guard is closed, and FAULT = 1 when a fault is detected. The required output is RUN.

This example demonstrates Boolean logic only. A real machine safety function must use an appropriately designed and validated safety-related control system. This warning is important because ISO 13849-1:2023 covers the design and integration of safety-related parts of control systems that perform safety functions, rather than a simple ordinary gate example used only for illustration. [7]

Define the Requirement

The machine can run only when all three required conditions are satisfied:

• START = 1

• GUARD = 1

• FAULT = 0

Because the fault condition must be inactive, the FAULT signal must first be inverted before it is combined with the other conditions.

Build the Truth Table

The truth table lists every possible combination of the three input signals.

START
GUARD
FAULT
RUN
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
1
1
1
1
0

Only one input combination produces RUN = 1: START and GUARD are both active while FAULT is inactive.

Derive the Boolean Expression

The required output can therefore be written as:

RUN = START · GUARD · ¬FAULT

Here, ¬FAULT represents the inverted fault signal. The dots represent AND operations. This expression states that all three conditions must evaluate to logic 1 before RUN becomes logic 1.

Convert It into Gates

The Boolean expression can now be implemented with logic gates. First, the FAULT signal passes through a NOT gate to produce ¬FAULT. Then START, GUARD, and ¬FAULT feed a three-input AND gate. The output of that gate becomes RUN.

Conceptual gate-circuit diagram:

Figure 2. Machine Enable Logic Circuit Using START, GUARD, and Inverted FAULT Inputs

Figure 2. Machine Enable Logic Circuit Using START, GUARD, and Inverted FAULT Inputs

This completes the design flow:

Requirement → Truth Table → Boolean Expression → Gate Circuit

This method can be applied to many digital-control problems. Start by defining what each input state means, determine which combinations should activate the output, write the corresponding Boolean expression, and then implement that expression with suitable gates.

NAND and NOR as Universal Gates

Conventional Gate Implementation

Using conventional gates, first define the two intermediate terms separately:

P = AB

Q = C

The final output is:

F = P + Q

Therefore,

F = AB + C

This implementation requires one AND gate, one NOT gate, and one OR gate. The longest input-to-output path passes through two gate stages, so the maximum logic depth is two.

NAND-Only Implementation

Starting with:

F = AB + C

Apply De Morgan’s law:

F = AB · C

The first NAND gate produces:

P = AB

The second NAND gate produces:

F = PC

Substituting P:

F = AB · C

Therefore,

F = AB + C

Only two NAND gates are required, with a maximum logic depth of two gate stages.

NOR-Only Implementation

The same Boolean function can be rewritten in product-of-sums form:

F = (A + C) (B + C)

First, use a NOR gate with both inputs connected to C to generate its complement:

Q = C + C

Therefore,

Q = C

The next two NOR gates produce:

P = A + Q

R = B + Q

The final NOR gate combines these two outputs:

F = P + R

Substituting P and R:

F = A + Q + B + Q

Applying De Morgan’s law:

F = (A + Q) (B + Q)

Since Q = C:

F = (A + C) (B + C)

This implementation requires four NOR gates and has a maximum logic depth of three gate stages.

All complements are grouped so the overbar covers the complete intended term, such as AB, A + C, and P + R, rather than only the final variable or symbol.

Logic Gate Parameters

Logic-gate selection requires more than checking the Boolean function. The electrical parameters determine whether the gate can interface correctly with other devices, meet timing requirements, drive the intended load, and operate reliably under the expected power and temperature conditions.

Logic-Level and Loading Parameters

Parameter
What It Specifies
Why It Matters in a Real Circuit
Supply-voltage range VccSpecifies the voltage range over which the IC is designed to operate correctly.
The supply range must match the system power rails. Logic families can perform the same function while supporting different operating voltages. TI’s logic-family comparisons show substantial differences in supported and typical supply voltages. [1]
Input HIGH voltage VIHThe minimum input voltage guaranteed to be interpreted as logic HIGH.
The driving device must provide a HIGH output that meets or exceeds VIH under the specified operating conditions.
Input LOW voltage VILThe maximum input voltage guaranteed to be interpreted as logic LOW.
The driving device must keep its LOW output at or below VIL. A steady voltage between the guaranteed VIL and VIH limits should not be assumed to represent a valid logic state.
Output HIGH voltage VOHThe minimum HIGH output voltage guaranteed at a specified source current and supply voltage.
VOH must remain high enough to meet the receiving device's VIH requirement. The guaranteed HIGH voltage can decrease as source current increases.
Output LOW voltage VOLThe maximum LOW output voltage guaranteed at a specified sink current and supply voltage.
VOL must remain below the receiving device's VIL limit. Increasing output loading can raise the LOW-state voltage.
Noise margin
Measures the voltage margin between guaranteed output levels and required input thresholds. The HIGH and LOW margins are: and.
Larger positive noise margins provide greater tolerance to coupled noise, ground shift, and other voltage disturbances. Use guaranteed VIL and VIH limits for the relevant operating conditions rather than typical values.
Output source and sink current
Specifies the current an output can source while HIGH or sink while LOW while still meeting its guaranteed or limits.
Output-current capability helps determine whether the gate can drive the connected loads without violating valid logic levels. Fan-out also depends on input current, capacitive loading, and timing. For the SN74LVC1G00, TI specifies ±24 mA output drive at Vcc; 3.3v;higher drive conditions are available at higher supply voltage. [5]
Input leakage current
Specifies the small current that can flow into or out of an input while it is held at a valid logic level.
Leakage contributes to DC loading and becomes important with high-resistance bias networks, many parallel inputs, or very low-power systems.
Capacitive loading CLRepresents the capacitance driven by the output, including receiving inputs, PCB traces, connectors, and parasitic capacitance.
Higher CL generally slows output transitions and can increase propagation delay and switching energy. Datasheet timing values should therefore be compared using equivalent load conditions. The SN74LVC1G00 datasheet, for example, specifies timing under defined capacitive-load conditions. [5]

Timing, Power, and Environmental Parameters

Parameter
What It Specifies
Why It Matters in a Real Circuit
Propagation delay tpdThe time between an input transition and the corresponding output transition. Datasheets may specify separate low-to-high and high-to-low delays, such as tPLH and tPHL.
Delays accumulate along a combinational path. For three stages, the worst-case path delay can be estimated as tpath(max) = tpd1(max)+tpd2(max)+tpd3(max). Use maximum datasheet values for the relevant supply voltage, capacitive load, and temperature conditions. TI specifies a maximum propagation delay of 3.8 ns at 3.3 V for the SN74LVC1G00 under its stated test conditions. [5]
Rise and fall time
Describes how long the signal takes to transition between defined LOW and HIGH voltage points. Datasheets may specify output transition time and allowable input transition rate.
Slow edges can increase timing uncertainty and may increase current consumption or cause unreliable behavior in some CMOS devices. Output edge rate also depends on supply voltage and load capacitance.
Quiescent supply current ICCThe current drawn from the supply while the device is powered but not actively switching, under specified conditions.
Quiescent current affects standby power, especially in battery-powered or always-on systems. Logic families that perform the same function can have substantially different static-current requirements. [1]
Switching power
Power used when internal and external capacitances charge and discharge during logic transitions. A common first-order CMOS estimate is Pdynamic =

αCeffVCC2f [3]

where Cef is the effective switched capacitance,α is the switching-activity factor, and f is switching frequency.
Dynamic power increases with switching activity, effective capacitance, supply voltage squared, and frequency. More accurate estimates may require datasheet power-dissipation capacitance, load information, application data, or direct measurement.
Operating temperature
Defines the temperature range over which the manufacturer guarantees specified device operation.
Temperature can affect propagation delay, leakage current, output drive, and other electrical characteristics. Designs for industrial, automotive, or harsh environments must use a device grade and datasheet limits that cover the expected temperature range.

CMOS Logic Families and TTL Compatibility

CMOS logic families differ in supply-voltage range, input thresholds, switching performance, power characteristics, and intended use. TI’s Logic Guide SDYU001AC, Rev. AC, November 2025, provides family-level comparisons for HC, HCT, AHC, AHCT, LVC, AUP, and AUC. [1]

Family
TI Family Supply Range
Input Standard
TI Family Speed Class
Typical Design Use
HC
2–6 V
Standard CMOS
20+ MHz
General-purpose 3.3 V and 5 V logic
HCT
4.5–5.5 V
TTL-compatible CMOS
20+ MHz
5 V systems that must accept TTL-level inputs
AHC
2–5.5 V
Standard CMOS
100+ MHz
Faster general-purpose CMOS logic
AHCT
4.5–5.5 V
TTL-compatible CMOS
100+ MHz
Faster 5 V logic with TTL-compatible inputs
LVC
1.65–3.6 V; LVCxG extends to 5.5 V
Standard CMOS
100+ MHz
Low-voltage systems needing fast switching and strong drive options
AUP
0.8–3.6 V
Standard CMOS
180+ MHz
Low-power and battery-operated systems
AUC
1.65–2.7 V
Standard CMOS
250+ MHz
High-speed, low-voltage logic

The TI Family Speed Class values are broad family comparisons, not guaranteed maximum operating frequencies for every device. Actual timing depends on the specific part, supply voltage, load, temperature, and datasheet test conditions. Input compatibility is also important. HCT and AHCT use TTL-compatible input thresholds at 5 V, while HC, AHC, LVC, AUP, and AUC use CMOS-level input requirements appropriate to their operating ranges. For LVC, the standard family is specified at 1.65–3.6 V, while LVCxG devices extend operation to 5.5 V. [1]

Design Example: 3.3 V MCU Driving 5 V Logic

A 3.3 V microcontroller output is not automatically compatible with every 5 V logic input. Compatibility depends on the MCU’s guaranteed output levels and the receiver’s specified input thresholds, not simply on the nominal supply voltages.

TI’s 5 V logic switching-standard comparison provides representative input thresholds for standard CMOS and TTL-compatible CMOS. These are representative switching standards rather than universal limits for every IC. Always check the selected device’s datasheet. [1]

Figure 3. 3.3 V MCU Interface to Standard and TTL-Compatible 5 V Logic

Figure 3. 3.3 V MCU Interface to Standard and TTL-Compatible 5 V Logic

For a standard 5 V CMOS input, a nominal 3.3 V MCU output may fall below the required HIGH threshold. Therefore, the connection is not guaranteed simply because the MCU output is described as 3.3 V. The HIGH-level compatibility requirement is: [1]

VOH(min, MCU) ≥ VIH(min, receiver)




TTL-compatible CMOS families such as HCT use lower input thresholds. For example, the SN74HCT00 specifies TTL-compatible input thresholds over its recommended 4.5–5.5 V supply range. A 3.3 V MCU can therefore often drive this type of input, provided the MCU’s guaranteed output levels meet the receiver requirements. [6]

Both HIGH and LOW states must be verified:

VOH(min, MCU) ≥ VIH(min, receiver)

and

VOL(max, MCU) ≥ VIL(max, receiver)

In Figure 3, the MCU output is labeled:

3.3V nominal output; verify VOH at the required load.

The connection is valid only when both equations are satisfied.

This example shows why nominal supply voltage alone does not determine logic compatibility. The source’s guaranteed HIGH and LOW output levels must be compared with the receiver’s specified input thresholds.

Logic Gates vs. MCU, CPLD, and FPGA Implementation

Factor
Discrete Logic Gates
MCU
CPLD
FPGA
Implementation method
Physical logic ICs such as AND, OR, NOT, NAND, and NOR gates
Firmware executed by a processor and its peripherals
Programmable hardware logic
Programmable hardware with configurable logic, routing, memory, DSP, and other resources depending on the device
Parallel operation
Gates operate concurrently
Software execution is generally sequential, although peripherals, interrupts, DMA, and multiple cores can operate concurrently
Hardware functions can operate concurrently
Many hardware functions can operate concurrently
Timing behavior
Determined by gate, loading, and interconnect delays
Depends on clocking, instruction execution, interrupts, peripherals, and software architecture
Hardware-timed; predictable when the design is correctly constrained and meets timing
Hardware-timed; predictable when the design is correctly constrained and meets timing
Logic capacity
Practical for relatively small functions before component count and routing become inconvenient
Handles complex control and computation in software within processor and peripheral limits
Suitable for control, decoding, sequencing, and other logic within available device resources
Supports larger logic designs, memories, arithmetic blocks, high-speed interfaces, and other device-specific resources
Changes after design
Usually requires a hardware change
Firmware can generally be updated
Logic configuration can be updated if supported by the device and system
Logic configuration can be updated if supported by the device and system
Power consideration
Depends on gate family, device count, switching activity, load, and frequency
Depends on processor family, operating mode, peripherals, voltage, and workload
Depends on device family, utilized resources, clock activity, I/O standards, and operating frequency
Depends on device family, utilized resources, clock activity, I/O standards, and operating frequency
Development needs
Schematic design, logic-family selection, and electrical verification
Firmware development and peripheral configuration
HDL or supported schematic design, synthesis, constraints, and timing verification
HDL or other supported design entry, synthesis, implementation, timing constraints, and static timing analysis
CPLD and FPGA timing should not be assumed to be correct simply because the design is implemented in hardware. The design must include appropriate clock, I/O, and timing constraints, and the implementation must pass timing analysis for the required operating conditions.

Likewise, no platform is universally faster, lower power, or simpler. The appropriate choice depends on the required logic complexity, latency, parallelism, power target, update requirements, available development tools, cost, and device resources.




Technical References

[1] Texas Instruments. Logic Guide, Rev. AC, SDYU001AC, revised November 2025.

[2] Nolan, S. M., Soltero, J. M., and Rao, S. Understanding and Interpreting Standard-Logic Data Sheets, Rev. C, Texas Instruments, SZZA036C, revised December 2015.

[3] Texas Instruments. CMOS Power Consumption and Cpd Calculation, Rev. B, SCAA035B, June 1997.

[4] Texas Instruments. Implications of Slow or Floating CMOS Inputs, Rev. E, SCBA004E, revised July 2021.

[5] Texas Instruments. SN74LVC1G00 Single 2-Input Positive-NAND Gate Datasheet, Rev. AC, August 2026.

[6] Texas Instruments. SNx4HCT00 Quadruple 2-Input Positive-NAND Gates Datasheet, Rev. F, revised October 2022.

[7] International Organization for Standardization. ISO 13849-1:2023, Safety of Machinery - Safety-Related Parts of Control Systems - Part 1: General Principles for Design, 4th ed., April 2023.


Processed in 1.768791 Second , 23 querys.