Level 2 — RecallCombinational Circuits

Combinational Circuits

30 minutes40 marksprintable — key stays hidden on paper

Subject: Hardware Chapter: 3.3 Combinational Circuits Difficulty Level: 2 (Recall — definitions, standard textbook problems, short derivations) Time Limit: 30 minutes Total Marks: 40


Instructions: Answer all questions. Show working where derivations are required. Use \oplus for XOR, \cdot for AND, ++ for OR.


Q1. [3 marks] Write the Boolean expressions for the Sum and Carry outputs of a half adder with inputs AA and BB.

Q2. [4 marks] For a full adder with inputs AA, BB and carry-in CinC_{in}, write the expressions for Sum and Carry-out CoutC_{out}. State how many half adders and OR gates are needed to build one full adder.

Q3. [4 marks] A 4-bit ripple-carry adder is built from full adders, each having a gate delay of 2Δ2\Delta for its carry output. Compute the worst-case time to produce the final carry-out C4C_4. Explain briefly why ripple-carry adders are slow.

Q4. [5 marks] For a carry-lookahead adder, define the generate gig_i and propagate pip_i signals in terms of AiA_i and BiB_i. Write the expression for carry C1C_1 and C2C_2 in terms of gig_i, pip_i and C0C_0.

Q5. [4 marks] Explain how a full subtractor differs from a full adder. Write the Boolean expressions for the Difference and Borrow-out of a full subtractor with inputs AA, BB, BinB_{in}.

Q6. [4 marks] A 4:1 multiplexer has data inputs I0I_0I3I_3 and select lines S1S0S_1 S_0. Write the output expression YY as a sum-of-products of the select lines and data inputs.

Q7. [4 marks] Distinguish between a decoder and a demultiplexer. State the number of output lines of a 3-to-8 decoder and how many of them are active for any given input.

Q8. [4 marks] Explain the function of a priority encoder and how it differs from an ordinary encoder. For an 8-to-3 priority encoder, if inputs D5D_5 and D2D_2 are both HIGH, what is the 3-bit output?

Q9. [4 marks] Design an even parity generator for a 3-bit data word D2D1D0D_2 D_1 D_0. Write the expression for the parity bit PP. What value of PP is generated for the input 101101?

Q10. [4 marks] Define a static-1 hazard in a combinational circuit. State one general method used to eliminate such hazards.

Answer keyMark scheme & solutions

Q1. [3 marks]

  • Sum=AB\text{Sum} = A \oplus B (1.5)
  • Carry=AB\text{Carry} = A \cdot B (1.5)

Why: Sum is 1 when inputs differ (XOR); carry is generated only when both are 1 (AND).


Q2. [4 marks]

  • Sum=ABCin\text{Sum} = A \oplus B \oplus C_{in} (1.5)
  • Cout=AB+Cin(AB)C_{out} = A\cdot B + C_{in}\cdot(A \oplus B) (or AB+BCin+ACinAB+BC_{in}+AC_{in}) (1.5)
  • Built from 2 half adders + 1 OR gate (1)

Why: First HA adds A,BA,B; second HA adds their sum with CinC_{in}; OR combines the two intermediate carries.


Q3. [4 marks]

  • Carry ripples through 4 stages, each 2Δ2\Delta: t=4×2Δ=8Δt = 4 \times 2\Delta = 8\Delta (2)
  • Slow because each stage's carry-out depends on the previous stage's carry-in, so the carry must propagate sequentially through all stages — delay grows linearly with word length. (2)

Q4. [5 marks]

  • gi=AiBig_i = A_i \cdot B_i (1)
  • pi=AiBip_i = A_i \oplus B_i (or Ai+BiA_i + B_i) (1)
  • C1=g0+p0C0C_1 = g_0 + p_0 C_0 (1.5)
  • C2=g1+p1g0+p1p0C0C_2 = g_1 + p_1 g_0 + p_1 p_0 C_0 (1.5)

Why: A carry is produced if generated at that bit, or propagated from a lower carry. Expanding recursively removes ripple dependency → constant depth.


Q5. [4 marks]

  • A full subtractor computes ABBinA - B - B_{in} producing a borrow instead of a carry; it uses a borrow-in/borrow-out. (1)
  • Difference=ABBin\text{Difference} = A \oplus B \oplus B_{in} (1.5)
  • Bout=AˉB+AˉBin+BBinB_{out} = \bar{A}B + \bar{A}B_{in} + B B_{in} (or AˉB+(AB)Bin\bar A B + (\overline{A\oplus B})B_{in}) (1.5)

Why: Difference mirrors adder sum; borrow arises when the minuend bit is smaller than subtrahend + incoming borrow.


Q6. [4 marks] Y=S1ˉS0ˉI0+S1ˉS0I1+S1S0ˉI2+S1S0I3Y = \bar{S_1}\bar{S_0}I_0 + \bar{S_1}S_0 I_1 + S_1\bar{S_0}I_2 + S_1 S_0 I_3 Each correct product term (1 each).

Why: Each select combination enables exactly one data input onto the output.


Q7. [4 marks]

  • Decoder: activates one output line based on binary input code (no data input). Demultiplexer: routes a single data input to one of several outputs selected by control lines. (A decoder = demux with data input tied to enable.) (2)
  • 3-to-8 decoder has 8 output lines, and exactly 1 output is active for any input. (2)

Q8. [4 marks]

  • A priority encoder outputs the binary code of the highest-priority active input, resolving the ambiguity when multiple inputs are HIGH (ordinary encoder gives invalid output for multiple inputs). (2)
  • D5D_5 (higher priority than D2D_2) wins → output = binary 55 = 101\mathbf{101}. (2)

Q9. [4 marks]

  • Even parity: total number of 1s (data + parity) must be even, so P=D2D1D0P = D_2 \oplus D_1 \oplus D_0. (2)
  • For input 101101: 101=01 \oplus 0 \oplus 1 = 0, so P=0P = \mathbf{0}. (2)

Why: Data 101101 already has two 1s (even), so parity bit is 0 to keep it even.


Q10. [4 marks]

  • A static-1 hazard is a momentary transient (glitch) to 0 on an output that should remain steady at 1 while inputs change, caused by unequal path delays. (2)
  • Eliminated by adding redundant (consensus) prime-implicant terms to cover the transition between adjacent groups in the K-map. (2)

[
  {"claim":"4-bit RCA final carry delay = 8*delta", "code":"delta=symbols('delta'); result = (4*2*delta) == 8*delta"},
  {"claim":"Full subtractor difference for A=1,B=0,Bin=1 is 0", "code":"A,B,Bin=1,0,1; result = ((A ^ B ^ Bin)==0)"},
  {"claim":"Even parity bit for data 101 is 0", "code":"D=[1,0,1]; result = ((D[0]^D[1]^D[2])==0)"},
  {"claim":"Priority encoder with D5,D2 high outputs binary 5 = 101", "code":"hi=5; bits=[(hi>>2)&1,(hi>>1)&1,hi&1]; result = (bits==[1,0,1])"},
  {"claim":"C2 for A=[1,1],B=[1,0],C0=0 gives carry into bit2 = 1", "code":"A0,B0,A1,B1,C0=1,1,0,1,0; g0=A0&B0; p0=A0^B0; g1=A1&B1; p1=A1^B1; C2=g1|(p1&g0)|(p1&p0&C0); result = (C2==1)"}
]