22-Elec-A4 Digital Systems and Computers · May 2016
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
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 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.
| Item | Value |
|---|---|
| State variables | A (flip-flop A), B (flip-flop B) |
| External input | X (one bit) |
| Flip-flop type | JK, negative-edge triggered (bubbled clock inputs) |
| Gates present | one 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.
| X | A | B | JA = X ⊕ B | KA = B | JB = AX′ | KB = X′ + A′ |
|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 0 | 1 | 0 | 0 |
| X | Present A B | JA KA | JB KB | Next A+ B+ | Action |
|---|---|---|---|---|---|
| 0 | 0 0 | 0 0 | 0 1 | 0 0 | A holds, B resets |
| 0 | 0 1 | 1 1 | 0 1 | 1 0 | A toggles, B resets |
| 0 | 1 0 | 0 0 | 1 1 | 1 1 | A holds, B toggles |
| 0 | 1 1 | 1 1 | 1 1 | 0 0 | A toggles, B toggles |
| 1 | 0 0 | 1 0 | 0 1 | 1 0 | A sets, B resets |
| 1 | 0 1 | 0 1 | 0 1 | 0 0 | A resets, B resets |
| 1 | 1 0 | 1 0 | 0 0 | 1 0 | A sets, B holds |
| 1 | 1 1 | 0 1 | 0 0 | 0 1 | A resets, B holds |
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.
| Quantity | Result |
|---|---|
| (a) JA | X ⊕ B |
| (a) KA | B |
| (a) JB | A·X′ |
| (a) KB | X′ + A′ = (XA)′ |
| (b) next state, X = 0 | 00→00, 01→10, 10→11, 11→00 |
| (b) next state, X = 1 | 00→10, 01→00, 10→10, 11→01 |
| (c) self-loops | state 00 for X = 0; state 10 for X = 1 |
| Machine type / triggering | Moore, negative-edge triggered; all four states reachable |