22-Elec-A4 Digital Systems and Computers · May 2018
Question 2 of 6: Start/stop 3-bit synchronous counter
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
National Exams — May 2018 · 16-Elec-A4 Digital Systems & Computers.
Closed book, 3 hours. Six questions, 12 marks each; the rubric requires any five, but all six are solved here as a study resource. Approved Casio/Sharp calculator permitted. A Boolean-identity table and the flip-flop excitation table are supplied with the paper (reproduced where used).
Reference texts. M. M. Mano & M. D. Ciletti, Digital Design (6th ed.) — number systems, Boolean minimization, sequential logic; J. F. Wakerly, Digital Design: Principles and Practices (5th ed.) — counters, registers, PLDs; C. Hamacher, Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded Systems (6th ed.) — parallel I/O, handshaking, memory-mapped ports; Motorola M68HC11 Reference Manual — port addressing and instruction set.
Given. A full 3-bit binary up-count $000\!\to\!111$ then wrap, built from positive-edge-triggered JK flip-flops with $Q_C$ the MSB and $Q_A$ the LSB. Part (b) adds a synchronous COUNT ENABLE (CTE) that pauses and later resumes the count with the state preserved.
Find. (a) the JK input equations and the counter schematic; (b) the modification that makes CTE gate the count without losing the current value.
Approach. Use the JK toggle mode ($J=K=1\Rightarrow$ toggle). A binary up-counter toggles stage $n$ exactly when all lower stages are 1, so drive each stage's tied $J,K$ with the AND of the lower bits. For CTE, AND that toggle condition with CTE so a LOW enable forces $J=K=0$ (hold) — the clock is never gated.
Derive the toggle conditions. In a binary up-count, bit $Q_A$ flips every clock; $Q_B$ flips when $Q_A=1$; $Q_C$ flips when $Q_A\!\cdot\!Q_B=1$. With JK flip-flops tied $J=K$ (toggle when 1, hold when 0):
$$J_A=K_A=1,\qquad J_B=K_B=Q_A,\qquad J_C=K_C=Q_A\cdot Q_B.$$
Verify against the excitation requirement. At state $011$ the next state is $100$: $Q_A$ must toggle ($1\!\to\!0$, need $J_A K_A$ toggle ✓), $Q_B$ toggles ($1\!\to\!0$, condition $Q_A=1$ ✓), $Q_C$ toggles ($0\!\to\!1$, condition $Q_A Q_B=1$ ✓). All eight transitions check, and $111\!\to\!000$ follows because every toggle condition is satisfied at $111$.
(a) 3-bit synchronous up-counter. All flip-flops share the clock (synchronous); each stage's $J$ and $K$ are tied together and driven by the AND of the lower bits.
Add the COUNT ENABLE. AND every toggle input with CTE so the effective conditions become
$$J_A=K_A=\text{CTE},\quad J_B=K_B=\text{CTE}\cdot Q_A,\quad J_C=K_C=\text{CTE}\cdot Q_A\cdot Q_B.$$
When $\text{CTE}=1$ the equations reduce to the part-(a) counter; when $\text{CTE}=0$ every $J=K=0$, so on each clock edge all flip-flops hold and the stored count is frozen.
Confirm clean resume. Because the clock is left running and only the data inputs are gated, the flip-flops keep their last value while paused. When CTE returns HIGH the toggle conditions are re-enabled and counting continues from the held state — no glitch, no lost or skipped count, unlike a scheme that gates the clock (which risks runt pulses).
(b) Same counter with CTE. Each stage's toggle input is ANDed with CTE (the enable ripples through the carry AND-chain). Clock is untouched, so the count holds when CTE=0 and resumes from where it stopped.