04-BS-8 · May 2016
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
National Exams — May 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/FPGA architectures, flip-flop conversion, sequential design, arithmetic circuits; Floyd, Digital Fundamentals (11th ed., Pearson) — decoders, number systems, flip-flop characteristic tables, counters.
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). Sign-magnitude splits an $n$-bit word into one sign bit plus $(n-1)$ magnitude bits, so $+5$ and $-5$ differ only in the top bit (0101 vs 1101 for 4 bits); it has TWO representations of zero ($+0=0000$, $-0=1000$), and addition/subtraction needs separate sign-comparison and magnitude-borrow logic, which is why virtually no modern ALU uses it for arithmetic. Two’s complement instead represents $-x$ as $2^n-x$ (complement every bit of $x$ and add 1); it has a SINGLE representation of zero, and — its defining advantage — ordinary binary addition of the bit patterns produces the algebraically correct sum for ANY combination of signs, with no separate subtract circuit needed (subtraction is just "negate, then add"). Sign-magnitude’s advantage is that the magnitude is immediately readable without any transformation (useful for display, and historically for simpler multiply/divide hardware); two’s complement’s advantage is uniform, sign-agnostic adder hardware, which is why it is the near-universal choice in processors and DSPs today.
Part (b). A ripple-carry adder chains $n$ full adders, each waiting for the carry-out of the STAGE BELOW it before its own sum and carry-out are valid — the carry must physically "ripple" through every stage in sequence. A carry-look-ahead (CLA) adder instead computes each stage’s carry-out directly from the ORIGINAL input bits (via generate $G_i=A_iB_i$ and propagate $P_i=A_i\oplus B_i$ terms combined in a few levels of AND/OR logic), so every carry is available after a small, FIXED number of gate delays regardless of word width. Ripple-carry is slower because its worst-case delay grows LINEARLY with the number of bits ($\approx 2n$ gate delays for an $n$-bit adder, since each stage’s carry cannot even begin until the previous stage’s carry has settled), whereas CLA’s delay grows only with $\log n$ (or is constant for a single-level lookahead block) — the price CLA pays for that speed is a larger, more complex gate count that grows faster than linearly with width.
Part (c) — Given. Two 4-bit operands $A=A_3A_2A_1A_0$, $B=B_3B_2B_1B_0$, $C_{in,0}=0$. Find. A 4-bit ripple-carry adder built from the minimum number of 2-input AND, OR and XOR gates.
Approach. Derive the minimal full-adder gate count from its own truth table/K-map, then chain four identical full-adder stages, carry-out of stage $i$ feeding carry-in of stage $i+1$.
| Quantity | Result |
|---|---|
| Gates per full-adder stage | 2 XOR + 2 AND + 1 OR = 5 gates |
| 4-bit adder total | $\boxed{20\ \text{gates}}$ (8 XOR + 8 AND + 4 OR) |
| Worked check | $6+5=11$ (0110+0101=1011), $C_{out}=0$ |