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) · Last updated
Notes on this paper
A flip-flop excitation table and a sheet of Boolean identities are attached as page 6.
Reference texts.
M. M. Mano and M. D. Ciletti, Digital Design, 6th ed. — Ch. 2-3 (Boolean algebra, K-maps, hazards, NAND/NOR-only synthesis), Ch. 5-6 (synchronous sequential logic, state tables, counters), Ch. 7 (memory and programmable logic: PAL/PLA).
J. F. Wakerly, Digital Design: Principles and Practices, 5th ed. — Ch. 4 (hazards and combinational practices), Ch. 7-8 (latches, flip-flops, excitation tables and counter design).
C. Hamacher, Z. Vranesic, S. Zaky and N. Manjikian, Computer Organization and Embedded Systems, 6th ed. — Ch. 3 and Ch. 8 (address decoding, chip-select generation, memory-mapped I/O).
Question 2 (12 marks) — Two RS flip-flops: logic equations, state table and state diagram
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.]
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.
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}$.
Fill the table (part b). Evaluate all eight $(A,B,X)$ rows.
A
B
X
$R_A S_A$
$R_B S_B$
$A^+ B^+$
0
0
0
0 0
0 1
0 1
0
0
1
0 1
0 1
1 1
0
1
0
0 1
1 0
1 0
0
1
1
0 0
1 0
0 0
1
0
0
0 0
0 1
1 1
1
0
1
1 0
0 1
0 1
1
1
0
1 0
1 0
0 0
1
1
1
0 0
1 0
1 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.
State diagram. Solid direction $X=0$ counts up, $X=1$ counts down; each edge is one clock.