FSM analysis and design, Hamming codes and multipliers — the complete unit, with every worked design stated in full and solved step by step.
The bridge. Unit 3 built the components: latches, flip-flops, registers, counters and shift registers (all of that lives in the Unit-3 notes — the Part-I deck repeats it almost word for word, so only the characteristic equations are recapped below). Unit 4 now treats sequential circuits as systems: you are given (or you invent) a behaviour and you must analyse a circuit into a state table, or design a circuit from a word statement. Around that core the unit adds four practical circuits — the Hamming error-correcting code, the ripple-carry vs carry-look-ahead adder delay story, and the 2-bit multiplier.
| Carried over from Unit 3 (memorise!) | Characteristic equation |
|---|---|
| SR flip-flop | Q+ = S + R′Q (S = R = 1 forbidden) |
| D flip-flop | Q+ = D |
| JK flip-flop | Q+ = JQ′ + K′Q |
| T flip-flop | Q+ = T ⊕ Q |
State equations. A state (transition) equation specifies the next state as a Boolean function of the present state and the inputs. For a circuit with D flip-flops it is read straight off the gates that drive each D pin. It is customary to write A(t+1) — or A+ — for "the value A will have after the next clock edge". The output equation is written the same way: y(t) = f(A, B, x).
State table — two equivalent forms. The state table enumerates the time sequence of inputs, outputs and flip-flop states — a truth table for the whole circuit. A circuit with m flip-flops and n inputs needs 2m+n rows. Form 1 has four sections (present state, input, next state, output) with one row per input combination. Form 2 collapses to three sections: next-state and output columns are grouped under each input value — this is the form you use for Mealy machines because it makes the transition pattern visible at a glance.
| Form | Sections | Rows | Best for |
|---|---|---|---|
| 1 — list form | PS · input · NS · output | 2m+n | reading a circuit mechanically |
| 2 — grouped form | PS · NS(x=0, x=1) · out(x=0, x=1) | 2m | Mealy diagrams, state reduction |
State diagram. The same information as a picture: one circle per state (binary value written inside), one directed edge per transition. On a Mealy machine each edge is labelled input/output; on a Moore machine the output lives inside the circle and edges carry only the input. The state table is easier to derive from a logic diagram; the state diagram is easier for humans to read — exams ask for both.
Flip-flop input equations. To draw a circuit from its behaviour you need the Boolean expressions feeding the flip-flop inputs — the excitation equations (e.g. DA = Ax + Bx, DB = A′x) plus the output equations (y = (A+B)x′). During analysis you read them off the diagram; during design you derive them from K-maps. They are the hinge between tables and hardware.
The circuit. Two D flip-flops A and B share one clock; input x enters the gate layer and output y leaves it. Reading the gates: DA = Ax + Bx (two ANDs into an OR), DB = A′x (inverter on A), and y = (A+B)·x′ (OR of the states, ANDed with the inverted input). Note the Mealy fingerprint already: y depends on x, not just on the state bits.
Step 1 — state equations. Because the FFs are of type D, Q+ = D substitutes directly, so A+ = Ax + Bx and B+ = A′x, with y = (A+B)x′. With D flip-flops the excitation equations are the state equations — no characteristic-table detour is needed. That is exactly why designs with D FFs are the fastest to both analyse and build.
Step 2 — the 8-row table. Two FFs + one input → 23 = 8 rows. For each row, plug (A, B, x) into the three equations. Example row A = 0, B = 1, x = 1: A+ = 0·1 + 1·1 = 1, B+ = 1·1 = 1, y = (0+1)·0 = 0. All eight rows (machine-checked):
| A | B | x | A₂ | B₂ | y |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Step 3 — read the behaviour. The output y = 1 whenever A or B is set and x = 0 — the machine "raises its hand" when the input falls back to 0 after any activity. Every state except 11 flows back to 00 on x = 0, and 00 moves to 01 on x = 1; state 01 either loops (x = 1) or returns with y = 1. The diagram below is the same table drawn as four circles with input/output edge labels.
A one-FF warm-up (Mano fig. 5-17). With DA = A ⊕ x ⊕ y the machine simply toggles whenever an odd number of (A, x, y) are 1. Its state table is the XOR truth table; the diagram is two circles where inputs 01 and 10 flip the state and inputs 00 and 11 self-loop. It behaves exactly like a T flip-flop with T = x ⊕ y — a nice reminder that any 1-FF machine is a T-FF in disguise.
JK circuit (Mano fig. 5-18). Now the FFs are JK type, so the characteristic equation Q+ = JQ′ + K′Q does real work. The gates give JA = B, KA = Bx′, JB = x′, KB = A ⊕ x. Substituting:
| A | B | x | J₁ | K₁ | J₂ | K₂ | A₂ | B₂ |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 |
T circuit (Mano fig. 5-21). With T flip-flops Q+ = T ⊕ Q, so each T input decides whether that bit flips. The gates give TA = Bx, TB = x and output y = AB. B therefore toggles on every x = 1 — B is a 1-bit counter of the input pulses — while A toggles only when x = 1 and B = 1, i.e. A counts the overflows of B. The pair is a 2-bit ripple counter being fed by x, and y fires when both bits are 1 (count 3).
| A | B | x | T₁ | T₂ | A₂ | B₂ | y |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 | 1 | 0 |
| 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
Two output conventions. Every synchronous FSM is built from the same two blocks — next-state logic and a state register — but the output block can be wired two ways. Mealy model: the output is a function of both the present state and the inputs, so it can change mid-cycle whenever an input changes. Moore model: the output is a function of the present state only, so outputs are synchronized with the clock and stay stable for a whole clock period. The difference is one wire: does the input reach the output logic or not.
| Property | Mealy | Moore |
|---|---|---|
| Output depends on | state and input | state only |
| Output timing | can change as soon as inputs change (async glitch risk) | changes only on clock edges — stable for a full period |
| States needed | fewer (output rides on edges) | usually more (a state per output value) |
| Diagram notation | edges labelled input/output | output written inside the circle, edges carry input only |
| Output glitching | possible | no (cleaner for driving other clocked logic) |
| Typical use | sequence detectors, fast response | controllers, vending machines, decoders |
The rule. Two states are equivalent if, for every possible input sequence, they produce exactly the same output sequence — starting from either state, the machine is externally indistinguishable. For a state table that means: two rows are equivalent when (a) their outputs match for every input value and (b) their next states are the same or themselves equivalent. The check is iterative: scan for obviously identical rows, delete one and replace all references to it, then repeat — removing one pair can unlock another (exactly what happens below).
Why bother? Fewer states → fewer flip-flops (5 states need 3 FFs, but 9 states would need 4), fewer K-maps, less logic — and the external input-output behaviour stays identical, which is the whole point: reduction never changes what the outside world observes.
The worked example (Mano fig. 5-22): a 7-state Mealy machine that answers "how long since a pattern completed". Here is its table (machine-checked):
| PS | Next state | Output | ||
|---|---|---|---|---|
| x=0 | x=1 | x=0 | x=1 | |
| a | a | b | 0 | 0 |
| b | c | d | 0 | 0 |
| c | a | d | 0 | 0 |
| d | e | f | 0 | 1 |
| e | a | f | 0 | 1 |
| f | g | f | 0 | 1 |
| g | a | f | 0 | 1 |
Pass 1: rows e and g are literally identical — NS (a, f), out (0, 1). Declare e ≡ g, delete g, replace every g with e (row f′s x=0 target becomes e). Pass 2: now d reads NS (e, f) and f reads NS (e, f) with outputs (0, 1) both — so d ≡ f; delete f, replace every f with d. The table shrinks to 5 states:
| PS | Next state | Output | ||
|---|---|---|---|---|
| x=0 | x=1 | x=0 | x=1 | |
| a | a | b | 0 | 0 |
| b | c | d | 0 | 0 |
| c | a | d | 0 | 0 |
| d | e | d | 0 | 1 |
| e | a | d | 0 | 1 |
Proof by sequence. Drive both machines with the demo input 01010110100. The 7-state machine walks a→a→b→c→d→e→f→f→g→f→g→a and outputs 00000 11010 0; the 5-state machine walks a→a→b→c→d→e→d→d→e→d→e→a and outputs exactly the same 00000110100. (The verification script also exhaustively proves output-equivalence on every input sequence.)
The job. After reduction the states have letters (a, b, c…); hardware needs binary codes. With n states you need at least ⌈log₂n⌉ flip-flops — 5 states → 3 FFs (3 bits give 8 codes, so 3 stay unused and act as don't-cares in the K-maps). The choice of which code goes to which state changes the amount of gate logic; a lucky assignment gives noticeably simpler equations, and the standard exam answer lists the three classic options below.
| State | Binary (counting) | Gray (adjacent) | One-hot (1 of n) |
|---|---|---|---|
| a | 000 | 000 | 00001 |
| b | 001 | 001 | 00010 |
| c | 010 | 011 | 00100 |
| d | 011 | 010 | 01000 |
| e | 100 | 110 | 10000 |
| FFs needed | ⌈log₂5⌉ = 3 | 3 | 5 |
Trade-offs. Binary uses the minimum flip-flops but the K-maps may stay large because neighbouring states get unrelated codes. Gray assigns codes that differ in one bit to states that are frequently visited in sequence — good when the state graph has a natural cycle, and it kills hazards in async contexts. One-hot spends one flip-flop per state (5 FFs here) but each next-state equation looks at far fewer variables and becomes a simple OR of transition terms — this is what FPGA tools do automatically because their fabrics are register-rich. For exams: state the bit count, draw the three columns, and say "one-hot trades flip-flops for simpler, faster decode logic; only one flip-flop is high at any time".
From words to wires. Every design question in this unit — sequence detectors, the vending machine, any controller — is answered by the same seven steps. The 3-bit up/down counter of Unit 3 was step-for-step the same procedure; here it runs on FSMs with outputs. Write the step numbers in the exam margin; markers look for them.
Choosing Mealy or Moore at step 1. If the output must fire on the same edge that completes the condition — sequence detectors — Mealy saves a state. If the output must be a clean, full-period level — a dispense pulse driving a mechanical gate — Moore is safer. Exams accept either unless the question fixes it; state your choice in one sentence.
Specification. Design a Mealy machine that outputs y = 1 on the clock edge where the input stream completes 110; overlapping is allowed (the stream 110110 reports twice). This is the exact worked example of the handwritten Unit-4 notes, done here with machine-verified algebra.
Step 1-2 — states and diagram. The machine must remember how much of "110" it has seen: nothing, "1", or "11" — three Mealy states. On input 0 from "11" the pattern completes: output 1, and since "110" ends in 0 the machine restarts in S0. On input 1 from "11" the last two symbols are still "11" — stay in S2 (that is the overlapping trick). Non-overlapping behaviour differs only in that arrow: S2 goes back to S0 with output 0.
| PS | Next state | Output y | ||
|---|---|---|---|---|
| x=0 | x=1 | x=0 | x=1 | |
| S0 (none) | S0 | S1 | 0 | 0 |
| S1 (1) | S0 | S2 | 0 | 0 |
| S2 (11) | S0 | S2 | 1 | 0 |
Step 4 — assignment. Three states, 2 FFs. Use the Gray walk along the detection path: S0 = 00, S1 = 01, S2 = 11 (code 10 unused → don't-care). This choice pays off immediately: every transition that sets QB is one that comes with x = 1.
Step 5 — excitation table (D-FFs: D = Q+).
| x | Q₁ | Q₂ | Q₁₂ | Q₂₂ | D₁ | D₂ | y |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | 1 | 1 | 1 | 0 |
| 0 | 1 | 1 | 0 | 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| state 10 (unused) → both D₁, D₂, y rows are X | X | ||||||
Step 6 — K-maps. Three 3-variable maps over (x, Q₁, Q₂), using X for the whole unused row:
| Q₁Q₂ | D₁ | D₂ | y | |||
|---|---|---|---|---|---|---|
| x=0 | x=1 | x=0 | x=1 | x=0 | x=1 | |
| 00 | 0 | 0 | 0 | 1 | 0 | 0 |
| 01 | 0 | 1 | 0 | 1 | 0 | 0 |
| 11 | 0 | 1 | 0 | 1 | 1 | 0 |
| 10 | X | X | X | X | X | X |
Step 7 — circuit and verify. Two D-FFs, one 2-input AND for D₁, a wire for D₂, a 3-input AND for y (with an inverter on x). Verification: simulate the stream 110110110 — outputs 001001001 (three overlapping hits), and the stream 1110110 — outputs 0001001: the "110" hiding inside "1110" is caught because the machine stayed in S2. Both match the specification FSM on every input (script-checked).
Non-overlapping variant. Change one transition: S2 —x=1→ S0 (output 0, fresh start). The K-maps then give D₁ = x·Q₁′·Q₂, D₂ = x·Q₁′, y unchanged. Same demo stream 1110110 now gives 0000001 — the "110" inside "1110" is missed because the machine wiped its memory at the third 1. Overlap costs one extra AND-input term; it buys detections that share symbols.
Specification. Detect 0111 in a serial stream — the handwritten notes run this as the Moore example with 5 states (Mealy needs only 4). A fresh 0 can always begin the next pattern, so every 0-input falls back to the "seen 0" state; that edge is what makes overlapping detections like 0110111 possible.
Moore version — 5 states. States remember the longest suffix of the stream that is a prefix of 0111: S0 (nothing), S1 ("0"), S2 ("01"), S3 ("011"), S4 ("0111" → output 1). From any state, a 0 either keeps you in S1 (if it starts a fresh match) or returns you to S1 (it can only ever extend a "0"-suffix — 0111 has no other 0-prefixes). From S4, a 1 restarts (suffix "1" matches nothing) — the notes' "jump to initial state".
| PS (out) | Next state | |
|---|---|---|
| x=0 | x=1 | |
| S0 (0) | S1 | S0 |
| S1 (0) | S1 | S2 |
| S2 (0) | S1 | S3 |
| S3 (0) | S1 | S4 |
| S4 (1) | S1 | S0 |
Implementation snapshot (D-FFs, Gray-path assignment S0=000, S1=001, S2=011, S3=010, S4=100; unused codes 101/110/111 as X). Five states need 3 flip-flops, and the K-maps (full 8-row excitation table) reduce to:
Verification (script-checked). Stream 0111011110111 walks S0 → S1 → S2 → S3 → S4(1) → S1 → S2 → S3 → S4(1) → S0 → S1 → S2 → S3 → S4(1) — three detections including the "…01111…" overlap case, outputs 00010001000 01. The equation-derived circuit reproduces the FSM on all 10 state/input pairs.
Mealy version — 4 states. Drop S4: the output rides on the edge S3 —1/1→ S0. With assignment S0=00, S1=01, S2=11, S3=10 the K-maps give D₁ = x·Q₂, D₂ = x′ + Q₁′Q₂, y = Q₁Q₂′x (all 8 rows verified). Note the teaching point the notes stress: because 0111 has no self-overlap (no proper suffix equals a prefix), the overlapping and non-overlapping Mealy machines are identical here — unlike 110, where S2's self-loop on 1 is the overlap.
Specification (the classic FSM word problem). The machine accepts nickels (N, 5¢) and dimes (D, 10¢), one coin per clock. When the total reaches 15¢ it releases a package of candy; if the total overshoots (20¢) it also returns 5¢ change. After release it returns to the starting state. The handwritten notes design exactly this as the "design application" of FSM theory.
Moore view — 5 states. States are totals: 0¢, 5¢, 10¢, plus release states 15¢ (output candy = 1) and 20¢ (candy = 1 and change = 1). Transitions add the coin value; S15 and S20 return to S0 unconditionally. This version is the cleanest to explain because the outputs sit inside the circles.
Implementable version — Mealy, 3 states, 2 FFs. Since "candy" fires on the release edge, a Mealy output works: states 0¢, 5¢, 10¢ with codes 00, 01, 10; inputs N and D (one-hot, never both 1 — treat N·D as don't-care). Transitions: 0¢ —N→ 5¢, 0¢ —D→ 10¢; 5¢ —N→ 10¢, 5¢ —D→ release (z = 1, back to 0¢); 10¢ —N→ release (z = 1), 10¢ —D→ release with change (z = 1, c = 1). The excitation table (6 used rows + 2 don't-care input rows) reduces to machine-checked equations:
Scenario checks (script-verified). N,N → 10¢, no candy yet; N,D or D,N or N,N,N → candy, no change; D,D or N,N,D → candy plus 5¢ change. The machine never reaches an illegal total because 20¢ is the only possible overshoot and the change edge handles it.
The method. Sometimes you have SR flip-flops in the drawer but the design asks for JK behaviour. Conversion wraps the given FF in a small gate layer so that the pair behaves like the desired FF. The recipe builds a conversion table: take the desired FF's truth table (J, K, Q, Q+), look up the required (given-FF input) values for each transition in the given FF's excitation table, then K-map the new inputs in terms of the desired FF's inputs and Q. It is exactly the design recipe of section 8 with one flip-flop as the "machine".
Worked: SR → JK. Write the JK truth table (8 rows), and for each row ask "what S, R makes an SR FF do this?" using the SR excitation table (Q→Q needs S=0, R=X; Q→1 needs S=1, R=0; Q→0 needs S=0, R=1; 1→1 and 0→0 are the "no change" rows):
| J | K | Q | Q₂ | S | R |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | X |
| 0 | 0 | 1 | 1 | X | 0 |
| 0 | 1 | 0 | 0 | 0 | X |
| 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 1 | X | 0 |
| 1 | 1 | 0 | 1 | 1 | 0 |
| 1 | 1 | 1 | 0 | 0 | 1 |
K-maps over (J, K, Q): S = 1 at rows 4, 6, 7 (Q = 0 side) → S = J·Q′; R = 1 at rows 3, 7 (Q = 1 side, K = 1) → R = K·Q. Both use the X entries to stay two literal AND gates. Sanity check the magic row J = K = 1, Q = 1: S = 1·0 = 0, R = 1·1 = 1 → reset — the SR pair toggles instead of going invalid. The conversion also repairs the forbidden SR condition: S = R = 1 becomes a toggle because S = JQ′ and R = KQ can never both be 1.
| Conversion | Gating | Note |
|---|---|---|
| SR → JK | S = JQ′, R = KQ | 11 becomes toggle, invalid state cured |
| SR → D | S = D, R = D′ | one inverter |
| SR → T | S = TQ′, R = TQ | T = 1 → toggle |
| D → JK | D = JQ′ + K′Q | AND-OR layer |
| D → T | D = T ⊕ Q | one XOR gate |
| D → SR | D = S + R′Q | SR characteristic as data |
| JK → T | T = JQ′ + KQ | J=K=1 → T = 1 → toggle |
| JK → SR | J = S, K = R | SR’s 11 now toggles (JK side effect) |
| T → D | T = D ⊕ Q | XOR layer |
Every row of this table is brute-force verified in the companion script — each converted pair reproduces the desired characteristic table on all 8 input combinations (with the SR "11" row handled as toggle/invalid where noted).
The idea. R. W. Hamming's code stores data together with parity bits (redundant bits) so that any single-bit error can be located and corrected. Data of k bits gets p parity bits, total n = k + p — written as an (n, k) code. The parity bits sit at power-of-two positions (1, 2, 4, 8, …) and each one parity-checks a group of positions: parity bit Pₖ checks every position whose binary representation contains 2i. Position numbers are the convention here: D3 means "the data bit standing at position 3".
(7, 4) layout and parity groups. Positions 1–7: P1, P2, D3, P4, D5, D6, D7. Each group must have even parity:
Encoding example (7, 4). Data 1011 → D3 = 1, D5 = 0, D6 = 1, D7 = 1. P1 = 1⊕0⊕1 = 0; P2 = 1⊕1⊕1 = 1; P4 = 0⊕1⊕1 = 0. Codeword (positions 1→7) = 0110011. Each group now holds an even number of 1s — that invariant is the whole code.
Correction. On reception, recompute each parity check (a XOR over the same group); the three check bits C₄C₂C₁ form the syndrome — a binary number that is 0 when the word is clean and otherwise names the erroneous position. Flip that bit; the data is recovered. The handwritten notes' example: received 1110101 (positions 7→1). C1 = 1⊕1⊕1⊕1 = 0, C2 = 0⊕1⊕1⊕1 = 1, C4 = 0⊕1⊕1⊕1 = 1 → syndrome 110₂ = 6: the 6th bit is wrong. Flip it: 1010101 — data bits (positions 7,6,5,3) = 1011. All 16 codewords × 7 single-error positions verified by script.
(9, 5) encoding — the notes' own example. Data 01101 (5 bits) needs p = 4, n = 9: positions 9→1 hold D9, P8, D7, D6, D5, P4, D3, P2, P1 with P1 = D3⊕D5⊕D7⊕D9, P2 = D3⊕D6⊕D7, P4 = D5⊕D6⊕D7, P8 = D9. Fill D9 = 0, D7 = 1, D6 = 1, D5 = 0, D3 = 1: P1 = 1⊕0⊕1⊕0 = 0, P2 = 1⊕1⊕1 = 1, P4 = 0⊕1⊕1 = 0, P8 = 0 → final code (positions 9→1) = 001100110 — exactly the handwritten notes' answer.
Where ripple time goes. In an n-bit ripple-carry adder each full adder cannot finish until its carry-in settles, and each carry needs two gate delays (carry = a·b + (a⊕b)·Cₗ: one AND, one OR). Carries therefore crawl stage by stage:
The look-ahead idea. Each stage announces two signals: generate Gₗ = aₗ·bₗ ("this stage creates a carry no matter what comes in") and propagate Pₗ = aₗ ⊕ bₗ ("this stage forwards an incoming carry"). The carry recursion Cₗ₊₁ = Gₗ + PₗCₗ then unrolls into flat two-level AND-OR expressions, so every carry is computed simultaneously:
Delay accounting. P and G form after 1 gate delay; the two-level AND-OR gives every C after 2 more; each sum is one XOR after its carry. So C₄ is ready after ~3 gate delays and all sums by ~4 — independent of width, against the ripple's 2n − 1 = 7…8. The price: the AND-OR gates grow wider (fan-in n+1 for Cₗ), so real 64-bit adders cascade 4-bit look-ahead blocks — but each block still beats ripple. The script verifies all 256 (a, b) pairs: the unrolled carries are bit-identical to the ripple carries.
Set the problem. Multiply A₁A₀ × B₁B₀ → product P₃P₂P₁P₀ (2+2 bits multiply to 4). Write the four partial products exactly as in long multiplication: A₀B₀ (weight 1), A₁B₀ and A₀B₁ (weight 2), A₁B₁ (weight 4). The weight-2 column can produce a carry into weight 4 — that carry chain is what the half adders absorb.
Worked check (10 × 11). A = 10₂ (2), B = 11₂ (3) → product must be 6 = 0110₂. P₀ = 0·1 = 0; A₁B₀ = 1·1 = 1, A₀B₁ = 0·1 = 0 → HA₁ gives P₁ = 1, C₁ = 0; A₁B₁ = 1·1 = 1 → HA₂(0, 1) gives P₂ = 1, C₂ = 0 → P₃ = 0. Output 0110 ✓. The heavy case is 11 × 11 = 9 = 1001: P₀ = 1; HA₁(1, 1) → P₁ = 0, C₁ = 1; HA₂(1, 1) → P₂ = 0, P₃ = 1 → 1001 ✓.
Why half adders suffice. No weight column ever sums three bits: weight 1 has one term, weight 2 has two terms (one HA), weight 4 has C₁ and A₁B₁ (one HA) — the second carry out of weight 4 lands in weight 8 as P₃ directly. That observation (no full adder needed) is the insight markers want spelled out.
| Item | Formula / rule |
|---|---|
| State-table size | 2m+n rows (m FFs, n inputs); grouped form: 2m |
| FF characteristic eqs | Q+ = S + R′Q · Q+ = D · Q+ = JQ′ + K′Q · Q+ = T ⊕ Q |
| Equivalence (reduction) | same outputs + equivalent next states for every input → merge rows |
| FF count | ⌈log₂(states)⌉; one-hot: 1 FF per state |
| Excitation inputs | D = Q+ · T = Q ⊕ Q+ · JK/SR from excitation table |
| 110 Mealy (overlap) | D₁ = xQ₂, D₂ = x, y = x′Q₁Q₂ (S0=00,S1=01,S2=11) |
| 0111 Moore | D₁ = xQ₂Q₃′, D₂ = xQ₁′Q₃, Q₃₂ = x′ + Q₂′Q₃, y = Q₁Q₂′Q₃′ |
| Vending (15¢) | D₁ = Q₁′(Q₂′D + Q₂N), D₂ = Q₁′Q₂′N, z = Q₁(N+D) + Q₁′Q₂D, c = Q₁Q₂′D |
| Conversions | S = JQ′, R = KQ · D = JQ′ + K′Q · D = T ⊕ Q · T = JQ′ + KQ |
| Hamming sizing | 2p ≥ p + k + 1; (7,4): P1 = D3⊕D5⊕D7, P2 = D3⊕D6⊕D7, P4 = D5⊕D6⊕D7 |
| Syndrome | C₄C₂C₁ = 0 clean; otherwise = position of the wrong bit |
| Ripple delay | Cₗ = 2n, sₗ₋₁ = 2n − 1, overflow = 2n + 1 gate delays |
| CLA | Pₗ = aₗ⊕bₗ, Gₗ = aₗbₗ, Cₗ₊₁ = Gₗ + PₗCₗ; C₄ ≈ 3, sums ≈ 4 gate delays |
| 2-bit multiplier | P₀ = A₀B₀; P₁/C₁ = HA(A₁B₀, A₀B₁); P₂/P₃ = HA(C₁, A₁B₁) |