NivaarExam PrepOfficial exam papers ↗

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

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

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

Notes on this paper

Paper format. National Exams, May 2016 — 07-Elec-A4 Digital Systems & Computers. Three hours, closed book, one approved Casio or Sharp calculator. Six questions, each worth 12 points; five questions constitute a complete exam. A flip-flop excitation table and a list of Boolean identities are printed on the last page. Every one of the six questions is solved below, because the set is intended as a study resource rather than an exam script.

Reference texts. M. Morris Mano & M. D. Ciletti, Digital Design (6th ed.), ch. 3 (map simplification, prime implicants, hazards), ch. 5–6 (sequential logic, counters); J. F. Wakerly, Digital Design: Principles and Practices (5th ed.), §3.7 (three-state outputs), §4.4 (timing hazards and consensus terms), ch. 8 (counters); C. Hamacher, Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded Systems (6th ed.), ch. 1–2 (processor structure, registers), ch. 3 (memory-mapped I/O).

Check: segment-to-pin assignment in Question 6. Figure 6.1 shows the buffer chip driving the eight segment lines a…h from Port B pins PB7–PB0, but does not print which pin drives which segment. Throughout Question 6 the conventional weighting a = PB0, b = PB1, …, g = PB6, h = PB7 (decimal point) is assumed and stated explicitly, exactly as the paper's own rubric invites ("the candidate is urged to submit…a clear statement of any assumptions made"). Every bit pattern below is derived from that one assumption; a different pin order permutes the bits but changes no part of the method.

Question 2: Analysis of a two JK flip-flop sequential circuit (12 points)

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. A synchronous circuit built from two JK flip-flops A and B sharing one clock CK, with a single external input X. Both clock inputs carry an inversion bubble, so the machine is negative-edge triggered. Reading the schematic on page 2 of the paper: X and the B output feed an exclusive-OR gate whose output drives JA; the B rail also runs directly to KA; X passes through an inverter to form X′, which meets the A rail at an AND gate driving JB, and meets the A′ rail at an OR gate driving KB.

Given data
ItemValue
State variablesA (flip-flop A), B (flip-flop B)
External inputX (one bit)
Flip-flop typeJK, negative-edge triggered (bubbled clock inputs)
Gates presentone XOR, one AND, one OR, one inverter
Characteristic equation$Q^{+} = JQ' + K'Q$

Find. The four excitation expressions in terms of X, A and B; the eight-row state transition table giving A+B+ for every combination of present state and input; and the corresponding state transition diagram.

[Figure not reproduced: Fig Q2.1 — The circuit of page 2 redrawn from the printed figure. Signal names A, A′, B, B′ are the flip-flop outputs fed back to the gate inputs; crossings without a solid junction dot are not connections. Both clock inputs are bubbled, so the machine responds to the falling edge of CK. See the official exam paper.]

Approach. Read the four excitation expressions straight off the gates, substitute them into the JK characteristic equation $Q^{+} = JQ' + K'Q$ for each flip-flop, and evaluate over all eight combinations of (X, A, B). The resulting next-state column is the transition table, and drawing one arc per row gives the diagram.

  1. Part (a): read the excitation expressions off the schematic. Tracing each gate back to its sources: $$J_A = X \oplus B \qquad K_A = B$$ $$J_B = A\,X' \qquad K_B = X' + A'$$ Two of these deserve a comment. KA is taken directly from the B output with no gate at all, which is why the drawing appears to have fewer gates than the four expressions suggest. And KB is an OR of two complemented signals, so by De Morgan it can equally be written $K_B = (XA)'$ — it is 0 only when X and A are both 1. $$\boxed{J_A = X \oplus B,\quad K_A = B,\quad J_B = A X',\quad K_B = X' + A'}$$
  2. Recall the JK characteristic equation. The excitation table printed on the last page of the paper (Q, Q+, J, K rows) is the inverse mapping; for analysis the forward form is more convenient: $$Q^{+} = J\,Q' + K'\,Q$$ which reproduces the four familiar behaviours — hold for JK = 00, reset for 01, set for 10, and toggle for 11.
  3. Part (b): evaluate the excitation inputs for all eight rows. With X, A, B running through their eight combinations, and remembering that X′ is 1 exactly when X is 0:
    Excitation inputs
    XABJA = X ⊕ BKA = BJB = AX′KB = X′ + A′
    0000001
    0011101
    0100011
    0111111
    1001001
    1010101
    1101000
    1110100
    Note that KB is 0 only in the last two rows, where X = A = 1, and that JB is 1 only when A = 1 with X = 0 — so JB and KB are never both 1 and flip-flop B never toggles.
  4. Apply the characteristic equation to obtain the next state. Substituting each row into $A^{+} = J_A A' + K_A' A$ and $B^{+} = J_B B' + K_B' B$ gives the state transition table asked for:
    State transition table
    XPresent A BJA KAJB KBNext A+ B+Action
    00 00 00 10 0A holds, B resets
    00 11 10 11 0A toggles, B resets
    01 00 01 11 1A holds, B toggles
    01 11 11 10 0A toggles, B toggles
    10 01 00 11 0A sets, B resets
    10 10 10 10 0A resets, B resets
    11 01 00 01 0A sets, B holds
    11 10 10 00 1A resets, B holds
    $$\boxed{\text{See the eight next-state entries above; every one of the four states is reachable.}}$$ Two rows are worth checking by hand as a guard against transcription slips. In row 3 (X = 0, AB = 10) the inputs are JAKA = 00 so A holds at 1, and JBKB = 11 so B toggles from 0 to 1, giving 11. In row 8 (X = 1, AB = 11) the inputs are 01 and 00, so A is reset to 0 while B holds at 1, giving 01.
  5. Part (c): draw the state transition diagram. Each of the eight table rows becomes one directed arc labelled with the value of X that causes it. Since the outputs are simply the state variables A and B, this is a Moore machine and no output label is needed on the arcs. $$\boxed{\begin{aligned} X=0:&\quad 00 \to 00,\; 01 \to 10,\; 10 \to 11,\; 11 \to 00\\ X=1:&\quad 00 \to 10,\; 01 \to 00,\; 10 \to 10,\; 11 \to 01 \end{aligned}}$$
00101101X=0X=1X=0X=1X=0X=1X=0X=1
Fig Q2.2 — State transition diagram; each circle is labelled with the state AB and each arc with the input value that drives it. State 00 holds itself when X = 0 and state 10 holds itself when X = 1.

The behaviour is easy to describe in words once the diagram is drawn. Holding X at 0 sends the machine round the four-state cycle 00 → 00 from rest, but starting anywhere else it walks 01 → 10 → 11 → 00 and then parks in 00; holding X at 1 drives it toward 10 and holds it there. There are no unreachable or locked-out states, and no state has an undefined successor, so the machine is well formed for both input values.

Question 2 — final results
QuantityResult
(a) JAX ⊕ B
(a) KAB
(a) JBA·X′
(a) KBX′ + A′ = (XA)′
(b) next state, X = 000→00, 01→10, 10→11, 11→00
(b) next state, X = 100→10, 01→00, 10→10, 11→01
(c) self-loopsstate 00 for X = 0; state 10 for X = 1
Machine type / triggeringMoore, negative-edge triggered; all four states reachable