22-Elec-A4 Digital Systems and Computers · December 2018
Question 6 of 6: Two-digit seven-segment display driver
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
22-Elec-A4 Digital Systems & Computers — 2018-Dec (Worked Solutions)
National Exams — December 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 and are used where needed.
Reference texts. M. M. Mano & M. D. Ciletti, Digital Design (6th ed.) — Boolean minimization, NAND/NOR realizations, K-maps, synchronous counters; J. F. Wakerly, Digital Design: Principles and Practices (5th ed.) — counters, PAL/PLA devices; C. Hamacher, Z. Vranesic, S. Zaky & N. Manjikian, Computer Organization and Embedded Systems (6th ed.) — CPU registers, endianness, stacks, parallel I/O; Motorola M68HC11 Reference Manual — big-endian storage, PUSH semantics, Port B addressing.
Given. Common-anode displays multiplexed by $PB_7$; segment bit order $PB_6\!=\!g,\ PB_5\!=\!f,\ PB_4\!=\!e,\ PB_3\!=\!d,\ PB_2\!=\!c,\ PB_1\!=\!b,\ PB_0\!=\!a$; open-collector inverters; $V_{source}=5$ V, $V_{CE(sat)}=0.3$ V, $V_{LED}=2$ V, $I_{LED}=10$ mA.
Find. The two Port-B patterns for "40", the display refresh sequence, and the series resistor $R_2$.
Approach. Determine the drive polarity (a segment lights when its cathode is pulled low, i.e. when the corresponding $PB$ bit is 1 because the inverter is open-collector), build the "4" and "0" segment patterns, then size $R_2$ from a single-segment KVL around the on-path.
Drive polarity. For a common-anode display the anode sits near $+5$ V (through the selected transistor) and a segment lights when its cathode is pulled LOW. The cathode is driven by an open-collector inverter whose output is LOW when its input is HIGH, so a segment is ON when its $PB$ bit $=1$. Likewise $PB_7=1$ turns on transistor $T_1$ (the 10’s digit); $PB_7=0$ selects the 1’s digit.
(a) Segment patterns for 40. Digit "4" lights f, g, b, c; digit "0" lights a, b, c, d, e, f (g off).
(b) Programming sequence (multiplexing). The two digits share the segment lines, so they are shown one at a time, fast enough that persistence of vision fuses them. Repeat continuously: (1) write $\mathtt{E6}_{16}$ to Port B ($PB_7=1$) to light "4" on the 10’s digit; (2) hold a short delay ($\sim$1–5 ms); (3) write $\mathtt{3F}_{16}$ to Port B ($PB_7=0$) to light "0" on the 1’s digit; (4) hold the same short delay; (5) loop. A refresh rate above about 50–60 Hz per digit makes both digits appear steady and simultaneously lit.
(c) Sizing $R_2$. Follow one lit segment from the supply: through the selected transistor ($V_{CE(sat)}=0.3$ V), across the LED (2 V), through $R_2$, into the saturated open-collector inverter ($\approx0$ V). KVL gives $$R_2=\frac{V_{source}-V_{CE(sat)}-V_{LED}}{I_{LED}}=\frac{5-0.3-2}{10\text{ mA}}=\boxed{270\ \Omega}.$$
Part (c): on-path for one segment; the 2.7 V across $R_2$ at 10 mA sets $R_2=270\ \Omega$.
Check: $R_2$ neglects the open-collector inverter’s own output-low voltage ($\approx0$ V assumed); a typical $V_{OL}\approx0.2$–0.4 V would raise $R_2$ to the next standard value (e.g. 240 Ω is the nearest E-series part ≤270 Ω if that drop is counted). The 270 Ω figure uses only the data the question supplies.