Binary multiplication 2026-10-31
For nonnegative integers with binary representation , multiply by by summing the shifted terms . Each term is either zero or a left bit shift of . An unsigned -bit input pair needs at most product bits, because . This expansion follows from distributivity and motivates a binary multiplier.
Digital register 2026-10-31
A fixed-width collection of flip-flops storing a binary representation. A synchronous load-enabled digital register captures all its input bits on the active clock edge when load is asserted and otherwise retains its old value. One multiplexer before each D flip-flop can select new data or feedback from its old output. A processor register is a particular use inside a processor; temporary state in a standalone binary multiplier is another.
Split the four-bit unsigned inputs into two-bit halves: and . Use four copies of the two-bit binary multiplier to compute , , , and . ThenThe extreme terms occupy disjoint output positions: uses positions zero to three and uses positions four to seven. Form by concatenating their four-bit outputs, with in the upper half and in the lower half. This needs wiring alone, so without an adder.
Use the first eight-bit adder to form after zero-extension, and the second to form . Thus four two-bit binary multipliers and two eight-bit adders suffice. The fixed left bit shift is also wiring alone.
Use unsigned inputs as in the preceding parts. Store a 16-bit accumulator , a 16-bit shifted multiplicand , an eight-bit multiplier , and a three-bit iteration binary counter . The sequential circuit has one 16-bit adder, a 16-bit multiplexer selecting or zero from , fixed one-place bit shifts, and load/hold selection for the digital registers. The input values are captured when
start is accepted, so later input changes cannot alter the operation.Use three control states with the following synchronous transition table. All assignments in a row use the old digital register values and occur together at the active clock edge.
| State | Condition | Register updates | Next state | IDLE | start = 0 | Hold all digital registers | IDLE | IDLE | start = 1 | , , , | RUN | RUN | , , , | RUN | RUN | , , ; hold | DONE | DONE | start = 1 | Hold all digital registers | DONE | DONE | start = 0 | Hold all digital registers | IDLE |
|---|
Reset selects IDLE and clears the digital registers. Set and
done = 1 exactly in DONE. A start pulse in IDLE launches one multiplication; further pulses during RUN are ignored. Holding start high cannot repeatedly launch operations: DONE waits for it to go low before rearming. The product remains stored while waiting and through the following IDLE state. There are eight RUN clock edges after the loading edge; the last addition is captured before done becomes high.For correctness, let denote the captured values. After iterations, for , the loop invariant isso . Writing , the next accumulation adds , the left bit shift doubles , and the logical right shift changes to . Hence the invariant is preserved. At , , giving . The largest product is , so the accumulator fits. Even the final shifted multiplicand is , so it also fits.
