3.3.12 · D3Combinational Circuits

Worked examples — Combinational multipliers

2,631 words12 min readBack to topic

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.

  1. 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".
  2. The whole grid is zeros, so all six columns sum to . Why this step? Adding zeros anywhere leaves zero — no carries are ever born.
  3. 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?

  1. Locate the single 1 in . Only ; . Why this step? A partial product is nonzero only where . With one , only one partial product survives.
  2. 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 .
  3. 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.
  4. 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 .

  1. 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".
  2. Column : only . Why this step? has just one bit and it is ; nothing to add.
  3. 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.
  4. Column : bit plus carry , .
  5. Column : just .
  6. 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?

  1. All four ANDs (Figure s02 lights every dot). Why this step? Both operands are all-ones, so for every pair — the busiest possible grid.
  2. Column : single bit , no carry.
  3. 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.
  4. Column : bit plus carry . Full adder (now a carry enters): , carry , .
  5. Column : just .
  6. 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.

  1. 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.
  2. Convert: . Why this step? Reading the bits tells us how many columns are occupied.
  3. 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?

  1. 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 .
  2. (): , no shift → .
  3. (): , shift left by . Why this step? carries weight ; shifting left by column applies that weight.
  4. 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.
  5. 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?

  1. Encode the operands: , (both ). Why this step? The multiplier works on bits; we translate the story's decimals first.
  2. Partial products (only 's -bits matter: , ):
    • : shifted left =
    • : shifted left = Why this step? kills (a C1-style zero row); the other two carry weights .
  3. Sum the two rows: Why this step? Summing shifted partial products is the "ADD stacks it" half of the multiplier.
  4. 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?

  1. 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.
  2. 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.
  3. 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.
  4. Column : carry → bit .
  5. 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.

  1. 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.
  2. Unsigned result: . Why this step? We compute what the hardware literally produces so we can compare to the intended answer.
  3. 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.
  4. 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.
  5. 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