Loading lessons...
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 circuit
| Combinational | Sequential |
|---|---|
| Output = f(present inputs) | Output = f(present inputs, stored state) |
| No memory, no feedback | Memory elements, feedback |
| No clock needed | Usually clocked |
| Adders, MUX, decoders, comparators | Flip-flops, counters, registers |
2. The Analysis Procedure
Given a circuit diagram, find what it does:
- Make sure the circuit is combinational (no feedback, no flip-flops).
- Label every gate output that is a function of the inputs with a symbol (T1, T2, ldots).
- Write the Boolean function of each labelled gate, starting from the inputs.
- Substitute until each output is expressed in the inputs only.
- Build the truth table (and simplify, or recognise the function).
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.
- T3 = (AB + AC + BC)'(A + B + C). Expand (AB + AC + BC)' = (A' + B')(A' + C')(B' + C') = A'B' + A'C' + B'C'.
- T3 = (A'B' + A'C' + B'C')(A + B + C) = A'B'C + A'BC' + AB'C'.
- F1 = T3 + T2 = A'B'C + A'BC' + AB'C' + ABC.
- Truth table:
| A B C | F2 | F1 |
|---|---|---|
| 0 0 0 | 0 | 0 |
| 0 0 1 | 0 | 1 |
| 0 1 0 | 0 | 1 |
| 0 1 1 | 1 | 0 |
| 1 0 0 | 0 | 1 |
| 1 0 1 | 1 | 0 |
| 1 1 0 | 1 | 0 |
| 1 1 1 | 1 | 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.
3. The Design Procedure
- From the specification, decide the number of inputs and outputs and give each a name.
- Derive the truth table that defines the required relationship.
- Obtain the simplified Boolean function for each output (K-map or QM), using don't-cares where inputs cannot occur.
- Draw the logic diagram (and, if required, convert to NAND or NOR).
- 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.
Design a circuit with three inputs whose output is 1 when the majority of inputs are 1.
- Inputs A, B, C; output F.
- Truth table: F = 1 for 011, 101, 110, 111, so F = ∑ m(3, 5, 6, 7).
- K-map: pairs (3, 7) = BC, (5, 7) = AC, (6, 7) = AB.
- F = AB + BC + AC: three 2-input AND gates and one 3-input OR gate.
Design a circuit that accepts a 3-bit number N = ABC and outputs N2 in binary.
- The largest square is 72 = 49 < 64, so 6 outputs B5 ldots B0 are needed.
- Truth table:
| N | A B C | N2 | B5 | B4 | B3 | B2 | B1 | B0 |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 0 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 1 | 0 0 1 | 1 | 0 | 0 | 0 | 0 | 0 | 1 |
| 2 | 0 1 0 | 4 | 0 | 0 | 0 | 1 | 0 | 0 |
| 3 | 0 1 1 | 9 | 0 | 0 | 1 | 0 | 0 | 1 |
| 4 | 1 0 0 | 16 | 0 | 1 | 0 | 0 | 0 | 0 |
| 5 | 1 0 1 | 25 | 0 | 1 | 1 | 0 | 0 | 1 |
| 6 | 1 1 0 | 36 | 1 | 0 | 0 | 1 | 0 | 0 |
| 7 | 1 1 1 | 49 | 1 | 1 | 0 | 0 | 0 | 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.
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
uses fewer gate inputs than its SOP form F = ACD + AB + BC'. To build any AND-OR multilevel circuit with NAND gates only:
- Draw the circuit with AND and OR gates.
- 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.
- 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 gates
Implement F = A(CD + B) + BC' with NAND gates.
- AND-OR structure: G1 = CD (AND), G2 = G1 + B (OR), G3 = A G2 (AND), G4 = BC' (AND), F = G3 + G4 (OR).
- 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.
- Check by De Morgan: (N3 N4)' = N3' + N4' = A(CD + B) + BC'.
5. Describing Combinational Circuits in Verilog
Verilog offers three styles. They all produce the same hardware:
| Style | Written with | Closest to | |
|---|---|---|---|
| Gate-level (structural) | gate primitives and, or, not and wires | the logic diagram | |
| Dataflow | assign with operators &, ` | , ~, ^` | the Boolean equation |
| Behavioural | always @(*) with if or case | the truth table or the specification |
The majority function in all three styles, with a testbench that compares them:
// 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
endmoduleAll three columns agree on every row:
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 1In 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.
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 @(*)).
📝 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)