NivaarExam PrepOfficial exam papers ↗

22-Elec-A4 Digital Systems and Computers · December 2016

Question 2 of 6: Two RS flip-flops: logic equations, state table and state diagram

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

Notes on this paper

Paper format. National Exams, December 2016 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book, one approved Casio or Sharp calculator. Six questions are printed and any five constitute a complete exam; every question is worth 12 points with the per-part breakdown printed on page 1. A flip-flop excitation table and a sheet of Boolean identities are attached as page 6. All six questions are solved below so the set works as a complete study resource.

Reference texts.

Question 2 (12 marks) — Two RS flip-flops: logic equations, state table and state diagram

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.

Check. The excitation network was redrawn from the printed figure. The two output OR gates feed $R_A$ and $S_A$; the four AND gates combine $X$, $\overline{X}$ and the flip-flop outputs, and the lower flip-flop's own $Q,\overline{Q}$ return to its $R_B,S_B$ inputs. The wiring that could be read unambiguously fixes $R_B=B,\,S_B=\overline{B}$ and the $X\!\oplus\!B$ toggle condition on $A$; a mirror reading (swap the roles of $X$ and $\overline{X}$) would merely exchange ‘up’ and ‘down’ in the count sequence. The solution commits to $X=0\Rightarrow$ up.

Given. Two clocked RS flip-flops $A$ (MSB) and $B$ (LSB); an inverter produces $\overline{X}$; four AND gates and two OR gates form the excitation logic. Find. the four drive equations, the full next-state table, and the state diagram.

Approach. Trace each flip-flop's $R,S$ from the gates, use the RS rule $Q^+ = S + \overline{R}\,Q$ (with $RS=0$) to fill an eight-row table over $(A,B,X)$, then read the two cyclic sequences.

[Figure not reproduced: Excitation network redrawn as a $T$-type realisation: $T_A = X\oplus B$ gates $R_A=A\,T_A$ and $S_A=\overline{A}\,T_A$; the lower flip-flop is wired as an unconditional toggle. See the official exam paper.]

  1. Drive equations (part a). The lower flip-flop feeds its own outputs back: $\boxed{R_B=B,\quad S_B=\overline{B}}$, so it toggles every clock ($T_B=1$). The upper flip-flop is set/reset only when the toggle condition $T_A=X\oplus B=\overline{X}B+X\overline{B}$ is true, gated by the present $A$: $$\boxed{R_A=A\,(X\oplus B)=A\overline{X}B+AX\overline{B},\qquad S_A=\overline{A}\,(X\oplus B)=\overline{A}\,\overline{X}B+\overline{A}X\overline{B}}$$ By construction $R_A S_A = A\overline{A}(X\oplus B)=0$ and $R_B S_B = B\overline{B}=0$, so neither flip-flop is ever driven invalid.
  2. Next-state rule. For RS, $Q^+=S+\overline{R}Q$. With the equations above this is the toggle law $A^+=A\oplus T_A=A\oplus(X\oplus B)$ and $B^+=\overline{B}$.
  3. Fill the table (part b). Evaluate all eight $(A,B,X)$ rows.
ABX$R_A S_A$$R_B S_B$$A^+ B^+$
0000 00 10 1
0010 10 11 1
0100 11 01 0
0110 01 00 0
1000 00 11 1
1011 00 10 1
1101 01 00 0
1110 01 01 0

Reading the sequences (part c). With $X=0$ the state $AB$ advances $00\to01\to10\to11\to00$ (binary up-count); with $X=1$ it runs $00\to11\to10\to01\to00$ (down-count). The machine is a 2-bit synchronous up/down counter with $X$ as the direction control; all four states are used, so it is trivially self-correcting.

00011011X=0X=0X=0X=0X=1X=1X=1X=1State AB: X=0 counts up, X=1 counts down
State diagram. Solid direction $X=0$ counts up, $X=1$ counts down; each edge is one clock.
ItemResult
(a) $R_A,S_A$$A(X\oplus B)$, $\overline{A}(X\oplus B)$
(a) $R_B,S_B$$B$, $\overline{B}$ (toggle)
(b) Next state$A^+=A\oplus X\oplus B$, $B^+=\overline{B}$
(c) Behaviour2-bit up/down counter ($X=0$ up, $X=1$ down)