---
title: Combinational Logic Circuits
url: https://doc.liz6.com/en/hardware/05-digital-circuits/02-combinational-logic-circuits
locale: en
area: hardware
tags:
- hardware
- digital-circuits
date: 2026-06-30
modified: 2026-07-16
description: Combinational Logic Circuits What is Combinational Logic Combinational Logic — The output depends only on the current inputs, with no memory function. Combinati…
---

# Combinational Logic Circuits

## What is Combinational Logic

**Combinational Logic** — The output depends only on the current inputs, with no memory function.

<svg viewBox="0 0 720 210" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Combinational Logic Block Diagram: Inputs go directly to outputs via combinational logic, with no feedback or memory">
  <defs><marker id="cmb1-ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="210" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Combinational Logic: Output depends only on current inputs</text>
  <rect x="50" y="80" width="110" height="50" rx="8" fill="#e2e8f0"/>
  <text x="105" y="110" text-anchor="middle" font-size="13" font-weight="700" fill="#334155">Inputs</text>
  <line x1="160" y1="105" x2="245" y2="105" stroke="#475569" stroke-width="1.8" marker-end="url(#cmb1-ah)"/>
  <rect x="250" y="70" width="220" height="70" rx="8" fill="#4f46e5"/>
  <text x="360" y="100" text-anchor="middle" font-size="13" font-weight="700" fill="#ffffff">Combinational Logic</text>
  <text x="360" y="120" text-anchor="middle" font-size="11" fill="#e0e7ff">Pure gate circuits · No feedback</text>
  <line x1="470" y1="105" x2="555" y2="105" stroke="#475569" stroke-width="1.8" marker-end="url(#cmb1-ah)"/>
  <rect x="560" y="80" width="110" height="50" rx="8" fill="#e2e8f0"/>
  <text x="615" y="110" text-anchor="middle" font-size="13" font-weight="700" fill="#334155">Outputs</text>
  <rect x="60" y="158" width="600" height="38" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="76" y="182" font-size="12.5" fill="#3730a3">Difference from sequential logic: No clock, no state retention.</text>
</svg>

---

## Common Combinational Circuits

### Multiplexer (MUX)
<svg viewBox="0 0 720 300" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="2-to-1 Multiplexer Block Diagram: A and B are data inputs, S is the select line, routing A or B to output Y based on S">
  <defs><marker id="mux1-ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="300" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">2-to-1 MUX: Route A or B to output Y based on select line S</text>
  <rect x="60" y="86" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="105" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">A</text>
  <line x1="130" y1="100" x2="248" y2="112" stroke="#475569" stroke-width="1.6" marker-end="url(#mux1-ah)"/>
  <rect x="60" y="126" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="145" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">B</text>
  <line x1="130" y1="140" x2="248" y2="130" stroke="#475569" stroke-width="1.6" marker-end="url(#mux1-ah)"/>
  <rect x="60" y="166" width="70" height="28" rx="6" fill="#e2e8f0"/>
  <text x="95" y="185" text-anchor="middle" font-size="12" font-weight="700" fill="#334155">S</text>
  <line x1="130" y1="180" x2="248" y2="150" stroke="#475569" stroke-width="1.6" marker-end="url(#mux1-ah)"/>
  <text x="95" y="212" text-anchor="middle" font-size="10" fill="#64748b">Select Line</text>
  <rect x="250" y="80" width="180" height="90" rx="8" fill="#4f46e5"/>
  <text x="340" y="130" text-anchor="middle" font-size="14" font-weight="700" fill="#ffffff">2-to-1 MUX</text>
  <line x1="430" y1="125" x2="465" y2="125" stroke="#475569" stroke-width="1.8" marker-end="url(#mux1-ah)"/>
  <rect x="470" y="105" width="100" height="40" rx="6" fill="#ccfbf1"/>
  <text x="520" y="130" text-anchor="middle" font-size="13" font-weight="700" fill="#115e59">Y</text>
  <text x="60" y="230" font-size="12" fill="#334155">Y = S ? B : A (S=0 selects A, S=1 selects B) — Y = Ā·S + B·S</text>
  <rect x="60" y="248" width="600" height="36" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="76" y="271" font-size="12.5" fill="#3730a3">Applications: Signal routing, parallel-to-serial conversion, logic function implementation</text>
</svg>

### Decoder
```
n-bit input → 2ⁿ-bit output (only 1 bit is high at a time)

  2-to-4 Decoder:
    A1 A0 | Y0 Y1 Y2 Y3
     0  0 |  1  0  0  0
     0  1 |  0  1  0  0
     1  0 |  0  0  1  0
     1  1 |  0  0  0  1

Applications: Address decoding (chip select signals), 7-segment display driving
Typical chips: 74HC138 (3-to-8), 74HC154 (4-to-16)
```

