Practical applications

Applications of Logic Gates in Digital Design

Explore how AND, OR, NOT, NAND, and NOR gates are used in arithmetic units, control logic, encoders, multiplexers, and FPGA LUTs in real digital systems.

Visual

Inputs A BCarry-inLogic GatesXOR / AND / ORSum OutCarry OutFull Adder Unit

Concept overview

Logic gates are the physical implementation of Boolean operations. In silicon, each gate is a small network of NMOS and PMOS transistors that produces a defined output voltage level based on its input voltages. NAND and NOR gates are considered universal because any Boolean function can be built from either type alone. In practice, combinational circuits built from logic gates compute arithmetic, select data paths, encode and decode signals, and generate control signals throughout a digital system.

Real-world applications

Arithmetic Logic Unit in RISC-V Cores
Processor Design
The SiFive E31 RISC-V processor core contains an ALU built from cascaded full adders, each constructed from XOR, AND, and OR gates. Carry-lookahead logic using AND-OR networks computes carry bits in parallel rather than rippling, reducing addition latency to a fixed number of gate delays regardless of word width.
NAND Flash Memory Cell Selection
Semiconductor Memory
In NAND flash arrays such as those in Micron 3D NAND dies, word line and bit line selection logic uses AND gates to activate the exact row and column intersection corresponding to the addressed cell. The peripheral logic is implemented in standard cell libraries where the 2-input NAND gate is the base unit.
Programmable Logic in Xilinx 7-Series FPGA
Reconfigurable Computing
Each configurable logic block (CLB) in a Xilinx 7-series FPGA contains look-up tables (LUTs). A 6-input LUT stores a 64-bit truth table and can implement any Boolean function of up to six variables in a single gate delay, replacing discrete AND, OR, NAND, and NOR chains with a RAM-based lookup.

How it works in practice

A 1-bit full adder takes three inputs: A, B, and carry-in Cin. The sum output is A XOR B XOR Cin. The carry-out is (A AND B) OR (B AND Cin) OR (A AND Cin). In a 32-bit ripple-carry adder, 32 full adders are chained so carry-out of bit 0 feeds carry-in of bit 1, and so on. The critical path delay equals 32 times the gate delay of one full adder. A carry-lookahead adder computes generate (G = A AND B) and propagate (P = A XOR B) for all bit positions simultaneously, then computes all carries in parallel using a two-level AND-OR network, reducing the critical path to a constant. In FPGA LUTs, a 6-input LUT is loaded with the truth table of the desired function during configuration. The six inputs address one of 64 SRAM cells, and the stored bit appears at the output. Chaining LUTs allows implementation of functions with more than six inputs.

Examples

Priority Encoder Using OR and AND Gates
A 4-to-2 priority encoder maps four input lines D3 to D0 to a 2-bit binary output indicating the highest-priority active input. The output bit A1 is D3 OR D2. The output bit A0 is D3 OR (NOT D2 AND D1). A valid output indicator is D3 OR D2 OR D1 OR D0. These three expressions require six gates in total. Priority encoders appear in interrupt controllers such as the Intel 8259A PIC, where multiple devices request CPU attention simultaneously and the encoder selects the highest-priority pending interrupt.
2-to-1 Multiplexer from NAND Gates
A 2-to-1 MUX selects input A when select S is low and input B when S is high. Using only NAND gates: output Y equals NAND(NAND(A, NOT S), NAND(B, S)). This requires four 2-input NAND gates and one inverter, which is itself a 1-input NAND. The NAND-only implementation is used in standard cell libraries because NAND gates are faster and smaller than equivalent AND-OR networks in CMOS. Data sheet characterisation for the 74HC157 quad 2-to-1 MUX shows this topology directly.

Future scope

Gate-level simulation is being replaced at the verification stage by formal methods that prove correctness for all possible input combinations, removing the need to enumerate test vectors for complex arithmetic circuits. At the physical level, nanosheet and gate-all-around transistor geometries at 2 nm and below are changing how standard cells are designed because drive strength and leakage trade-offs shift compared to FinFET. Adiabatic logic families that recover switching energy from capacitive nodes rather than dissipating it as heat are an active research area for low-power wearable SoCs.