Level 4 — ApplicationCombinational Circuits

Combinational Circuits

60 minutes60 marksprintable — key stays hidden on paper

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+BA + B.

(a) Given A=10112A = 1011_2 and B=01102B = 0110_2 with carry-in C0=1C_0 = 1, compute each bit's generate gi=AiBig_i = A_i B_i and propagate pi=AiBip_i = A_i \oplus B_i, then find C1,C2,C3,C4C_1, C_2, C_3, C_4 using the CLA carry equations. Show the sum S3S2S1S0S_3 S_2 S_1 S_0. (8)

(b) Suppose each gate has a delay of 11 unit. State the number of gate delays to produce all carries in this 4-bit CLA (assume gi,pig_i, p_i 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 D0D5D_0 \dots D_5, D5D_5 highest priority) that outputs a 3-bit code Y2Y1Y0Y_2 Y_1 Y_0 of the highest active input, plus a "valid" output VV.

(a) Write the truth table using don't-cares to express priority (rows for D5D_5 high down to all-zero). (6)

(b) Derive minimal Boolean expressions for Y2Y_2, Y1Y_1, Y0Y_0 and VV. (6)


Q3. (12 marks) Implement the Boolean function

F(A,B,C,D)=m(1,3,4,6,9,11,12,14)F(A,B,C,D) = \sum m(1,3,4,6,9,11,12,14)

using an 8:1 multiplexer with A,B,CA,B,C as select lines (AA = MSB) and DD (plus constants) at the data inputs.

(a) Construct the implementation table and determine each data input I0I7I_0 \dots I_7 as one of 00, 11, DD, or D\overline{D}. (8)

(b) Identify a simpler pattern in FF and give a two-literal expression for FF. Verify it against I0I7I_0\ldots I_7. (4)


Q4. (12 marks) A combinational circuit implements

F=AC+ABF = \overline{A}\,C + A\,\overline{B}

(a) Draw/describe the Karnaugh map (variables A,B,CA,B,C) 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>BA>B.

(a) Give the recursive/bitwise expression for A>BA>B in terms of per-bit equality xi=AiBix_i = \overline{A_i \oplus B_i} and the bit comparisons AiBiA_i \overline{B_i}, from MSB (bit 3) to LSB. (6)

(b) For A=10012A = 1001_2 and B=10102B = 1010_2, evaluate each term of your expression and state whether A>BA>B, A=BA=B, or A<BA<B. (6)

Answer keyMark scheme & solutions

Q1 (12)

(a) A=1011A=1011 (A3A2A1A0A_3A_2A_1A_0), B=0110B=0110, C0=1C_0=1.

i AiA_i BiB_i gi=AiBig_i=A_iB_i pi=AiBip_i=A_i\oplus B_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:

  • C1=g0+p0C0=0+11=1C_1 = g_0 + p_0C_0 = 0 + 1\cdot1 = 1
  • C2=g1+p1C1=1+01=1C_2 = g_1 + p_1C_1 = 1 + 0\cdot1 = 1
  • C3=g2+p2C2=0+11=1C_3 = g_2 + p_2C_2 = 0 + 1\cdot1 = 1
  • C4=g3+p3C3=0+11=1C_4 = g_3 + p_3C_3 = 0 + 1\cdot1 = 1

(4 marks — 1 each)

Sum Si=piCiS_i = p_i \oplus C_i:

  • S0=11=0S_0 = 1\oplus1 = 0
  • S1=01=1S_1 = 0\oplus1 = 1
  • S2=11=0S_2 = 1\oplus1 = 0
  • S3=11=0S_3 = 1\oplus1 = 0

So S=0010S = 0010 with C4=1C_4=1 → result 100102=1810010_2 = 18. Check: 11+6+1=1811+6+1=18. ✓ (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):

D5D_5 D4D_4 D3D_3 D2D_2 D1D_1 D0D_0 Y2Y1Y0Y_2Y_1Y_0 VV
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.

  • V=D0+D1+D2+D3+D4+D5V = D_0 + D_1 + D_2 + D_3 + D_4 + D_5
  • Y2=D4+D5Y_2 = D_4 + D_5 (codes 4 and 5 have MSB set)
  • Y1=D5D4(D3+D2)Y_1 = \overline{D_5}\,\overline{D_4}(D_3 + D_2) (bit1 set only for codes 2,3, and only if 4,5 inactive)
  • Y0=D5+D4D3D20Y_0 = D_5 + \overline{D_4}\,\overline{D_3}\,D_2 \cdot 0 \dots — evaluate bit0 = codes 1,3,5:
    • Y0=D5+D4D3+D4D3D2D1Y_0 = D_5 + \overline{D_4}D_3 + \overline{D_4}\,\overline{D_3}\,\overline{D_2}D_1

