NivaarExam PrepOfficial exam papers ↗

22-Elec-A4 Digital Systems and Computers · December 2019

Question 4 of 6: HC11 address-decoded I/O routing

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

Notes on this paper

National Exams — December 2019 · 16-Elec-A4 Digital Systems & Computers. Closed book · 3 hours · one of two approved calculators. Six questions; any five constitute a complete paper and all questions are worth 12 marks. All six are solved here as a study resource.

Reference texts: M. M. Mano & M. D. Ciletti, Digital Design (6th ed.); J. F. Wakerly, Digital Design: Principles and Practices (5th ed.); R. J. Tocci, N. S. Widmer & G. L. Moss, Digital Systems: Principles and Applications (12th ed.); Motorola/Freescale M68HC11 Reference Manual; V. C. Hamacher, Z. G. Vranesic & S. G. Zaky, Computer Organization (5th ed.).

Check — figure readings. The two circuit figures are redrawn below from the printed paper. Readings used below: Q1’s second and fifth product terms are $A\overline{B}C$ and $\overline{A}\,\overline{B}C\overline{D}$; Q2(a) asks for 8:1-multiplexer realizations and gives $ABC=011$ and $111$ as don’t-cares for $f_1$; Q3’s gates are three-input ANDs and flip-flop $B$ is wired as a toggle ($R_B=B$, $S_B=\overline{B}$), so the circuit is a binary up/down counter; Q4’s flip-flop clock is taken from decoder output ̅Y2 (third output down), not ̅Y0. Each correction is explained in the relevant answer.

Question 4: HC11 address-decoded I/O routing (12 marks)

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. Decoder address $A_2A_1A_0 = A_{15}A_{14}A_{13}$; the flip-flop is clocked by a decoder output (read from the drawing as $\overline{Y}_2$); on that clock it latches $D_0$; $Q=1$ closes switch 1 (→ HOST), $Q=0$ (so $\overline{Q}=1$) closes switch 2 (→ MCU).

Find. The effect of each of the four store operations.

Check — clock source. The clock tap leaves the decoder’s third output, $\overline{Y}_2$. With $\overline{Y}_2$ the four parts give distinct, sensible answers; with $\overline{Y}_0$ all four would be “No Action”. The answer follows the drawing ($\overline{Y}_2$).

Approach. A store only reprograms the latch if its address activates $\overline{Y}_2$, i.e. $A_{15}A_{14}A_{13}=010$ (any address in the $4000_{16}$–$5\text{FFF}_{16}$ block). When it does, the latched $D_0$ (bit 0 of the stored byte) picks the route; otherwise the routing is unchanged.

  1. Decode each store address. Take the top three address bits: $8000_{16}\Rightarrow100=Y_4$; $4000_{16}\Rightarrow010=Y_2$; $5000_{16}\Rightarrow010=Y_2$; $2500_{16}\Rightarrow001=Y_1$. Only (b) and (c) hit $\overline{Y}_2$ and clock the flip-flop.
  2. Read $D_0$ where the clock fires. $D_0=\text{bit }0$ of the accumulator value: $29_{16}=0010\,1001\Rightarrow D_0=1$; $B4_{16}=1011\,0100\Rightarrow D_0=0$.
  3. Apply the routing rule. $$\boxed{\text{(a) No Action}\quad\text{(b) HOST}\quad\text{(c) MCU}\quad\text{(d) No Action}}$$ (b): $Q\!\leftarrow\!1\Rightarrow$ switch 1 closes → HOST. (c): $Q\!\leftarrow\!0\Rightarrow$ switch 2 closes → MCU. (a),(d): decoder selects $Y_4/Y_1$, $\overline{Y}_2$ never pulses, so the previously latched route is untouched.
Only a store whose A15A14A13 = 010 pulses Y2 -> clocks the D-FFInstructionA15A14A13LineD0FF / switchRoute(a) staa 8000h100Y4-no clockNo Action(b) staa 4000h010Y21Q=1 -> SW1HOST(c) staa 5000h010Y20Q=0 -> SW2MCU(d) staa 2500h001Y1-no clockNo Action
Figure 4.1 — per-instruction decode. The stored byte’s $D_0$ only reaches the latch when $A_{15}A_{14}A_{13}=010$.
Question 4 results
Instruction$A_{15}A_{14}A_{13}$Line$D_0$Result
(a) staa $8000_{16}$100$Y_4$—No Action
(b) staa $4000_{16}$010$Y_2$1HOST port
(c) staa $5000_{16}$010$Y_2$0MCU port
(d) staa $2500_{16}$001$Y_1$—No Action