Question 2 of 5: Multi-Output Karnaugh-Map Minimization with Shared Logic
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer)
Notes on this paper
National Exams — May 2013 — 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.
Given. $Y(a,b,c,d)=\sum m(0,2,4,6,7,9)+D(10,11)$; $Z(a,b,c,d)=\sum m(2,4,9,10,15)+D(0,13,14)$; every literal ($a,a',b,b',c,c',d,d'$) is available directly; only 2-input AND/OR gates are permitted.
Find. (a) A minimum-cost realization of $Y$ and $Z$ that shares logic between the two outputs; (b) how many 2-input gates that sharing saves versus minimizing $Y$ and $Z$ as two independent circuits.
Approach. Minimize $Y$ and $Z$ independently to their minimal sum-of-products forms (Karnaugh map / Quine–McCluskey, don't-cares used freely), then scan the two term lists for 2-literal sub-products common to terms of both functions and factor each shared sub-product out once, counting 2-input AND/OR gates for both the shared and the fully-separate realizations.
Minimize $Z$. Grouping the K-map (minterms 2,4,9,10,15 required; 0,13,14 don't-care) gives the minimal SOP
$$Z = abd + ac'd + b'cd' + a'c'd'$$
(also verified against its truth table).
Cost the two functions as fully SEPARATE circuits (2-input gates only). $Y$'s terms need $1+2+2=5$ AND gates (the 2-literal term $a'd'$ costs 1 gate; each 3-literal term costs 2 cascaded 2-input ANDs) plus $2$ OR gates to sum 3 terms, i.e. 7 gates. $Z$'s four 3-literal terms cost $4\times2=8$ AND gates plus $3$ OR gates to sum 4 terms, i.e. 11 gates. Separate total: $7+11=18$ two-input gates.
Look for shared 2-literal sub-products between the two term lists. $Y$'s term $a'd'$ is itself the 2-literal product $P_1=a'\cdot d'$, and $Z$'s term $a'c'd'$ is exactly $P_1\cdot c'$ — so $P_1$ can be built once and reused. Separately, the pair $P_2=a\cdot d$ appears inside three different terms: $Y$'s $ab'd=P_2\cdot b'$, and $Z$'s $abd=P_2\cdot b$ and $ac'd=P_2\cdot c'$. $Y$'s $a'bc$ and $Z$'s $b'cd'$ share no common sub-product with anything else and must still be built from their own 2 AND gates each.
Cost the SHARED (combined) circuit. Build $P_1=a'd'$ (1 gate, and this is $Y$'s first term) and $P_2=ad$ (1 gate); tap $P_1\cdot c'$ for $Z$ (1 gate) and $P_2\cdot b'$, $P_2\cdot b$, $P_2\cdot c'$ for $Y$, $Z$, $Z$ respectively (1 gate each, 3 gates); build the two unshared terms $a'bc$ and $b'cd'$ at 2 gates each (4 gates). AND-gate subtotal: $1+1+1+3+4=10$. OR gates: $Y$ still sums 3 terms (2 OR gates), $Z$ still sums 4 terms (3 OR gates), subtotal 5. Combined total: $10+5=15$ two-input gates.
Part (b) — compare. Separate design $=18$ gates; shared design $=15$ gates: sharing $P_1=a'd'$ and $P_2=ad$ across both outputs saves $18-15=\boxed{3}$ two-input gates, an $\approx16.7\%$ reduction, with $Y$ and $Z$ computing identically to their independently-minimized forms.
Shared-term (multi-output) realization: the two 2-literal products $P_1=a'd'$ and $P_2=ad$ are each built once and reused across the $Y$ and $Z$ OR-trees, instead of being rebuilt separately inside each output.
Quantity
Result
$Y$, minimal SOP
$Y=a'd'+ab'd+a'bc$
$Z$, minimal SOP
$Z=abd+ac'd+b'cd'+a'c'd'$
Cost, two separate circuits
18 two-input gates (7 for $Y$ + 11 for $Z$)
Cost, shared/combined circuit (part a)
15 two-input gates
Saving from sharing (part b)
3 gates ($\approx16.7\%$), via shared $P_1=a'd'$, $P_2=ad$