(6 marks: 1.5 each; equivalent minimal forms accepted)


Q3 (12)

(a) Group minterms by ABCABC (rows), DD (column). Minterm number =8A+4B+2C+D= 8A+4B+2C+D.

Minterms present: 1,3,4,6,9,11,12,14.

ABCABC D=0D=0 (min) D=1D=1 (min) present? II
000 0 1 only 1 DD
001 2 3 only 3 DD
010 4 5 only 4 D\overline{D}
011 6 7 only 6 D\overline{D}
100 8 9 only 9 DD
101 10 11 only 11 DD
110 12 13 only 12 D\overline{D}
111 14 15 only 14 D\overline{D}

So I0=D, I1=D, I2=D, I3=D, I4=D, I5=D, I6=D, I7=DI_0=D,\ I_1=D,\ I_2=\overline{D},\ I_3=\overline{D},\ I_4=D,\ I_5=D,\ I_6=\overline{D},\ I_7=\overline{D}. (8 marks)

(b) Pattern: I=DI = D when C=0C=0, I=DI=\overline{D} when C=1C=1. So F=CD+CD=CDF = \overline{C}\,D + C\,\overline{D} = C \oplus D.

Check minterm 6 (C=1,D=0C=1,D=0): 10=11\oplus0=1 ✓; minterm 1 (C=0,D=1C=0,D=1): 01=10\oplus1=1 ✓.

F=CD\boxed{F = C \oplus D} (4 marks)


Q4 (12)

(a) K-map (AA rows, BCBC columns), F=AC+ABF=\overline A C + A\overline B:

AC\overline A C covers cells (A=0,C=1)(A{=}0,C{=}1): minterms 1,3. ABA\overline B covers (A=1,B=0)(A{=}1,B{=}0): 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 A:01A:0\to1 with B=0,C=1B=0, C=1:

  • Before (A=0,B=0,C=1A=0,B=0,C=1, m1): AC=1\overline A C=1, AB=0A\overline B=0F=1F=1 via term1.
  • After (A=1,B=0,C=1A=1,B=0,C=1, m5): AC=0\overline A C=0, AB=1A\overline B=1F=1F=1 via term2.

During the transition, AC\overline A C turns off before ABA\overline B turns on (due to inverter delay on AA), so FF momentarily = 0 → static-1 hazard. The changing variable is AA (with B=0,C=1B=0,C=1 held). (5 marks)

(c) Consensus of AC\overline A C and ABA\overline B (eliminate AA): CB=BCC\cdot\overline B = \overline B C. Hazard-free: F=AC+AB+BCF = \overline A C + A\overline B + \overline B C This term stays 1 across the transition (B=0,C=1B=0,C=1), covering the glitch. Cost: original = 4 literals, hazard-free = 6 literals (+2). (4 marks)


Q5 (12)

(a) With xi=AiBix_i = \overline{A_i\oplus B_i} (bit-equal): A>B=A3B3+x3A2B2+x3x2A1B1+x3x2x1A0B0A>B = A_3\overline{B_3} + x_3 A_2\overline{B_2} + x_3 x_2 A_1\overline{B_1} + x_3 x_2 x_1 A_0\overline{B_0} (higher bits must be equal before a lower bit decides). (6 marks)

(b) A=1001A=1001, B=1010B=1010.

i AiA_i BiB_i AiBiA_i\overline{B_i} xix_i
3 1 1 0 1
2 0 0 0 1
1 0 1 0 0
0 1 0 1 1

Terms:

  • A3B3=0A_3\overline{B_3}=0
  • x3A2B2=10=0x_3A_2\overline{B_2}=1\cdot0=0
  • x3x2A1B1=110=0x_3x_2A_1\overline{B_1}=1\cdot1\cdot0=0
  • x3x2x1A0B0=1101=0x_3x_2x_1A_0\overline{B_0}=1\cdot1\cdot0\cdot1=0

A>B=0A>B = 0. Since bit1: A1=0,B1=1A_1=0,B_1=1 (first inequality from MSB), A<BA<B. Check: 10012=91001_2=9, 10102=101010_2=10, so 9<109<10A<BA<B. ✓ (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)"}
]