Why This Matters
A 64-bit ripple-carry adder built from full adders with a 90 ps carry delay has a worst-case carry path near 5.76 ns before wire delay. At 3 GHz, one clock cycle is about 333 ps, so that adder cannot sit alone on one cycle without a different architecture or pipelining.
Combinational circuits are the stateless part of digital computation. Integer addition, address comparison, instruction decoding, multiplexing, and much of a CPU datapath are Boolean functions realized as gates and wires. The same rules also explain why a simulator may show a temporary wrong value for a few picoseconds before the final output settles.
Core Definitions
Combinational circuit
A combinational circuit is an acyclic interconnection of logic gates whose outputs at time are functions only of the input values applied at time , for some finite propagation delay . It has no memory elements and no feedback loop that stores a previous value.
Propagation delay
The propagation delay of a gate or wire segment is the time between an input transition crossing its switching threshold and the corresponding output transition crossing its threshold. In a combinational network, the worst-case delay is the maximum total delay over all input-to-output paths.
Critical path
The critical path is a path from some primary input to some primary output with maximum total delay. For a clocked system, the clock period must exceed the longest combinational delay between source and destination registers, plus register timing margins.
Fan-out
The fan-out of a signal is the number of gate inputs driven by that signal. Larger fan-out increases capacitance and usually increases delay. Logic equations alone do not capture this electrical loading.
A combinational circuit can be specified by a truth table, a Boolean expression, a gate-level netlist, or a hardware description language fragment. These are different views of the same object when the netlist is acyclic.
From Gates to Adders
A half-adder adds two one-bit inputs, and . It produces a sum bit and carry bit .
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
The equations are and .
a ─────┬──── XOR ─── s
│
b ─────┘
a ─────┬──── AND ─── c
│
b ─────┘
A full-adder adds , , and an incoming carry . It emits and .
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
A useful implementation uses two half-adders and an OR gate:
a ─────┬──── XOR ── x ─── XOR ─── s
│ │
b ─────┘ │
│
c_in ────────────────────┘
a ─────┬──── AND ── c1 ──┐
│ │
b ─────┘ OR ─── c_out
│
x ─────┬──── AND ── c2 ──┘
│
c_in ──┘
A ripple-carry adder chains full-adders. For bit , it computes:
Worked 4-bit example, adding and :
| bit | |||||
|---|---|---|---|---|---|
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 | 1 |
| 2 | 1 | 0 | 1 | 0 | 1 |
| 3 | 0 | 0 | 1 | 1 | 0 |
The result is . The carry must travel through all four stages in this input case.
A C version is a useful executable specification:
#include <stdint.h>
uint8_t add4(uint8_t a, uint8_t b) {
uint8_t carry = 0;
uint8_t sum = 0;
for (int i = 0; i < 4; i++) {
uint8_t ai = (a >> i) & 1;
uint8_t bi = (b >> i) & 1;
uint8_t s = ai ^ bi ^ carry;
uint8_t cout = (ai & bi) | (carry & (ai ^ bi));
sum |= s << i;
carry = cout;
}
return sum | (carry << 4);
}
For a = 0x7 and b = 0x1, this returns 0x08. For a = 0xF and b = 0x1, it returns 0x10, a five-bit result.
Carry Lookahead as a Prefix Computation
Ripple-carry addition has linear carry depth. Carry-lookahead reduces depth by separating each bit into generate and propagate signals.
For bit :
Here means bit generates a carry no matter what came in. means bit passes an incoming carry to the next bit.
For a 4-bit adder:
For , , and :
| 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 1 |
| 2 | 1 | 0 | 0 | 1 |
| 3 | 0 | 0 | 0 | 0 |
Then , , , and . The sum bits are , giving for bits 0 through 2 and for bit 3.
A prefix adder computes combined generate-propagate pairs. For a block from bit through bit :
Then . A tree can combine adjacent pairs using:
This is the same associativity pattern as prefix sums. With a balanced tree, carry depth grows as gate levels instead of . The tradeoff is more gates and more wiring.
Multipliers from Shift and Add
Unsigned binary multiplication decomposes into partial products. Each bit of the multiplier either selects a shifted copy of the multiplicand or selects zero.
Compute using 4-bit inputs:
1101 13
x 1011 11
-----
1101 bit 0 is 1
11010 bit 1 is 1, shifted left 1
000000 bit 2 is 0
1101000 bit 3 is 1, shifted left 3
-------
10001111 143
At the gate level, each partial product bit is an AND:
Then add shifted rows with adders. A direct array multiplier for 4 by 4 bits creates 16 AND gates and a grid of half-adders and full-adders. Its delay is usually dominated by carry propagation through the addition structure, not by the AND gates.
A shift-and-add sequential multiplier reuses one adder across cycles, but that circuit has state and is not purely combinational. A combinational multiplier does all selected shifts and additions in one combinational network, with one final output after the critical path settles.
Comparators and Magnitude Circuits
Equality is the easiest comparator. Two -bit words are equal exactly when every bit pair matches:
For and , the XOR vector from bit 7 to bit 0 is 00001000, so the equality output is 0.
A magnitude comparator decides , , or . For unsigned numbers, compare from most significant bit downward. At the first differing bit, the word with 1 is larger.
For 4-bit words and :
where .
Worked example, and :
| bit | local | |||
|---|---|---|---|---|
| 3 | 1 | 0 | 0 | 1 |
| 2 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 0 | 1 | 1 | 1 | 0 |
The most significant differing bit is bit 3, so . Lower bits do not matter after bit 3 differs.
Delay, Critical Paths, Fan-Out, and Hazards
In a simple delay model, assign each gate a delay and add delays along paths. Suppose XOR has 70 ps delay, AND has 40 ps, OR has 40 ps, and a full-adder carry is implemented as .
For a carry input reaching after is already stable, the path is AND then OR, or 80 ps. If or changes and affects carry through XOR, AND, OR, the path is 150 ps. In a 32-bit ripple-carry adder, a worst-case carry propagation estimate using 80 ps per stage is 2.56 ns. A final sum bit may need one more XOR delay, so about 2.63 ns, excluding wire delay and input register delay.
Fan-out changes these numbers. A signal driving one nearby gate input may switch faster than a signal driving 32 gate inputs across a chip. Textbook Boolean algebra treats wires as free. Physical circuits do not.
Hazards are temporary wrong outputs caused by unequal path delays. Consider:
For and , the Boolean function is always 1, no matter what is. A gate network can still glitch when changes from 1 to 0.
Assume NOT delay is 20 ps, AND delay is 30 ps, OR delay is 30 ps. Initially , so and . When falls to 0, the direct path to turns off after 30 ps, while the inverted path turns on after 20 ps plus 30 ps, or 50 ps. For about 20 ps, both AND outputs can be 0, so the OR output drops to 0 before returning to 1.
The consensus term removes this static-1 hazard:
For , the extra term is 1 during the transition. This does not change the truth table, but it changes transient behavior.
Main Theorem
Sum-of-Products Universality for Combinational Circuits
Statement
Every Boolean function can be implemented by an acyclic combinational circuit using AND, OR, and NOT gates.
Intuition
A truth table names every input row where the function returns 1. Build one small detector for each such row, then OR all detectors together.
Proof Sketch
For each input vector with , form a minterm . The minterm contains when and when , all joined by AND. This minterm is 1 exactly on row and 0 on every other row. Then compute as the OR of all minterms for which . If no rows return 1, use the constant 0 circuit. If every row returns 1, the OR contains all minterms or can be simplified to constant 1.
Why It Matters
This theorem justifies treating truth tables, Boolean expressions, and combinational gate networks as equivalent descriptions. Adders, comparators, decoders, multiplexers, and fixed lookup tables are all special cases.
Failure Mode
The construction may be large. A function with about half of its rows equal to 1 needs about minterms in the direct construction. Universality is not a size guarantee.
Common Confusions
A temporary glitch is not stored state
A hazard can make an output pulse for 20 ps, but that does not make the circuit sequential. If the network is acyclic and contains no latch or flip-flop, the final settled output remains a function of current inputs. State appears when feedback or storage elements preserve information after inputs change.
Carry-lookahead does not make addition constant time
Carry-lookahead reduces the depth of carry computation with a prefix tree. With bounded fan-in gates and real wires, depth grows with word size, often like at the logic level. Wire delay and fan-out still matter.
The truth table ignores delay
A truth table specifies settled values. It does not specify whether an output briefly glitches before settling. Two circuits can implement the same Boolean function and have different transient behavior.
Exercises
Problem
Build the full-adder outputs for , , and . Give , , and the internal values , , and .
Problem
For an 8-bit ripple-carry adder, assume the carry path through one full-adder takes 85 ps and the final sum XOR takes 60 ps. Estimate the worst-case delay from to .
Problem
For , use delays NOT 20 ps, AND 30 ps, and OR 30 ps. Let and let switch from 1 to 0 at time 0. Give the time interval during which the OR inputs are both 0.
References
Canonical:
- Charles Petzold, Code: The Hidden Language of Computer Hardware and Software, 2nd ed. (2022), ch. 10-14. Relays, gates, adders, and binary arithmetic.
- David A. Patterson and John L. Hennessy, Computer Organization and Design: The Hardware/Software Interface, 5th ed. (2013), Appendix B. Logic gates, combinational logic, adders, and ALU building blocks.
- J. Clark Scott, But How Do It Know? The Basic Principles of Computers for Everyone (2009), ch. 2-8. Gates, adders, memory contrast, and datapath intuition.
- M. Morris Mano and Michael D. Ciletti, Digital Design, 5th ed. (2013), ch. 3-4. Boolean algebra, gate-level simplification, combinational logic, adders, subtractors, and comparators.
- John F. Wakerly, Digital Design: Principles and Practices, 4th ed. (2006), ch. 4-6. Combinational logic design, timing, hazards, and arithmetic circuits.
Accessible:
- Nand2Tetris, Boolean Arithmetic and Combinational Chips project materials.
- MIT OpenCourseWare, 6.004 Computation Structures, combinational logic and timing lectures.
- Ben Eater, Building an 8-bit breadboard computer, videos on adders and arithmetic logic.
Next Topics
/computationpath/sequential-circuits/computationpath/finite-state-machines/computationpath/instruction-decoders/computationpath/arithmetic-logic-units/topics/boolean-algebra