NivaarExam PrepOfficial exam papers ↗

04-BS-8 · December 2016

Question 4 of 5: Finite State Machine Design with D Flip-Flops

Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)

Notes on this paper

National Exams — December 2016 — 04-BS-8 Digital Logic Circuits. Three-hour, closed-book exam (Casio or Sharp approved calculator only; one hand-written 8.5"×11" aid sheet permitted). Format: five questions offered, each worth 25 marks (100 total); any four constitute a complete paper and only the first four appearing in the answer book are marked. All five are solved below for completeness.

Reference texts: Mano & Ciletti, Digital Design (6th ed., Pearson) — Boolean minimization, PAL/PLA architectures, flip-flop conversion, sequential design, arithmetic circuits, serial 2's-complement conversion; Floyd, Digital Fundamentals (11th ed., Pearson) — decoders, number systems, flip-flop characteristic tables, counters and shift registers.

Question 4: Finite State Machine Design with D Flip-Flops (25 marks)

Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.

Part (a) — state diagram and machine type. Each row of the state table lists exactly ONE output value (Z=1 for S1, S2, S4; Z=0 for S3), with output depending only on which state the machine is currently in — NOT on the current input (a,b). This is precisely the defining property of a Moore machine (output is a function of state alone, $Z=f(\text{state})$), as opposed to a Mealy machine, whose output would instead depend on both the present state AND the current input, and would therefore need to be tabulated once per (state, input) pair rather than once per state.

S1Z=1S2Z=1S3Z=0S4Z=100,100111000110110001101100011011
Fig. 4 — Moore state diagram: each state's output Z is written inside its bubble (state-only, not edge-labelled); edges are labelled with the input combination ab that causes the transition.

Part (b) — Given. The 4-state Moore machine above; D-type flip-flops available.

Find. A complete D-flip-flop-based realization: state assignment, next-state (excitation) equations, and output equation.

Approach. Assign a 2-bit binary code to each of the 4 states (2 flip-flops needed, since $2^2=4$), tabulate the required next-state code for every (state, a, b) combination, then minimize $D_1$, $D_0$ (the two flip-flops' D inputs, which for a D flip-flop simply equal the required next state) and $Z$ by K-map.

  1. State assignment. $S1{=}00,\ S2{=}01,\ S3{=}10,\ S4{=}11$ (encoded as $Q_1Q_0$).
  2. Next-state table. Re-expressing every row of the state table in binary and reading off $Q_1^+Q_0^+ = D_1D_0$ directly (a D flip-flop's next state always equals its D input, so $D_1=Q_1^+$, $D_0=Q_0^+$):
    $Q_1Q_0$ab=00011011
    00 (S1)01000110
    01 (S2)11100100
    10 (S3)01100011
    11 (S4)01101100
  3. Minimize $D_1$ by K-map over $(Q_1,Q_0,a,b)$: minterms $\{3,4,5,9,11,13,14\}$ group as: $\{4,5\}\to Q_1'Q_0a'$; $\{3,11\}\to Q_0'ab$; $\{9,13\}\to Q_1a'b$; $\{14\}$ paired with $\{...\}$ wait — $\{14\}$ groups with the wxyz-style pair to give $Q_1Q_0ab'$. $$\boxed{D_1 = Q_1Q_0ab' + Q_0'ab + Q_1'Q_0a' + Q_1a'b}$$
  4. Minimize $D_0$ by K-map over the same variables: minterms $\{0,2,4,6,8,11,12,14\}$ group as $Q_1'b'\ (\{0,2,4,6\})$, $Q_0b'\ (\{4,6,12,14\})$, $a'b'\ (\{0,4,8,12\})$, and the lone remaining minterm 11 as $Q_1Q_0'ab$: $$\boxed{D_0 = Q_1'b' + Q_0b' + a'b' + Q_1Q_0'ab}$$
  5. Output equation. $Z=1$ exactly for $S1,S2,S4$ (i.e. whenever $Q_1Q_0 \ne 10$): $$\boxed{Z = Q_1' + Q_0}$$
  6. Circuit. Two D flip-flops (clocked together) hold $Q_1,Q_0$; the combinational networks above drive $D_1$ and $D_0$ from $(Q_1,Q_0,a,b)$; $Z$ is combinational, taken directly from $Q_1,Q_0$ (Moore output, available immediately after each clock edge and stable for the whole following period — it does not glitch with $a,b$).
QuantityResult
Machine typeMoore (output depends on state only)
State assignmentS1=00, S2=01, S3=10, S4=11
$D_1$$Q_1Q_0ab' + Q_0'ab + Q_1'Q_0a' + Q_1a'b$
$D_0$$Q_1'b' + Q_0b' + a'b' + Q_1Q_0'ab$
$Z$$Q_1' + Q_0$