Combinational Circuits
Level: 3 — Production (from-scratch derivations, explain-out-loud) Time limit: 45 minutes Total marks: 60
Instructions: Show all working. Derive expressions from first principles unless a form is given. Use for XOR, for NOT. Marks are shown per part.
Question 1 — Full Adder & Ripple-Carry Timing (10 marks)
(a) From the truth table, derive the sum-of-products expressions for the sum and carry-out of a full adder in terms of inputs , , . Simplify to XOR form and to a 3-term minimal SOP. (4)
(b) A single full adder has a sum delay of 3 gate delays and a carry delay of 2 gate delays. For an bit ripple-carry adder, derive the worst-case delay to a stable output (the final sum bit). Show the critical path reasoning. (4)
(c) State one structural reason ripple-carry becomes unattractive as grows, and name the alternative. (2)
Question 2 — Carry-Lookahead Derivation (12 marks)
(a) Define the generate and propagate signals for bit in terms of , . (2)
(b) Starting from , derive the fully expanded expression for (the carry into bit 3) in terms of and . (5)
(c) Explain why the carry-lookahead adder achieves carry-generation depth (in terms of gate levels), and state the practical cost that grows with . (3)
(d) Compute given: , , (bit 0 is LSB). Show then evaluate. (2)
Question 3 — Multiplexer as Universal Logic (10 marks)
(a) Write the output expression of a 4:1 MUX with select lines and data inputs . (2)
(b) Implement the 3-variable function using a single 4:1 MUX with as the select lines. Derive each data-input value () as a function of (or constant). Show your working. (6)
(c) Explain in one or two sentences why an -select MUX can implement any function of its select variables. (2)
Question 4 — Comparator & Priority Encoder (10 marks)
(a) Derive the three outputs of a 1-bit comparator (, , ) as Boolean expressions of . (3)
(b) For a 2-bit magnitude comparator (, ), derive the equality output and the greater-than output . (4)
(c) Give the truth table (inputs , outputs , valid ) for a 4-to-2 priority encoder where has highest priority, and write as a Boolean expression. (3)
Question 5 — Static Hazard Elimination (10 marks)
(a) Define a static-1 hazard. Explain the physical mechanism that causes it. (3)
(b) Consider . Draw/describe the K-map (variables ) and identify the specific input transition that produces a static-1 hazard. (4)
(c) Add the redundant consensus term that removes the hazard, and state the general rule for hazard-free two-level SOP design. (3)
Question 6 — Combinational Multiplier & Subtractor (8 marks)
(a) For a unsigned array multiplier with inputs , , derive the four partial-product bits and the resulting 4-bit product expressions (you may use half/full adders in the description). (5)
(b) Show how a full adder + an XOR gate per bit converts an -bit ripple-carry adder into a two's-complement subtractor computing . State what must be set to and why. (3)
Answer keyMark scheme & solutions
Question 1 (10)
(a) Truth table SOP: (2 — 1 for SOP, 1 for XOR reduction) (2 — minimal 3-term SOP; the majority function)
(b) Critical path: enters FA0. Carry ripples FA0→FA1→FA2→FA3, each stage adding carry delay (2). After the final carry into FA3 is stable, the last sum bit needs sum delay (3).
- Carry through 4 stages: but sum depends on carry-in to stage 3, i.e. , which is produced by 3 carry propagations from .
- Delay gate delays. (4) (Accept: for .)
(c) Delay grows linearly with bit-width because each carry must ripple sequentially → slow for wide adders. Alternative: carry-lookahead adder (also accept carry-select/carry-save). (2)
Question 2 (12)
(a) (carry generated), (or for propagate; either accepted). (2)
(b) Unrolling :
- (5 — 1 per correct term expansion)
(c) Each carry is expressed as a two-level SOP (AND-OR) directly from , so every carry is produced in 2 gate levels regardless of — constant depth. Practical cost: fan-in and number of gates (product terms) grows with , limiting full lookahead to small groups (hence hierarchical/block CLA). (3)
(d) , → bits (LSB first): ; .
- ,
- ,
- , . (2)
Question 3 (10)
(a) . (2)
(b) Select (A=MSB=, B=). Group minterms by , residual on :
- (m0,m1): F=1 only at m1 (C=1) →
- (m2,m3): F=1 at m2 (C=0) →
- (m4,m5): F=1 at m4 (C=0) →
- (m6,m7): F=1 at m7 (C=1) →
So . (6 — mark ~1.5 each, or per correct data input)
(c) An -select MUX routes one of data inputs per select combination; by placing the truth-table output value at each data input, any function of the select variables is realized (it directly implements the truth table). (2)
Question 4 (10)
(a) ; ; . (3)
(b) Equality: where is XNOR, i.e. (2) Greater-than: (compare MSB first; if MSBs equal, compare LSB.) (2)
(c) Priority encoder (X=don't care), highest:
| V | ||
|---|---|---|
| 0 0 0 0 | X X | 0 |
| 0 0 0 1 | 0 0 | 1 |
| 0 0 1 X | 0 1 | 1 |
| 0 1 X X | 1 0 | 1 |
| 1 X X X | 1 1 | 1 |
; (, ). (3 — table 2, 1)
Question 5 (10)
(a) A static-1 hazard: output should stay at logic 1 across a single-variable input change but momentarily glitches to 0. Cause: two paths of differing propagation delay converge; a change in one variable switches the covering product term off before the other turns on, leaving a gap. (3)
(b) . On K-map, the "1" cells (A=0,C=1) and (A=1,B=1) are adjacent when . Transition with : leaving cover of , entering cover of — no common product term spans the boundary → static-1 hazard. (4)
(c) Add consensus term : . This term stays high throughout the transition when , covering the gap. General rule: a two-level SOP is hazard-free for single-input changes iff every pair of adjacent 1-minterms is covered by a common product term (include all consensus/redundant primes needed to overlap covers). (3)
Question 6 (8)
(a) Partial products: .
- , carry
- , carry
- (HA/FA description acceptable.) (5)
(b) For in two's complement: XOR each with a control line to invert (), forming one's complement; set carry-in to add 1, completing two's complement. Result . So per bit: FA computes , with for subtract. (3)
[
{"claim":"RCA n=4 delay = 3*carry+sum = 9","code":"carry=2; summ=3; n=4; result=((n-1)*carry+summ)==9"},
{"claim":"C3 for A=1011,B=0110,C0=0 equals 1","code":"A=[1,1,0,1]; B=[0,1,1,0]; C0=0; G=[A[i]&B[i] for i in range(4)]; P=[A[i]^B[i] for i in range(4)]; C3=G[2] | (P[2]&G[1]) | (P[2]&P[1]&G[0]) | (P[2]&P[1]&P[0]&C0); result=C3==1"},
{"claim":"MUX data inputs realize F=sum m(1,2,4,7)","code":"from sympy import symbols; C=symbols('C'); vals={}; mins={1,2,4,7}; ok=True; D={}; \nfor AB in range(4):\n a=(AB>>1)&1; b=AB&1; d0=1 if (AB*2+0) in mins else 0; d1=1 if (AB*2+1) in mins else 0; D[AB]=(d0,d1)\nexp={0:(0,1),1:(1,0),2:(1,0),3:(0,1)}; result=(D==exp)"},
{"claim":"2x2 multiplier: A=3,B=3 gives product 9","code":"A=[1,1]; B=[1,1]; P0=A[0]&B[0]; s1=(A[1]&B[0])^(A[0]&B[1]); c1=(A[1]&B[0])&(A[0]&B[1]); P1=s1; P2=(A[1]&B[1])^c1; c2=(A[1]&B[1])&c1; P3=c2; val=P0+2*P1+4*P2+8*P3; result=val==9"}
]