NivaarExam PrepOfficial exam papers ↗

22-Elec-A4 Digital Systems and Computers · May 2015

Question 4 of 6: Analysis of a two-flip-flop sequential circuit

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

Notes on this paper

Paper format. National Exams, May 2015 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book, one approved Casio or Sharp calculator. Six questions are printed and five constitute a complete exam; every question is worth 12 marks, with the per-part split printed in the marking scheme on page 1. A flip-flop excitation table and a Boolean-identity sheet are attached to the paper. All six questions are solved below, so that the set works as a complete study resource.

Reference texts.

Question 4 (12 marks) — Analysis of a two-flip-flop sequential circuit

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.

Given. The circuit printed on page 4 of the paper: a single input $X$ passing through an inverter to make $\overline{X}$; an RS flip-flop $A$ and a T flip-flop $B$ sharing one clock; and the gate network redrawn below, read directly from the printed figure. Both flip-flops make $Q$ and $\overline{Q}$ available, so $A,\overline{A},B,\overline{B}$ are all present as feedback literals.

Find. (a) the four driving expressions; (b) the nine-column state transition table; (c) the state diagram; (d) the machine type, with justification.

[Figure not reproduced: Question 4 — the exam circuit redrawn for legibility, with every gate labelled by the term it produces. The layout is functionally identical to the printed schematic. See the official exam paper.]

Check: reading of the three-input gate. one from $\overline{A}$, one rising from the $\overline{X}$ rail and one dotted onto the $\overline{B}$ rail. Its output column and its centre input leg share the same $x$-coordinate on the drawing, which is why the gate can be misread as two-input. The three-input reading is the only electrically consistent one, because the $\overline{X}$ riser is drawn with a solid junction dot on the $\overline{X}$ rail and terminates nowhere else. Were the gate in fact two-input ($\overline{A}\,\overline{B}$ only), the single affected entry is the row $A=0$, $B=0$, $X=1$, whose $T_B$ would become 1 and whose $B^{+}$ would become 1 instead of 0; every other row and the Moore/Mealy conclusion are unchanged.

  1. (a) Read the expressions off the gates. The AND gate feeding the reset input takes $A$ and $\overline{B}$; the OR gate takes $X$ and $\overline{B}$ and its output is ANDed with $\overline{A}$ to make the set input; the T input is the OR of a two-input AND on $X$ and $A$ with the three-input AND on $\overline{X}$, $\overline{A}$ and $\overline{B}$; and the output OR combines the reset term with an AND of $\overline{X}$ and $B$. Hence $$\boxed{R_A=A\overline{B},\qquad S_A=\overline{A}\,(X+\overline{B}),\qquad T_B=XA+\overline{X}\,\overline{A}\,\overline{B},\qquad Y=A\overline{B}+\overline{X}B.}$$
  2. Check the RS legality constraint before going further. $R_A\cdot S_A=A\overline{B}\cdot\overline{A}(X+\overline{B})=0$ because the product contains $A\overline{A}$. The forbidden RS input can therefore never occur, which confirms the gate reading is self-consistent.
  3. (b) Apply the characteristic equations. For the RS flip-flop, $A^{+}=S_A+\overline{R_A}A$; for the T flip-flop, $B^{+}=T_B\oplus B$. Evaluating both over the eight combinations of $(A,B,X)$ gives the transition table in the column order the question asks for.
Question 4(b) — state transition table, in the column order requested by the paper.
$A$$B$$X$$R_A$$S_A$$T_B$$A^{+}$$B^{+}$$Y$
000011110
001010100
010000011
011010110
100100001
101101011
110000111
111001100
  1. (c) Draw the state diagram. Taking the state as the pair $AB$, the table gives eight directed edges. States 01 and 11 each hold themselves when $X=0$; state 00 splits to 11 or 10 depending on $X$; and state 10 leaves to 00 or 01. Every edge carries the label $X/Y$, because the output is not constant within a state.
X=0 / Y=0X=1 / Y=0X=0 / Y=1X=1 / Y=1X=1 / Y=0X=1 / Y=0X=0 / Y=1X=0 / Y=100011110State = A B ; edge label X / Y (output depends on X, so the machine is Mealy)
Question 4(c) — state transition diagram. Each edge is labelled with the input that causes it and the output produced while it is taken.
  1. (d) Classify the machine. $Y=A\overline{B}+\overline{X}B$ contains the input variable $X$ explicitly, so the output is a function of state and input, not of state alone. The table shows this concretely: in state $AB=01$ the output is $Y=1$ when $X=0$ but $Y=0$ when $X=1$, and in state $AB=11$ the same split occurs. A Moore machine would give one output value per state. This circuit is therefore a Mealy machine. Structurally, the tell-tale is the path from the primary input $X$ to the output $Y$ that does not pass through a flip-flop, which is exactly why a Mealy output can change between clock edges and can glitch when the input does.
Question 4 — final results
ItemResult
$R_A$$A\overline{B}$
$S_A$$\overline{A}(X+\overline{B})$
$T_B$$XA+\overline{X}\,\overline{A}\,\overline{B}$
$Y$$A\overline{B}+\overline{X}B$
Legality$R_A S_A=0$ for every input, so the RS flip-flop is never driven illegally
StatesAll four states $AB\in\{00,01,10,11\}$ are reachable; 01 and 11 have self-loops at $X=0$
Machine typeMealy — $Y$ depends on $X$ as well as on $AB$