04-BS-8 · May 2018
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
04-BS-8 Digital Logic Circuits — May 2018
National Exams, 3 hours, closed book (Casio or Sharp approved calculator only; one hand-written 8.5"×11" aid sheet, both sides, 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, K-maps, PAL/PLA/FPGA architectures, flip-flop conversion, sequential-circuit design, arithmetic circuits; Floyd, Digital Fundamentals (11th ed., Pearson) — logic gates, multiplexers, shift registers, flip-flop characteristic tables.
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.
(a) A PAL (Programmable Array Logic) has a programmable AND array feeding a fixed OR array, and a PLA (Programmable Logic Array) programs both the AND and OR arrays — but both are still single-level, two-plane SOP structures with a small, fixed pool of macrocells and no routing between cells other than through the fixed I/O pins. An FPGA (Field-Programmable Gate Array) is architecturally different in three ways that make it far more versatile: (1) it is built from a large 2-D array of small, identical Configurable Logic Blocks (each a look-up table + flip-flop, able to realize any function of a few inputs, not just a fixed AND-OR term); (2) it has a rich, programmable interconnect fabric (routing channels and programmable switch matrices) that lets any CLB output reach any other CLB input, so designs are not limited to one pass through a fixed two-level array — arbitrarily deep, arbitrarily large logic and full sequential state machines fit on one device; and (3) it integrates abundant on-chip flip-flops/registers and, on modern devices, dedicated block RAM, multipliers and I/O standards, so an entire digital subsystem (datapath + control + memory) can be realized in one part. A PAL/PLA, by contrast, is sized for a handful of SOP equations and cannot economically hold a large state machine or a memory-based function. This is why FPGAs scale from small glue logic up to entire SoC-class designs, while PAL/PLA remain suited only to small fixed combinational replacement logic.
Given. $C_3C_2C_1C_0$, a 4-bit 2’s-complement code for an integer in $[-8,7]$, restricted by the question to the sub-range $[-7,+7]$ (so the all-magnitude-zero-sign-negative code $1000$, which would encode $-8$ and has no 4-bit sign-magnitude equivalent, never occurs and is a don’t-care).
Find. $M_3M_2M_1M_0$, the 4-bit sign-magnitude equivalent ($M_3$=sign, $M_2M_1M_0$=magnitude), via truth table, K-map SOP, and a minimum-2-input-gate circuit.
Approach. Tabulate all 15 valid codes (minterm 8 = don’t-care), K-map/minimize each output bit directly from the table, then recognize the arithmetic shortcut — sign-magnitude conversion from 2’s complement is exactly "conditionally invert the magnitude bits when negative, then add 1" — which realizes the same four functions with far fewer, more regular gates than the raw SOP.
| C3 C2 C1 C0 | Value | M3 M2 M1 M0 |
|---|---|---|
| 0000 | 0 | 0000 |
| 0001 | +1 | 0001 |
| 0010 | +2 | 0010 |
| 0011 | +3 | 0011 |
| 0100 | +4 | 0100 |
| 0101 | +5 | 0101 |
| 0110 | +6 | 0110 |
| 0111 | +7 | 0111 |
| 1000 | −8 (excluded) | d,d,d,d |
| 1001 | −7 | 1111 |
| 1010 | −6 | 1110 |
| 1011 | −5 | 1101 |
| 1100 | −4 | 1100 |
| 1101 | −3 | 1011 |
| 1110 | −2 | 1010 |
| 1111 | −1 | 1001 |
| Item | Result |
|---|---|
| M3 | $C_3$ (direct wire) |
| M0 | $C_0$ (direct wire) |
| M2, M1 (K-map SOP) | 3 product terms each |
| Minimum-gate design | 6 XOR + 2 AND = 8 two-input gates (conditional complementer) |