### Encoder
```
Inverse of a decoder: 2ⁿ-bit input → n-bit output

Priority Encoder: When multiple inputs are active simultaneously, the output encodes the highest priority input.
Typical: 74HC148 (8-to-3 priority encoder)
```

### Adder

#### Half Adder (HA)
<svg viewBox="0 0 720 240" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Half Adder Block Diagram: Inputs A and B are added, producing Sum S and Carry C">
  <defs><marker id="ha1-ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="240" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Half Adder (HA): Adds two bits, outputs Sum and Carry</text>
  <rect x="60" y="86" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="105" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">A</text>
  <line x1="130" y1="100" x2="248" y2="100" stroke="#475569" stroke-width="1.6" marker-end="url(#ha1-ah)"/>
  <rect x="60" y="126" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="145" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">B</text>
  <line x1="130" y1="140" x2="248" y2="140" stroke="#475569" stroke-width="1.6" marker-end="url(#ha1-ah)"/>
  <rect x="250" y="75" width="180" height="80" rx="8" fill="#4f46e5"/>
  <text x="340" y="112" text-anchor="middle" font-size="14" font-weight="700" fill="#ffffff">Half Adder</text>
  <text x="340" y="130" text-anchor="middle" font-size="11" fill="#e0e7ff">HA</text>
  <line x1="430" y1="100" x2="465" y2="100" stroke="#475569" stroke-width="1.6" marker-end="url(#ha1-ah)"/>
  <rect x="470" y="85" width="190" height="30" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="565" y="105" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">S = A⊕B (Sum)</text>
  <line x1="430" y1="140" x2="465" y2="140" stroke="#475569" stroke-width="1.6" marker-end="url(#ha1-ah)"/>
  <rect x="470" y="126" width="190" height="30" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="565" y="146" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">C = A·B (Carry)</text>
  <rect x="60" y="185" width="600" height="36" rx="8" fill="#ffedd5"/>
  <text x="76" y="208" font-size="12.5" fill="#9a3412">No carry input; can only perform addition for the least significant bit.</text>
</svg>

#### Full Adder (FA)
<svg viewBox="0 0 720 280" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Full Adder Block Diagram: Inputs A, B, and Cin produce Sum S and Carry Cout, allowing cascading for multi-bit addition">
  <defs><marker id="fa1-ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="280" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Full Adder (FA): Includes carry input Cin, allowing cascading</text>
  <rect x="60" y="80" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="99" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">A</text>
  <line x1="130" y1="94" x2="248" y2="105" stroke="#475569" stroke-width="1.6" marker-end="url(#fa1-ah)"/>
  <rect x="60" y="120" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="139" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">B</text>
  <line x1="130" y1="134" x2="248" y2="130" stroke="#475569" stroke-width="1.6" marker-end="url(#fa1-ah)"/>
  <rect x="60" y="160" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="179" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">Cin</text>
  <line x1="130" y1="174" x2="248" y2="155" stroke="#475569" stroke-width="1.6" marker-end="url(#fa1-ah)"/>
  <rect x="250" y="70" width="180" height="120" rx="8" fill="#4f46e5"/>
  <text x="340" y="122" text-anchor="middle" font-size="14" font-weight="700" fill="#ffffff">Full Adder</text>
  <text x="340" y="142" text-anchor="middle" font-size="11" fill="#e0e7ff">FA</text>
  <line x1="430" y1="100" x2="465" y2="100" stroke="#475569" stroke-width="1.6" marker-end="url(#fa1-ah)"/>
  <rect x="470" y="85" width="190" height="30" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="565" y="105" text-anchor="middle" font-size="11" font-weight="700" fill="#115e59">S = A⊕B⊕Cin (Sum)</text>
  <line x1="430" y1="160" x2="465" y2="160" stroke="#475569" stroke-width="1.6" marker-end="url(#fa1-ah)"/>
  <rect x="470" y="145" width="190" height="30" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="565" y="165" text-anchor="middle" font-size="10.5" font-weight="700" fill="#115e59">Cout = A·B + (A⊕B)·Cin</text>
  <rect x="60" y="205" width="600" height="55" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="76" y="227" font-size="12.5" fill="#3730a3">Cout = A·B + (A⊕B)·Cin — Carry out if majority of inputs are 1.</text>
  <text x="76" y="246" font-size="12.5" fill="#3730a3">Cascading n full adders creates an n-bit adder.</text>
</svg>

