Worked examples — Combinational multipliers
Before anything, a reminder of the three tiny machines we lean on, all built from picture-simple truth tables:
The scenario matrix
Every multiplication a combinational multiplier can face falls into one of these case classes. The examples below are labelled with the cell they cover, so you can see the whole space is filled.
| # | Case class | What makes it special | Covered by |
|---|---|---|---|
| C1 | Zero operand | one input all-zeros → every AND is | Ex. 1 |
| C2 | Multiply by power of two | multiplier is a single → pure left shift, no adding | Ex. 2 |
| C3 | Generic mixed bits | a few ones scattered → real partial-product summing | Ex. 3 |
| C4 | All-ones (worst carrying) | every AND → longest carry ripple, max delay | Ex. 4 |
| C5 | Maximum-value / width check | product hits the -bit ceiling | Ex. 5 |
| C6 | Non-square | rectangular grid, unequal shifts | Ex. 6 |
| C7 | Real-world word problem | map a story to bits, sanity-check units | Ex. 7 |
| C8 | Exam twist (spot the carry-into-carry) | a column that overflows twice | Ex. 8 |
| C9 | Signed / degenerate: negative operand | naive AND array gives the wrong answer; why & the fix | Ex. 9 |
The figure below is the map we will reuse: the dot diagram showing which AND product lands in which column.
Example 1 — Zero operand · Cell C1
Forecast: guess the product and guess how many AND gates fire before reading on.
- Form every partial product. Each bit is . Every . Why this step? The AND gate outputs only when both inputs are ; here one input is always , so every AND outputs . Zero gates "fire".
- The whole grid is zeros, so all six columns sum to . Why this step? Adding zeros anywhere leaves zero — no carries are ever born.
- Product .
Verify: , and the multiplier width would give bits, all zero. Units check: "5 apples, zero times" = no apples. ✓
Example 2 — Multiply by a power of two · Cell C2
Forecast: . What do you expect multiplying by to look like physically?
- Locate the single 1 in . Only ; . Why this step? A partial product is nonzero only where . With one , only one partial product survives.
- shifted left by . , so , placed starting at column . Why this step? The master formula weights by ; shifting a binary number left by columns multiplies it by .
- No summing needed — only one row is nonzero. Why this step? Adders exist to combine multiple partial products; with a lone survivor there is nothing to add.
- Product: shifted left by .
Verify: , and . ✓ Multiplying by a power of two is purely a shift — the deepest reason binary multiply is easy.
Example 3 — Generic mixed bits · Cell C3
Forecast: predict which of the four AND products (Figure s01) are .
- Fill the four ANDs. , . Why this step? Each dot in Figure s01 is one AND; we evaluate them so we know which dots are "lit".
- Column : only → . Why this step? has just one bit and it is ; nothing to add.
- Column : bits and . Half adder (two bits, no carry in): , → . Why this step? Two bits and no incoming carry is exactly the half-adder situation defined above.
- Column : bit plus carry → , .
- Column : just → .
- Product: .
Verify: . ✓ Matches the parent note's Worked Example 1.
Example 4 — All-ones, worst carrying · Cell C4
Forecast: with all four dots lit, which columns overflow?
- All four ANDs (Figure s02 lights every dot). Why this step? Both operands are all-ones, so for every pair — the busiest possible grid.
- Column : single bit → , no carry.
- Column : two bits , . Half adder: , carry → , . Why this step? : the column can hold only one bit, so the "10" writes and carries a up — exactly decimal carrying.
- Column : bit plus carry . Full adder (now a carry enters): , carry → , .
- Column : just → .
- Product: .
Verify: . ✓ Matches the parent's Worked Example 2.
Example 5 — Maximum value / width check · Cell C5
Forecast: guess whether the top bit (weight ) is set.
- Compute the value directly: . Why this step? We only need the magnitude to test the width bound; the bit-by-bit ripple is the same all-ones pattern as C4, just wider.
- Convert: . Why this step? Reading the bits tells us how many columns are occupied.
- Count bits: has bits. The ceiling is . ✓ Why this step? The parent's bound says ; , so bits always suffice and here we hit the top.
Verify: , , and bits. ✓ Matches the parent's Worked Example 3.
Example 6 — Non-square · Cell C6
Forecast: how many partial-product rows, and how wide is the answer?
- Two rows (one per bit of ): for , for . Each row is bits wide. Why this step? Number of rows (the multiplier's width); row width .
- (): , no shift → .
- (): , shift left by → . Why this step? carries weight ; shifting left by column applies that weight.
- Add the two rows with a small ripple adder: Why this step? The two surviving rows are summed exactly like a Ripple Carry Adder; carries propagate left.
- Product: . Width bits. ✓
Verify: , and it occupies bits . ✓
Example 7 — Real-world word problem · Cell C7
Forecast: how many bits will the address counter need to reach this total?
- Encode the operands: , (both ). Why this step? The multiplier works on bits; we translate the story's decimals first.
- Partial products (only 's -bits matter: , ):
- : shifted left =
- : shifted left = Why this step? kills (a C1-style zero row); the other two carry weights .
- Sum the two rows: Why this step? Summing shifted partial products is the "ADD stacks it" half of the multiplier.
- Product: bytes.
Verify: bytes . Units: (bytes/row)(rows) bytes — the "rows" cancel, so a byte count is correct. , so a -bit counter suffices. ✓
Example 8 — Exam twist: carry into a carry · Cell C8
Forecast: which column has the most bits stacked?
- Rows (, , ):
- (no shift)
- (since — a zero row)
- shifted left = Why this step? Two nonzero rows land with an overlap; we set up the column stacking.
- Stack by column (weights ): Column receives (from ) (from ) : write , carry into . Why this step? This is the "hot" column — the overlap of the two rows.
- Column : original (from ) carry : write , carry into . This is the twist — the carry created its own carry. Why this step? An incoming carry pushed a into another , so the overflow propagates — a full-adder chain, not a single half adder.
- Column : carry → bit .
- Assemble: result .
Verify: (). The double-overflow column is . ✓ This "carry begets carry" is precisely why deep columns need full adders, not half adders.
Example 9 — Signed / degenerate: a negative operand · Cell C9
Forecast: guess whether the array gives or something else entirely.
- The array is blind to sign — it just does on the bit patterns. So it multiplies as if it were the unsigned value . Why this step? The AND gate has no notion of a sign bit; it treats the top bit as weight , positive.
- Unsigned result: . Why this step? We compute what the hardware literally produces so we can compare to the intended answer.
- Intended answer: , which in -bit two's complement is . Why this step? This is the correct signed product; it disagrees with step 2 — the naive array is wrong for signed inputs.
- Why it fails: two's complement treats the top bit as weight , but the AND array treats it as . That single sign flip corrupts every partial product touching bit . Why this step? Identifies the root cause — a weighting mismatch, not a wiring bug.
- The fix: either (a) sign-extend both operands to the full width and use signed adders, or (b) use Booth's Algorithm, which recodes the multiplier so runs of s become one subtraction, correctly handling the negative weight. Why this step? These are the standard remedies; Booth is the one the parent note flags for signed numbers.
Verify: unsigned array output ; the intended signed value . These differ, confirming the naive array is invalid for signed operands. ✓
Recall Quick self-test across the matrix
Zero operand → product? ::: ; no AND fires (C1). Multiply by costs how many adders? ::: None — it is a pure left shift (C2). All-ones input triggers what worst case? ::: Longest carry ripple → delay (C4). fits in how many bits? ::: (C5). Non-square : rows and product width? ::: rows, -bit product (C6). Feeding two's-complement bits to an unsigned array gives? ::: A wrong answer; needs sign-extension or Booth (C9).
Connections
- Combinational multipliers — parent topic
- AND Gate — forms every partial-product bit
- Half Adder / Full Adder — the summing cells (half where no carry enters)
- Ripple Carry Adder — the carry chain summing rows (Ex. 6)
- Carry Save Adder / Wallace Tree — beat the C4 worst-case delay
- Binary Number System — positional weights
- Booth's Algorithm — the fix for the signed case (C9)
- Combinational Circuits — no clock, product falls out after gate delay