Tabular Minimisation, Hazards, and Designing Sequential Circuits (Mealy, Moore, Counters)
Hazards: Static, Dynamic and the Consensus Term
A static-1 hazard is a momentary 0 on an output that should stay at 1 when a single input changes; a static-0 hazard is a momentary 1 on an output that should stay 0; a dynamic hazard is several transitions where one is intended, and needs three or more levels of logic. They are caused by unequal path delays: for an instant one product term has switched off before the other has switched on. In an SOP circuit the cause is two adjacent 1s on the K-map that are covered by different product terms with no term covering both. Example: F = AB′ + BC. With A = C = 1 and B changing, F is 1 before and after, but the two minterms 101 and 111 are covered by AB′ and BC respectively (the program lists the uncovered adjacent pair: 101–111). Adding the consensus term AC covers both, so F = AB′ + BC + AC has no static-1 hazard and the function is unchanged (verified for all 8 inputs). The rule: to be free of static-1 hazards (single input change), every pair of adjacent 1s must lie inside some product term; a product-of-sums circuit has the dual problem, static-0 hazards, cured by adding a redundant sum term.
- Static-1Momentary 0 where output stays 1
- Static-0Momentary 1 where output stays 0
- DynamicSeveral transitions where one is intended
A static-1 hazard is a momentary 0 on an output that should stay at 1 when a single input changes; a static-0 hazard is a momentary 1 on an output that should stay 0; a dynamic hazard is…
Mealy and Moore Machines, and State Minimisation
A Moore machine's output is a function of the state only, so it is attached to the state circle and changes only at a clock edge. A Mealy machine's output is a function of state and current input, attached to the transition arrow, so it can react within the same cycle and — because the input is asynchronous to the clock — can glitch or change mid-cycle. Any Mealy machine can be converted to a Moore machine, usually at the cost of more states (at most a multiplication by the number of distinct outputs). Take the overlapping '101' detector (output 1 when the last three inputs are 1, 0, 1). Mealy: 3 states — S0 (no progress), S1 (seen 1), S2 (seen 10); in S2 an input 1 gives output 1 and goes to S1 because the final 1 can start a new match. Moore: 4 states — the extra state S3 ('seen 101') carries the 1. The program ran both against a direct check of the last three bits on 16000 random input bits with no mismatch. The number of flip-flops is ⌈log₂(states)⌉: 2 for either machine.
| Present state | Next state (x = 0 / x = 1) | Mealy output (x = 0 / x = 1) |
|---|---|---|
| S0 | S0 / S1 | 0 / 0 |
| S1 | S2 / S1 | 0 / 0 |
| S2 | S0 / S1 | 0 / 1 |
State minimisation. Two states are equivalent if no input sequence can tell them apart (same outputs, equivalent successors). The partition method starts with states grouped by identical outputs and refines the groups by successor groups until stable; the surviving blocks are the minimal machine. Fewer states can mean fewer flip-flops and always means less next-state logic. For an incompletely specified machine (don't-care entries) minimisation uses compatibility instead, and is harder because compatibility is not transitive.
- Output from state only
- Attached to the state circle
- Changes only at a clock edge
- Output from state and input
- Attached to the transition arrow
- Reacts in the same cycle; can glitch
- Group states by identical outputs
- Refine groups by successor groups
- Repeat until stable
- Surviving blocks: minimal machine
A Moore machine's output is a function of the state only, so it is attached to the state circle and changes only at a clock edge. A Mealy machine's output is a function of state and current…
Excitation Tables and Designing a Counter
For each flip-flop choose the inputs that produce the wanted transition Q → Q⁺ (the excitation table): D: D = Q⁺. T: T = Q ⊕ Q⁺. JK: 0→0 gives J = 0, K = x; 0→1 gives J = 1, K = x; 1→0 gives J = x, K = 1; 1→1 gives J = x, K = 0 — the many don't-cares are why JK designs often need less logic than D. SR: 0→0: S = 0, R = x; 0→1: S = 1, R = 0; 1→0: S = 0, R = 1; 1→1: S = x, R = 0, with S = R = 1 forbidden. Design a synchronous mod-6 counter (0, 1, 2, 3, 4, 5, 0, …) with T flip-flops. Three bits Q₂Q₁Q₀, unused states 6 and 7 as don't-cares. Bit 0 toggles on every clock: T₀ = 1. Bit 1 changes on 1→2, 3→4 and nowhere else, so it toggles from states 1 and 3 (001, 011) and must not toggle from 5 (101) — with don't-cares, T₁ = Q₂′Q₀. Bit 2 changes on 3→4 and 5→0, so it toggles from 3 (011) and 5 (101): T₂ = Q₀(Q₁ + Q₂), using the don't-care at 7. A program stepped all six states through these equations and confirmed the sequence 0 → 1 → 2 → 3 → 4 → 5 → 0.
| Flip-flop | Excitation for Q → Q⁺ | Typical use |
|---|---|---|
| D | D = Q⁺ | registers, state machines |
| T | T = Q ⊕ Q⁺ | counters |
| JK | 0→1: J=1,K=x; 1→0: J=x,K=1 | most don't-cares, least logic |
For each flip-flop choose the inputs that produce the wanted transition Q → Q⁺ (the excitation table): D: D = Q⁺. T: T = Q ⊕ Q⁺. JK: 0→0 gives J = 0, K = x; 0→1 gives J = 1, K = x; 1→0…
Key takeaways
- Quine–McCluskey: group minterms by number of 1s, merge pairs differing in one bit, unticked terms are prime implicants; take essential primes from the chart, then cover the rest; don't-cares help merging but are not chart columns.
- A static-1 hazard exists when two adjacent 1s are not inside a common product term; the consensus term (e.g. AC for AB′ + BC) removes it. The minimal SOP is the one that can glitch.
- Moore output depends on state only; Mealy on state and input, usually with fewer states (3 against 4 for the overlapping 101 detector); flip-flops = ⌈log₂ states⌉.
- Excitation: D = Q⁺; T = Q ⊕ Q⁺; JK has 0→1: J=1,K=x and 1→0: J=x,K=1. A mod-6 counter with T flip-flops needs T₀ = 1, T₁ = Q₂′Q₀, T₂ = Q₀(Q₁ + Q₂).
- Unused states used as don't-cares must be checked for lock-up; here 6 and 7 both return to the valid cycle on the next clock.
Practice questions (24)
Attempt each one before opening the answer. Every explanation names the tempting wrong option as well as the right one, because that is where marks are lost.
In the Quine–McCluskey method, which terms are prime implicants?
Show answer
Answer: C — terms that could not be merged further (never ticked)
A term that merges with another is covered by the bigger term, so only the terms left unticked after all merging are prime. Some may be a single minterm, but most are merged groups.Two minterms can be combined in one step of the tabular method if they:
Show answer
Answer: C — differ in exactly one bit position
Merging is the algebraic step xy + xy′ = x: terms must differ in a single variable. Terms with the same number of 1s differ in at least two bits and are never compared, which is why grouping by weight helps.How many prime implicants does f(A,B,C,D) = Σm(0, 1, 2, 5, 6, 7, 8, 9, 10, 14) have?
Numerical answer — type the value.
Show answer
Answer: 6
Running the tabular procedure to completion leaves 6 unticked terms: A'C'D (1,5); A'BD (5,7); A'BC (6,7); B'C' (0,1,8,9); B'D' (0,2,8,10); CD' (2,6,10,14). A minimal cover uses 3 of them.
Show the other 21 questions
A static-1 hazard in a two-level AND–OR circuit arises when:
Show answer
Answer: A — two adjacent 1s on the K-map are covered by different product terms and no single term covers both
When the input moves between those two minterms, one product term falls before the other rises, leaving a brief 0. Adding the consensus term covering both removes the hazard. The adjacent-0s version is the static-0 hazard of a POS circuit.The consensus term of AB′ + BC is:
Show answer
Answer: D — AC
The consensus of two terms that contain a variable in opposite forms (here B in BC and B′ in AB′) is the product of their remaining literals, A·C. Adding AC does not change the function (AB′ + BC + AC = AB′ + BC) but covers the adjacent 1s 101 and 111.Which statement distinguishes a Moore machine from a Mealy machine?
Show answer
Answer: B — Moore outputs depend only on the present state
Moore output = f(state); Mealy output = f(state, input). The Mealy form usually needs fewer states (3 against 4 for the overlapping 101 detector) but its output can change between clock edges.A Moore sequence detector for the overlapping pattern 101 needs how many states?
Show answer
Answer: C — 4
States: no progress, seen 1, seen 10, seen 101 (the output state). The Mealy version drops the last because the output can sit on the transition. Four states need two flip-flops, as three do.In a synchronous mod-6 counter (0 to 5) with T flip-flops, with states 6 and 7 as don't-cares, the toggle input T₁ is:
Show answer
Answer: C — Q₂′Q₀
Bit 1 toggles on 1→2 and 3→4 only (from states 001 and 011), and must not toggle from 101. So T₁ = 1 for Q₀ = 1 with Q₂ = 0, i.e. T₁ = Q₂′Q₀. Bit 0 toggles always (T₀ = 1).A static-0 hazard is a condition in which:
Show answer
Answer: D — the output should stay 0 but momentarily glitches to 1
A static-0 hazard is a brief 0 → 1 → 0 spike when the steady output should remain 0. The glitch to 0 on a steady 1 is the static-1 hazard, the tempting reversal.The minimum number of flip-flops required to implement a finite state machine with 9 states is _____.
Numerical answer — type the value.
Show answer
Answer: 4
We need ⌈log₂ 9⌉ = 4 flip-flops, since 3 give only 8 states. Choosing 9 uses one flip-flop per state, which is one-hot, not minimal.An essential prime implicant is one that:
Show answer
Answer: C — covers at least one minterm that no other prime implicant covers
If a minterm is covered by only one prime implicant, that implicant must appear in every cover. Merely being the largest does not make it essential.In the tabular (Quine–McCluskey) method the minterms are first grouped by the number of 1s in their binary form. Minterm 13 of a 4-variable function belongs to the group with _____ ones.
Numerical answer — type the value.
Show answer
Answer: 3
13 = 1101₂ contains three 1s, so it lies in group 3. Adding the index 1 of the digit gives the wrong count of 4.A static-1 hazard in a two-level AND–OR realisation is removed by:
Show answer
Answer: B — adding the redundant (consensus) prime implicant that bridges the adjacent 1-cells
The glitch occurs when two adjacent 1-cells are covered by different terms; a bridging redundant term keeps the output high. Slowing the clock does nothing for a purely combinational glitch.In state-table minimisation, two states are equivalent if for every input sequence they:
Show answer
Answer: B — produce identical output sequences
Equivalence is about indistinguishable output behaviour. Reaching the same final state is sufficient but not necessary, and codes are assigned only after minimisation.In the tabular method, the minterms 0100 and 0110 combine to give the implicant:
Show answer
Answer: D — 01−0
They differ only in the third bit, which is replaced by a dash: 01−0, i.e. A′B D′. The dash in the second position (0−10) would join 0010 and 0110 instead.A 3-variable function is f(A,B,C) = Σm(0, 1, 2, 5, 6, 7). The number of prime implicants is _____.
Numerical answer — type the value.
Show answer
Answer: 6
The six 1-cells form a cycle on the K-map, and every adjacent pair is a prime implicant (A′B′, A′C′, B′C, AC, AB, BC′): 6 in all, none essential. Taking only 3 gives the size of a minimal cover.The minimum number of states in a Mealy machine that detects the overlapping sequence 1101 on a serial input is _____.
Numerical answer — type the value.
Show answer
Answer: 4
A Mealy detector needs one state per proper prefix remembered (empty, 1, 11, 110): 4 states, because the output is raised on the transition that completes 1101. A Moore machine would need 5.The function f = AB + A′C is realised in two-level AND–OR form. With B = C = 1 and A changing from 1 to 0, the circuit can show:
Show answer
Answer: D — a static-1 hazard
Both before and after, f = 1, but AB drops as A′C rises, so a brief gap gives a 1 → 0 → 1 glitch; adding the term BC bridges it. There is no static-0 hazard because f stays 1 at both ends.In the excitation table of a JK flip-flop, the transition Q = 1 → Q⁺ = 0 requires:
Show answer
Answer: C — J = X (don’t care), K = 1
Resetting needs K = 1 with J free (K = 1 with J = 0 resets, with J = 1 toggles to 0). J = 1, K = X is the 0 → 1 transition.Four states of a machine are to be given distinct 2-bit codes (00, 01, 10, 11). The number of different one-to-one state assignments is _____.
Numerical answer — type the value.
Show answer
Answer: 24
Assign 4 codes to 4 states in 4! = 24 ways (only 3 are distinct after relabelling flip-flops and complementing bits). Taking 4² = 16 would allow repeated codes.For f(A,B,C,D) = Σm(0, 2, 3, 4, 5, 7, 8, 10, 11, 13, 15), the number of essential prime implicants is _____.
Numerical answer — type the value.
Show answer
Answer: 2
The six prime implicants are BD, B′D′, CD, B′C, A′C′D′ and A′BC′. Minterm 13 is covered only by BD and minterm 8 only by B′D′, so exactly 2 are essential. Counting all 6 treats every prime implicant as essential.A Mealy machine has states A–E with (next state / output) entries: A: 0→B/0, 1→C/0; B: 0→A/0, 1→D/1; C: 0→A/0, 1→E/1; D: 0→B/0, 1→C/0; E: 0→B/0, 1→C/0. The minimum number of states of an equivalent machine is _____.
Numerical answer — type the value.
Show answer
Answer: 2
A, D and E have identical rows, so they merge. B and C have equal outputs and differ only in going to D versus E, which are now equivalent, so B ≡ C as well: 2 states. Stopping after the first merge gives 3, which misses the implied equivalence.A circuit realises f(A,B,C,D) = AB + A′C + BC′D in two-level AND–OR form. The number of pairs of adjacent input combinations (differing in one variable, both with f = 1) that are NOT covered by a single product term, and so can show a static-1 hazard, is _____.
Numerical answer — type the value.
Show answer
Answer: 3
Checking all single-bit-change pairs of 1-cells: (0101, 0111), (0110, 1110) and (0111, 1111) are not inside any one product, so 3 hazard pairs; they are bridged by A′BD, BCD′ and BC. Counting only the pair that changes A would give 2.Which of the following statements are correct? (More than one may be correct.)
Show answer
Answer: A — A two-level SOP circuit using all prime implicants has no static-1 hazard for single-input changes; C — The output of a Moore machine depends only on the present state; D — State minimisation never increases the number of states
Using all prime implicants gives each adjacent pair of 1-cells a common term, and Moore outputs are functions of the state alone; minimisation only merges states. A two-level SOP has no static-0 hazard for single-input changes, because a product term cannot be 1 in both ends unless it stays 1 throughout, so the second statement is false.