Lesson 9 +35 XP

Combinational Circuits: Analysis & Design Procedure

Combinational Circuits: Analysis & Design Procedure

So far we have simplified given functions. Real problems start from a word description ("light the lamp when at least two of three switches are on") or from a circuit diagram whose purpose is unknown. This lesson gives the two standard procedures: analysis (circuit to function) and design (specification to circuit), plus multilevel NAND/NOR conversion and the three ways of describing a circuit in Verilog.

1. What Makes a Circuit Combinational

A combinational circuit is a set of logic gates whose outputs at any moment depend only on the present inputs. It has no memory and no feedback paths. With n inputs and m outputs it is fully described by a truth table with 2n rows and m output columns, or by m Boolean functions.

A sequential circuit also contains storage elements (flip-flops), so its outputs depend on the present inputs and the past (the stored state). Sequential circuits are the subject of Unit II.

Block diagram of a combinational circuitBlock diagram of a combinational circuit

CombinationalSequential
Output = f(present inputs)Output = f(present inputs, stored state)
No memory, no feedbackMemory elements, feedback
No clock neededUsually clocked
Adders, MUX, decoders, comparatorsFlip-flops, counters, registers

2. The Analysis Procedure

Given a circuit diagram, find what it does:

  1. Make sure the circuit is combinational (no feedback, no flip-flops).
  2. Label every gate output that is a function of the inputs with a symbol (T1, T2, ldots).
  3. Write the Boolean function of each labelled gate, starting from the inputs.
  4. Substitute until each output is expressed in the inputs only.
  5. Build the truth table (and simplify, or recognise the function).
SolvedExample 1 · Analysing a circuit (Mano)

A circuit has inputs A, B, C and these gates: F2 = AB + AC + BC, T1 = A + B + C, T2 = ABC, T3 = F2' T1, F1 = T3 + T2. Find F1 and F2 and identify the circuit.

  1. T3 = (AB + AC + BC)'(A + B + C). Expand (AB + AC + BC)' = (A' + B')(A' + C')(B' + C') = A'B' + A'C' + B'C'.
  2. T3 = (A'B' + A'C' + B'C')(A + B + C) = A'B'C + A'BC' + AB'C'.
  3. F1 = T3 + T2 = A'B'C + A'BC' + AB'C' + ABC.
  4. Truth table:
A B CF2F1
0 0 000
0 0 101
0 1 001
0 1 110
1 0 001
1 0 110
1 1 010
1 1 111
  1. F1 = ∑ m(1, 2, 4, 7) = A oplus B oplus C and F2 = ∑ m(3, 5, 6, 7) is 1 when two or more inputs are 1.
AnswerF1 is the sum and F2 the carry of a full adder

3. The Design Procedure

  1. From the specification, decide the number of inputs and outputs and give each a name.
  2. Derive the truth table that defines the required relationship.
  3. Obtain the simplified Boolean function for each output (K-map or QM), using don't-cares where inputs cannot occur.
  4. Draw the logic diagram (and, if required, convert to NAND or NOR).
  5. Verify the design (by hand, or by simulation).

Practical constraints that guide the choice of implementation: number of gates and gate inputs (cost), propagation delay through the levels (speed), fan-in and fan-out limits, power, and the available ICs.

SolvedExample 2 · Majority (voting) circuit

Design a circuit with three inputs whose output is 1 when the majority of inputs are 1.

  1. Inputs A, B, C; output F.
  2. Truth table: F = 1 for 011, 101, 110, 111, so F = ∑ m(3, 5, 6, 7).
  3. K-map: pairs (3, 7) = BC, (5, 7) = AC, (6, 7) = AB.
  4. F = AB + BC + AC: three 2-input AND gates and one 3-input OR gate.
AnswerF = AB + BC + AC (the same function as the full adder carry)
SolvedExample 3 · A 3-bit squarer

Design a circuit that accepts a 3-bit number N = ABC and outputs N2 in binary.

  1. The largest square is 72 = 49 < 64, so 6 outputs B5 ldots B0 are needed.
  2. Truth table:
NA B CN2B5B4B3B2B1B0
00 0 00000000
10 0 11000001
20 1 04000100
30 1 19001001
41 0 016010000
51 0 125011001
61 1 036100100
71 1 149110001
  1. Read each column: B0 = ∑ m(1, 3, 5, 7) = C; B1 = 0 always; B2 = ∑ m(2, 6) = BC'; B3 = ∑ m(3, 5) = A'BC + AB'C = C(A oplus B); B4 = ∑ m(4, 5, 7)= AB' + AC; B5 = ∑ m(6, 7) = AB.
AnswerB5 = AB, B4 = AB' + AC, B3 = C(A oplus B), B2 = BC', B1 = 0, B0 = C

Two observations from this example: an output can be a constant (B1 = 0 because every square is 0 or 1 modulo 4), and an output can equal an input directly (B0 = C because a square is odd exactly when the number is odd).

4. Multilevel NAND and NOR Circuits

Two-level forms are fast but not always cheapest. A multilevel expression such as

F = A(CD + B) + BC'

uses fewer gate inputs than its SOP form F = ACD + AB + BC'. To build any AND-OR multilevel circuit with NAND gates only:

  1. Draw the circuit with AND and OR gates.
  2. Replace each AND by a NAND (AND-invert), and each OR by an invert-OR symbol (an OR with bubbles on its inputs), which is also a NAND by De Morgan.
  3. Wherever a bubble is not matched by another bubble on the same line, insert an inverter (or complement the input literal).

