04-BS-8 · December 2016
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
National Exams — December 2016 — 04-BS-8 Digital Logic Circuits. Three-hour, closed-book exam (Casio or Sharp approved calculator only; one hand-written 8.5"×11" aid sheet permitted). Format: five questions offered, each worth 25 marks (100 total); any four constitute a complete paper and only the first four appearing in the answer book are marked. All five are solved below for completeness.
Reference texts: Mano & Ciletti, Digital Design (6th ed., Pearson) — Boolean minimization, PAL/PLA architectures, flip-flop conversion, sequential design, arithmetic circuits, serial 2's-complement conversion; Floyd, Digital Fundamentals (11th ed., Pearson) — decoders, number systems, flip-flop characteristic tables, counters and shift registers.
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.
Part (a) — ripple-carry vs. carry-look-ahead. A ripple-carry adder chains $n$ full adders so that the carry-out of stage $i$ feeds directly into the carry-in of stage $i{+}1$; every stage must wait for the true, settled carry from the previous stage before its own sum and carry are valid, so the carry "ripples" through the chain one full-adder delay at a time. A carry-look-ahead adder instead computes each stage's carry-out directly from the original input bits (using per-bit generate $g_i = A_iB_i$ and propagate $p_i = A_i \oplus B_i$ signals combined in a two-level AND-OR carry network), so every carry is available after only a small, fixed number of gate delays regardless of $n$. The ripple-carry adder is slower because its worst-case delay grows linearly with the number of bits, $t_{ripple} \approx n \cdot t_{FA}$ (e.g. a carry generated in bit 0 must physically propagate through every one of the $n{-}1$ remaining full adders before the final sum is valid), whereas the carry-look-ahead adder's delay stays roughly constant (a small, bounded number of AND/OR levels) because every carry is derived independently and directly from the inputs rather than waiting on its neighbour.
Part (a) — BCD of (17,000)10. In 8421 BCD each decimal digit is encoded independently in its own 4-bit nibble; grouping 17000 digit-by-digit (1, 7, 0, 0, 0):
| Decimal digit | 1 | 7 | 0 | 0 | 0 |
|---|---|---|---|---|---|
| BCD nibble | 0001 | 0111 | 0000 | 0000 | 0000 |
This is justified because BCD is a weighted, per-digit code (not a pure binary conversion): each of the five decimal digits 1,7,0,0,0 is replaced by its own 4-bit binary value (0–9 only, never using codes 1010–1111), giving a 20-bit result. (For contrast, plain unsigned binary would need only $\lceil\log_2 17001\rceil = 15$ bits, but would not preserve individual decimal-digit boundaries the way BCD does — BCD trades density for direct decimal-digit addressability, which is why it is used in seven-segment displays and decimal arithmetic hardware.)
Part (b) — Given. A 4-bit ripple-carry adder built from AND, OR and XOR gates only (any number of inputs allowed).
Find. The total gate count.
Approach. Count the gates in one full adder using the standard two-level XOR/AND-OR realization, then multiply by 4 (one full adder per bit, chained by carry).
| Gate type | Count |
|---|---|
| XOR | 8 (2 per full adder × 4) |
| AND | 8 (2 per full adder × 4) |
| OR | 4 (1 per full adder × 4) |
| Total | 20 gates |
Part (c) — Given. $F(w,x,y,z) = \Sigma m(0,2,3,5,6,13)$.
Find. A minimum-NAND-gate realization, via K-map simplification.
| wx / yz | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 1 | 0 | 1 | 1 |
| 01 | 0 | 1 | 0 | 0 |
| 11 | 0 | 1 | 0 | 0 |
| 10 | 0 | 0 | 0 | 0 |
| Quantity | Result |
|---|---|
| Ripple vs. CLA | Ripple delay grows linearly with bit-width; CLA delay is roughly constant |
| BCD of 17,000 | 0001 0111 0000 0000 0000 |
| 4-bit ripple adder gate count | 20 gates (8 XOR + 8 AND + 4 OR) |
| F minimal SOP | $w'x'z' + w'x'y + w'yz' + xy'z$ — 5 NAND gates |