#### Ripple Carry vs. Carry Lookahead
```
Ripple Carry:
  Carry propagates stage by stage → Large delay (n×t_fa)
  Simple, area-efficient

Carry Lookahead:
  All carries calculated in parallel → Small delay (O(log n))
  High complexity, larger area

Typical: 74HC283 (4-bit carry lookahead adder)
```

### Comparator
<svg viewBox="0 0 720 300" xmlns="http://www.w3.org/2000/svg" font-family="-apple-system,'Source Han Sans CN','Microsoft YaHei',sans-serif" role="img" aria-label="Comparator Block Diagram: Inputs A and B produce three comparison results: A > B, A = B, A < B">
  <defs><marker id="cmp1-ah" markerWidth="10" markerHeight="8" refX="8" refY="3" orient="auto"><path d="M0,0 L8,3 L0,6 Z" fill="#475569"/></marker></defs>
  <rect width="720" height="300" fill="#ffffff"/>
  <text x="360" y="28" text-anchor="middle" font-size="17" font-weight="700" fill="#1f2933">Comparator: Bit-by-bit comparison, outputs three magnitude relationships</text>
  <rect x="60" y="95" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="114" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">A</text>
  <line x1="130" y1="109" x2="248" y2="115" stroke="#475569" stroke-width="1.6" marker-end="url(#cmp1-ah)"/>
  <rect x="60" y="165" width="70" height="28" rx="6" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="95" y="184" text-anchor="middle" font-size="12" font-weight="700" fill="#3730a3">B</text>
  <line x1="130" y1="179" x2="248" y2="165" stroke="#475569" stroke-width="1.6" marker-end="url(#cmp1-ah)"/>
  <rect x="250" y="75" width="180" height="130" rx="8" fill="#4f46e5"/>
  <text x="340" y="145" text-anchor="middle" font-size="14" font-weight="700" fill="#ffffff">Comparator</text>
  <line x1="430" y1="98" x2="465" y2="98" stroke="#475569" stroke-width="1.6" marker-end="url(#cmp1-ah)"/>
  <rect x="470" y="85" width="120" height="26" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="530" y="103" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">A &gt; B</text>
  <line x1="430" y1="140" x2="465" y2="140" stroke="#475569" stroke-width="1.6" marker-end="url(#cmp1-ah)"/>
  <rect x="470" y="127" width="120" height="26" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="530" y="145" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">A = B</text>
  <line x1="430" y1="182" x2="465" y2="182" stroke="#475569" stroke-width="1.6" marker-end="url(#cmp1-ah)"/>
  <rect x="470" y="169" width="120" height="26" rx="6" fill="#f0fdfa" stroke="#99f6e4"/>
  <text x="530" y="187" text-anchor="middle" font-size="12" font-weight="700" fill="#115e59">A &lt; B</text>
  <rect x="60" y="225" width="600" height="50" rx="8" fill="#eef2ff" stroke="#c7d2fe"/>
  <text x="76" y="246" font-size="12.5" fill="#3730a3">Compares bit by bit from most significant to least significant.</text>
  <text x="76" y="264" font-size="12.5" fill="#3730a3">Typical chip: 74HC85 (4-bit comparator).</text>
</svg>

---

## Programmable Logic

### Basic Concept
```
Implement any logic using programmable devices instead of building gate circuits

PAL/GAL: Programmable AND array + Fixed OR array
CPLD: Multiple PAL blocks + Programmable interconnect
FPGA: Look-Up Table (LUT) + Flip-flops + Programmable interconnect
```

### FPGA LUT
```
An n-input LUT can implement any n-input logic function

3-LUT: 8 SRAM cells store the truth table + 3-level MUX tree
→ Implements any 3-input Boolean function!

Typical: 6-LUT (Xilinx), 4-LUT + Adder (Intel ALM)
```

---

## Timing Issues

### Propagation Delay (tpd)
```
Time required for a signal to stabilize from input to output

When multiple gates are cascaded: Total delay = Sum of individual gate delays
Critical Path: The path with the longest delay → Determines the maximum operating frequency of the circuit
```

### Glitches and Hazards
```
Different delays on multiple paths → Output may produce glitches

Detection: Check Karnaugh maps for uncovered adjacent prime implicants
Resolution: Add redundant terms or synchronize the output using a clock (registering the signal)
```

---

## Common Applications

| Circuit | Function | Chip |
|------|------|------|
| Tri-state Buffer | Control bus access | 74HC125/126 |
| Bus Transceiver | Bidirectional data transfer | 74HC245 |
| Latch | Level-triggered hold | 74HC373/573 |
| Shift Register | Serial/Parallel conversion | 74HC595 |

---
*Keywords: Combinational Logic, MUX, Decoder, Adder, Comparator, FPGA, LUT, glitch, Critical Path*
