22-Elec-A4 Digital Systems and Computers · December 2017
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
National Exams — 16-Elec-A4 Digital Systems & Computers — December 2017. Closed book; 3 hours; six questions of 12 marks each, of which any five constitute a complete paper. All six are solved below as a study resource. Permitted aids: Casio or Sharp approved calculator; a sheet of Boolean identities and a flip-flop excitation table are supplied with the paper.
Reference texts. M. Morris Mano & M. D. Ciletti, Digital Design (Pearson); C. H. Roth & L. L. Kinney, Fundamentals of Logic Design (Cengage); J. F. Wakerly, Digital Design: Principles and Practices (Pearson); Hamacher, Vranesic & Zaky, Computer Organization (McGraw-Hill) for the interrupt / timer material.
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. Minuend $N_1=AB$, subtrahend $N_2=CD$ (each 2-bit unsigned, $A,C$ the MSBs); output $XYZ$ is the difference in 3-bit 2’s complement, value $=-4X+2Y+Z$.
Find. The truth table of $X,Y,Z$, their minimal SoP, and the wiring of the supplied HS + FS into a 2-bit subtractor.
Approach. Compute $(2A+B)-(2C+D)$ for all 16 input combinations, encode each signed value in 3-bit 2’s complement, minimise each output on a K-map, then recognise the ripple-borrow structure that the HS and FS implement.
| A | B | C | D | value | X | Y | Z |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 0 | 1 | −1 | 1 | 1 | 1 |
| 0 | 0 | 1 | 0 | −2 | 1 | 1 | 0 |
| 0 | 0 | 1 | 1 | −3 | 1 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | −1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | −2 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 2 | 0 | 1 | 0 |
| 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 | 1 | 1 | −1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 3 | 0 | 1 | 1 |
| 1 | 1 | 0 | 1 | 2 | 0 | 1 | 0 |
| 1 | 1 | 1 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 00 | 11 | 13 | 12 |
| 01 | 04 | 05 | 17 | 16 |
| 11 | 012 | 013 | 015 | 014 |
| 10 | 08 | 09 | 111 | 010 |
$$X = \overline{A}\,C + \overline{A}\,\overline{B}\,D + \overline{B}\,C\,D.$$
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 00 | 11 | 13 | 02 |
| 01 | 14 | 05 | 07 | 16 |
| 11 | 112 | 013 | 015 | 114 |
| 10 | 08 | 19 | 111 | 010 |
$$Z = B\overline{D} + \overline{B}D = B\oplus D.$$
The middle bit is a three-way exclusive-OR, $Y=A\oplus C\oplus(\overline{B}D)$, whose checkerboard map does not merge; written flat as a minimal SoP it is
| AB \ CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 00 | 11 | 03 | 12 |
| 01 | 04 | 05 | 17 | 16 |
| 11 | 112 | 113 | 015 | 014 |
| 10 | 18 | 09 | 111 | 010 |
$$Y = \overline{A}\,\overline{B}\,\overline{C}\,D + \overline{A}BC + A\overline{B}CD + \overline{A}C\overline{D} + A\overline{C}\,\overline{D} + AB\overline{C}.$$
The 2-bit subtraction ripples a borrow from the LSB stage to the MSB stage. The half subtractor forms the least-significant bit and its borrow; the full subtractor forms the next bit, its borrow-in being the LSB borrow, and its borrow-out is the 2’s-complement sign bit:
| Output | Minimal SoP | Cascade source |
|---|---|---|
| $Z$ (LSB) | $B\oplus D$ | HS difference |
| $Y$ | $A\oplus C\oplus \overline{B}D$ (6-term SoP) | FS difference |
| $X$ (sign) | $\overline{A}C+\overline{A}\,\overline{B}D+\overline{B}CD$ | FS borrow-out |