For NOR only, use the dual rule: OR becomes NOR, AND becomes invert-AND (NOR), and unmatched bubbles get inverters.

Converting a multilevel AND-OR circuit to NAND gatesConverting a multilevel AND-OR circuit to NAND gates

SolvedExample 4 · Multilevel NAND conversion

Implement F = A(CD + B) + BC' with NAND gates.

  1. AND-OR structure: G1 = CD (AND), G2 = G1 + B (OR), G3 = A G2 (AND), G4 = BC' (AND), F = G3 + G4 (OR).
  2. Level by level with NAND gates:
  • N1 = (CD)', a NAND.
  • N2 = (N1 · B')' = CD + B, a NAND drawn as invert-OR. The bubble on its N1 input cancels the inversion of N1, but the bubble on its B input has no partner, so B must enter complemented.
  • N3 = (A · N2)' = (A(CD + B))', a NAND.
  • N4 = (BC')', a NAND.
  • F = (N3 N4)' = A(CD + B) + BC', a NAND drawn as invert-OR.
  1. Check by De Morgan: (N3 N4)' = N3' + N4' = A(CD + B) + BC'.
Answer5 NAND gates plus an inverter for B (or the literal B' if available)

5. Describing Combinational Circuits in Verilog

Verilog offers three styles. They all produce the same hardware:

StyleWritten withClosest to
Gate-level (structural)gate primitives and, or, not and wiresthe logic diagram
Dataflowassign with operators &, `, ~, ^`the Boolean equation
Behaviouralalways @(*) with if or casethe truth table or the specification

The majority function in all three styles, with a testbench that compares them:

VERILOG
// 3-input majority function described in the three Verilog modelling styles
module maj_gate (
    input  a, b, c,
    output f
);
    wire ab, bc, ac;
    and g1 (ab, a, b);
    and g2 (bc, b, c);
    and g3 (ac, a, c);
    or  g4 (f, ab, bc, ac);
endmodule

module maj_dataflow (
    input  a, b, c,
    output f
);
    assign f = (a & b) | (b & c) | (a & c);
endmodule

module maj_behav (
    input      a, b, c,
    output reg f
);
    always @(*) begin
        case ({a, b, c})
            3'b011, 3'b101, 3'b110, 3'b111: f = 1'b1;
            default:                        f = 1'b0;
        endcase
    end
endmodule

module tb;
    reg  a, b, c;
    wire f1, f2, f3;
    integer i;

    maj_gate     u1 (a, b, c, f1);
    maj_dataflow u2 (a, b, c, f2);
    maj_behav    u3 (a, b, c, f3);

    initial begin
        $display("a b c | gate dataflow behav");
        for (i = 0; i < 8; i = i + 1) begin
            {a, b, c} = i;
            #1 $display("%b %b %b |  %b      %b      %b", a, b, c, f1, f2, f3);
        end
    end
endmodule

All three columns agree on every row:

OUTPUT
a b c | gate dataflow behav
0 0 0 |  0      0      0
0 0 1 |  0      0      0
0 1 0 |  0      0      0
0 1 1 |  1      1      1
1 0 0 |  0      0      0
1 0 1 |  1      1      1
1 1 0 |  1      1      1
1 1 1 |  1      1      1

In the behavioural style the output is declared reg because it is assigned inside always; it is still combinational logic, not a register, because the block runs whenever any input changes (@(*)) and assigns f in every case.

6. Propagation Delay and Hazards

Every gate takes a small time, the propagation delay tpd, to respond. The delay of a combinational circuit is set by its longest path (the critical path) from an input to an output; a two-level circuit has a delay of about 2 tpd plus any input inverters.

Because different paths have different delays, an output can briefly show a wrong value (a glitch) when an input changes. This is called a hazard. In F = AB + A'C with B = C = 1, when A falls from 1 to 0 the term AB may switch off before A'C switches on, giving a momentary 0. Adding the consensus term BC (redundant logically) removes this static-1 hazard. Hazards matter in asynchronous circuits; clocked circuits ignore them by sampling only after the signals have settled.

💡 Tip

Key points to remember

  • Combinational: outputs depend only on present inputs; no memory or feedback.
  • Analysis: label gate outputs, write their functions, substitute, tabulate.
  • Design: inputs/outputs, truth table, simplify each output, draw, verify.
  • Multilevel NAND: AND becomes NAND, OR becomes invert-OR, fix unmatched bubbles with inverters.
  • Verilog styles: gate-level, dataflow (assign), behavioural (always @(*)).
🎯 END-TERM EXAM PREP

📝 IPU End-Term Exam Corner (5-10 Marks)

  • Q1. Distinguish between combinational and sequential circuits. Give the design procedure for combinational circuits. (5 Marks)
  • Q2. Design a combinational circuit that accepts a 3-bit number and generates its square as a 6-bit binary number. (10 Marks)
  • Write: the 8-row truth table, each output's expression (B1 = 0, B0 = C), and the logic diagram.
  • Q3. Analyse the circuit with F2 = AB + AC + BC and F1 = F2'(A + B + C) + ABC; show that it is a full adder. (5 Marks)
  • Q4. Implement F = A(CD + B) + BC' using NAND gates only. (5 Marks)
  • Q5. Design a 3-input majority circuit and write its Verilog description. (5 Marks)