23-Mechatronics-A3 Digital Logic and Embedded Systems · December 2018
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Paper: National Exams, December 2018 — 16-Mex-A3 Digital Systems & Computers. Closed-book, 3-hour paper (approved Casio/Sharp calculator only). Candidates normally answer 5 of 6 questions; full worked solutions to all six are given below, whichever five a candidate chose.
Reference texts: M. M. Mano & M. D. Ciletti, Digital Design (6th ed.) — Boolean algebra and gate-level design (Ch. 2), combinational logic (Ch. 4), synchronous sequential logic, state tables and counters (Ch. 5), programmable logic (PAL/PLA, Ch. 7); C. Hamacher, Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded Systems (6th ed.) — CPU/memory/bus architecture, registers, addressing; Motorola/Freescale, M68HC11 Reference Manual — big-endian byte storage, stack push/pull, port-based I/O (the questions below use Motorola-style conventions throughout, as stated on the paper).
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. Target cycle (written $Q_AQ_BQ_C$): $000\to010\to100\to101\to011\to001\to000\ (\text{repeat})$ — 6 of the 8 possible states are used; $110$ and $111$ never occur by design and are don't-cares. Flip-flop excitation table (from the reference sheet): $Q\to Q^+{=}0$: $J{=}0,K{=}X$; $Q\to Q^+{=}1$: $J{=}1,K{=}X$; $Q{=}1\to Q^+{=}0$: $J{=}X,K{=}1$; $Q{=}1\to Q^+{=}1$: $J{=}X,K{=}0$.
Find. The state diagram, the full JK excitation table, minimised $J,K$ equations, the wired circuit, self-starting behaviour, and an 8-pulse timing diagram.
Approach. Standard synchronous design: draw the state diagram → tabulate present/next state → back out each flip-flop's required $J,K$ from the excitation table → K-map (with the two unused states as don't-cares) to minimise $J,K$ → wire the flip-flops and combinational logic → verify self-starting by evaluating the don't-care states with the chosen equations → simulate the timing.
| $Q_AQ_BQ_C$ | $Q_A^+Q_B^+Q_C^+$ | $J_AK_A$ | $J_BK_B$ | $J_CK_C$ |
|---|---|---|---|---|
| 000 | 010 | 0,X | 1,X | 0,X |
| 010 | 100 | 1,X | X,1 | 0,X |
| 100 | 101 | X,0 | 0,X | 1,X |
| 101 | 011 | X,1 | 1,X | X,0 |
| 011 | 001 | 0,X | X,1 | X,0 |
| 001 | 000 | 0,X | 0,X | X,1 |
| 110, 111 | unused — all six J/K entries are don't-care (X) | |||
(b) Self-starting check. Evaluating the same $J,K$ equations at the two unused states (this is the only way to know where the don't-cares actually send the counter, since a K-map leaves that undefined until equations are chosen):
| Unused state | Next state (from the equations above) | In the 6-state cycle? |
|---|---|---|
| 110 | 101 | Yes |
| 111 | 001 | Yes |
Both unused states feed directly back into the valid cycle after a single clock pulse. $\boxed{\text{The counter is self-starting}}$ — no separate lock-up loop exists among $\{110,111\}$, so power-on noise or a glitch that lands the counter in an unused state recovers automatically within one clock cycle.
(c) Timing diagram. With $\overline{CLR}$ released just before $t=0$, all flip-flops are cleared, so the state at $t=0$ is $000$. Each rising CLK edge thereafter advances one step along the cycle:
| Quantity | Result |
|---|---|
| $J_A,K_A$ | $\boxed{J_A=B\bar C,\ K_A=C}$ |
| $J_B,K_B$ | $\boxed{J_B=A\odot C,\ K_B=1}$ |
| $J_C,K_C$ | $\boxed{J_C=A,\ K_C=\bar A\bar B}$ |
| Self-starting? | $\boxed{\text{Yes}}$ — $110\to101$, $111\to001$ |
| State sequence over 8 pulses | $\boxed{010,100,101,011,001,000,010,100}$ |