Combinational Circuits
Level: 4 (Application — novel problems, no hints) Time limit: 60 minutes Total marks: 60
Q1. (12 marks) A 4-bit carry-lookahead adder (CLA) computes .
(a) Given and with carry-in , compute each bit's generate and propagate , then find using the CLA carry equations. Show the sum . (8)
(b) Suppose each gate has a delay of unit. State the number of gate delays to produce all carries in this 4-bit CLA (assume available after 1 delay, and each carry uses one AND-OR level). Compare with the delay of a 4-bit ripple-carry adder using full adders of 2 gate-delay carry paths. (4)
Q2. (12 marks) You must build a 6-input priority encoder (inputs , highest priority) that outputs a 3-bit code of the highest active input, plus a "valid" output .
(a) Write the truth table using don't-cares to express priority (rows for high down to all-zero). (6)
(b) Derive minimal Boolean expressions for , , and . (6)
Q3. (12 marks) Implement the Boolean function
using an 8:1 multiplexer with as select lines ( = MSB) and (plus constants) at the data inputs.
(a) Construct the implementation table and determine each data input as one of , , , or . (8)
(b) Identify a simpler pattern in and give a two-literal expression for . Verify it against . (4)
Q4. (12 marks) A combinational circuit implements
(a) Draw/describe the Karnaugh map (variables ) and mark the two prime-implicant loops used above. (3)
(b) Show that a static-1 hazard exists on a specific input transition. Identify the transition (which single variable changes) and explain why the glitch occurs in terms of the two AND gates. (5)
(c) Add the consensus term needed to eliminate the hazard and write the hazard-free expression. State its cost in literals versus the original. (4)
Q5. (12 marks) Design a 4-bit unsigned comparator core producing .
(a) Give the recursive/bitwise expression for in terms of per-bit equality and the bit comparisons , from MSB (bit 3) to LSB. (6)
(b) For and , evaluate each term of your expression and state whether , , or . (6)
Answer keyMark scheme & solutions
Q1 (12)
(a) (), , .
| i | ||||
|---|---|---|---|---|
| 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 |
| 2 | 0 | 1 | 0 | 1 |
| 3 | 1 | 0 | 0 | 1 |
(2 marks for g/p table)
Carry equations:
(4 marks — 1 each)
Sum :
So with → result . Check: . ✓ (2 marks)
(b) CLA: g/p ready at 1 delay; all carries produced with one AND-OR level = 2 gate delays total for carries (sums add 1 more XOR delay). Ripple-carry: carry ripples through 4 full adders at 2 delays each = 8 gate delays. CLA is ~4× faster. (4 marks: 2 for CLA=2, 2 for RCA=8)
Q2 (12)
(a) Truth table (X = don't care):
| 1 | X | X | X | X | X | 101 | 1 |
| 0 | 1 | X | X | X | X | 100 | 1 |
| 0 | 0 | 1 | X | X | X | 011 | 1 |
| 0 | 0 | 0 | 1 | X | X | 010 | 1 |
| 0 | 0 | 0 | 0 | 1 | X | 001 | 1 |
| 0 | 0 | 0 | 0 | 0 | 1 | 000 | 1 |
| 0 | 0 | 0 | 0 | 0 | 0 | XXX | 0 |
(6 marks — priority correctly captured via don't-cares)
(b) Let index of highest active input decide bits.
- (codes 4 and 5 have MSB set)
- (bit1 set only for codes 2,3, and only if 4,5 inactive)
- — evaluate bit0 = codes 1,3,5:
(6 marks: 1.5 each; equivalent minimal forms accepted)
Q3 (12)
(a) Group minterms by (rows), (column). Minterm number .
Minterms present: 1,3,4,6,9,11,12,14.
| (min) | (min) | present? | ||
|---|---|---|---|---|
| 000 | 0 | 1 | only 1 | |
| 001 | 2 | 3 | only 3 | |
| 010 | 4 | 5 | only 4 | |
| 011 | 6 | 7 | only 6 | |
| 100 | 8 | 9 | only 9 | |
| 101 | 10 | 11 | only 11 | |
| 110 | 12 | 13 | only 12 | |
| 111 | 14 | 15 | only 14 |
So . (8 marks)
(b) Pattern: when , when . So .
Check minterm 6 (): ✓; minterm 1 (): ✓.
(4 marks)
Q4 (12)
(a) K-map ( rows, columns), :
covers cells : minterms 1,3. covers : minterms 4,5. (3 marks — loops identified)
(b) Both terms are 1 in the region where the two loops are adjacent but not overlapping. Consider with :
- Before (, m1): , → via term1.
- After (, m5): , → via term2.
During the transition, turns off before turns on (due to inverter delay on ), so momentarily = 0 → static-1 hazard. The changing variable is (with held). (5 marks)
(c) Consensus of and (eliminate ): . Hazard-free: This term stays 1 across the transition (), covering the glitch. Cost: original = 4 literals, hazard-free = 6 literals (+2). (4 marks)
Q5 (12)
(a) With (bit-equal): (higher bits must be equal before a lower bit decides). (6 marks)
(b) , .
| i | ||||
|---|---|---|---|---|
| 3 | 1 | 1 | 0 | 1 |
| 2 | 0 | 0 | 0 | 1 |
| 1 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 |
Terms:
. Since bit1: (first inequality from MSB), . Check: , , so → . ✓ (6 marks)
[
{"claim":"Q1 CLA sum: 11+6+1 = 18 = 10010b","code":"A=0b1011; B=0b0110; C0=1; s=A+B+C0; result = (s==18 and format(s,'05b')=='10010')"},
{"claim":"Q1 all carries C1..C4 equal 1","code":"g=[0,1,0,0]; p=[1,0,1,1]; C=[1]; \nfor i in range(4):\n C.append(g[i] or (p[i] and C[i]))\nresult = C[1:]==[1,1,1,1]"},
{"claim":"Q3 F = C xor D matches minterms 1,3,4,6,9,11,12,14","code":"mins=set([1,3,4,6,9,11,12,14]); ok=True\nfor n in range(16):\n A=(n>>3)&1;B=(n>>2)&1;Cc=(n>>1)&1;D=n&1\n f=Cc^D\n if f!=(1 if n in mins else 0): ok=False\nresult=ok"},
{"claim":"Q4 hazard-free F equals original F over all inputs","code":"ok=True\nfor n in range(8):\n A=(n>>2)&1;B=(n>>1)&1;Cc=n&1\n f1=((1-A)&Cc)|(A&(1-B))\n f2=f1|((1-B)&Cc)\n if f1!=f2: ok=False\nresult=ok"},
{"claim":"Q5 A=9,B=10 gives A<B (A>B expression = 0)","code":"A=0b1001;B=0b1010; result = (A<B) and not (A>B)"}
]