Skip to main content
Be Bitwise

Combinational Logic Circuits

Digital Logic Design · Hardware Foundations track

5 min read

In this module

Two Families of Digital Circuits

Every digital circuit lands in one of two camps:

  • Combinational circuits — output depends only on the current inputs. No memory, no history. Change the inputs and the outputs follow along almost instantly, after a tiny propagation delay. Logic gates, adders, and multiplexers all live here.
  • Sequential circuits — output depends on the current inputs and the circuit's previous state. These hold memory elements (flip-flops or latches) and march to a clock signal. Registers, counters, and state machines are sequential.

This lesson sticks to combinational circuits. We'll build up from the simplest arithmetic block, the half adder, until we've got something that can add multi-bit numbers.

Key Concept

Combinational circuits have no memory: outputs are a pure function of inputs. Sequential circuits include memory elements and depend on both current inputs and past state. Understanding this distinction is fundamental to digital design.

The Half Adder

A half adder takes two single-bit inputs, A and B, and produces two outputs:

  • Sum (S) — the result of A + B, ignoring any carry. That's just A XOR B.
  • Carry (C) — 1 only when both inputs are 1, signalling that the sum has overflowed into the next bit position. That's A AND B.
ABSum (S)Carry (C)
0000
0110
1010
1101

It's called "half" because it has no way to accept a carry from a previous stage. Adding multi-bit numbers means dealing with carries rippling from one bit position to the next, which a half adder simply can't do on its own.

The Full Adder

A full adder picks up where the half adder leaves off, accepting a third input: carry-in (Cin). It sums three single-bit values — A, B, and Cin — and produces a sum and a carry-out (Cout).

ABCinSumCout
00000
00110
01010
01101
10010
10101
11001
11111

The Boolean expressions are:

c
Sum = A XOR B XOR Cin
Cout = (A AND B) OR (Cin AND (A XOR B))

You can build a full adder from two half adders and an OR gate. The first half adder computes A XOR B and A AND B. The second takes that partial sum and folds in Cin. The OR gate combines the two carry outputs into a single Cout.

Key Concept

A half adder adds two bits, producing a sum and a carry. A full adder adds two bits plus a carry-in, producing a sum and a carry-out. The full adder is the essential building block for multi-bit addition.

The Ripple-Carry Adder

Multi-bit addition just chains full adders end to end. Each stage's carry-out plugs straight into the next stage's carry-in. The arrangement is called a ripple-carry adder because the carry "ripples" from the least significant bit up to the most significant.

For a 4-bit adder that computes A[3:0] + B[3:0]:

  • Full Adder 0 receives A[0], B[0], and an initial carry-in of 0.
  • Its carry-out feeds into Full Adder 1, which receives A[1] and B[1].
  • This continues through all bit positions.
  • The final carry-out is the carry flag. For unsigned numbers it signals overflow: the true sum didn't fit in four bits.

For signed (two's complement) numbers the carry-out says nothing on its own. Signed overflow happens when the carry into the top bit differs from the carry out of it, so it's computed as C3 XOR C4 (equivalently, both inputs share a sign and the result has the other one). The ALU lesson shows how both become status flags.

A 32-bit ripple-carry adder is just 32 full adders in a chain. The catch is speed. Worst-case delay scales with the number of bits, because each adder is stuck waiting on the carry from the previous stage. Real processors swap in faster designs like carry-lookahead adders that compute carries in parallel and skip the wait.

Karnaugh Maps

When you're sketching combinational circuits you often want to boil a truth table down to its simplest Boolean expression. Karnaugh maps (K-maps) give you a visual way to do it.

A K-map lays out truth table entries in a grid where adjacent cells differ by exactly one variable. Group neighbouring 1s into rectangular blocks and you can read off a minimised expression on the spot. For functions of four or five variables, K-maps can shave the gate count down dramatically.

Try It Yourself

The canvas below has the wiring of a full adder already in place: two gates fed by A and B, two fed by the first gate and Cin, and one combining the carries. Every gate starts as an AND, so the circuit is wrong. Click a gate to change its type and find a setting where all eight rows match the full adder table above. The checker marks each wrong output with a cross.

More than one setting passes. Once you've found the two-half-adders version, look for a second one in which the carry side uses no AND or OR at all.

Click an input to toggle it, or a gate to change its type.
0A0B0CinANDg1ANDg2ANDg3ANDg4ANDg50Sum0Cout

2 of 8 rows match the target. Wrong outputs are marked with a cross.

Truth table
ABCinSumCout
00000
0010 ✗0
0100 ✗0
01100 ✗
1000 ✗0
10100 ✗
11000 ✗
11111
Answers

g1 and g2 are XOR, which gives Sum = A XOR B XOR Cin. For the carry, g3 and g4 as AND with g5 as OR is the textbook version. g5 as XOR also passes, because A AND B and Cin AND (A XOR B) are never both 1. The third answer makes g3, g4 and g5 all NAND: by De Morgan, NAND(NAND(a, b), NAND(c, d)) equals (a AND b) OR (c AND d), which is why chip designers can build sum-of-products logic from NAND gates alone.