G27
Self-checkedTier 1 14 min readdl.combinational-design

Design of combinational circuits

What makes a circuit combinational, how to analyse one and how to design one from a specification: truth table, don't cares, minimisation, shared terms across outputs, cost and delay, and two-level versus factored forms.

Why it exists

All the earlier pages of this subject are tools: Boolean algebra to rewrite, K-maps to minimise, gates to build. A design procedure puts them in order so that any specification, from "add two bits" to "convert a BCD digit to excess-3", ends in a correct, cheap circuit. The reverse, the analysis procedure, takes a circuit and finds what it computes, and is the usual form of a GATE question: "what does this circuit do", "how many gates", "what is the delay". The adders, multiplexers and decoders in the next pages are all instances of this procedure.

Prerequisites

You need K-map minimisation from Karnaugh maps and the NAND/NOR conversions from logic gates.

Precise definitions

Combinational circuit. A network of gates with no feedback and no memory. Every output is a Boolean function of the present inputs only. (A circuit whose outputs also depend on past inputs is sequential; it needs flip-flops.) A circuit with nn inputs and mm outputs is described by mm Boolean functions of nn variables, that is a truth table with 2n2^n rows and mm output columns.

Analysis procedure. (1) Label the gate outputs. (2) Write the Boolean function at each gate output, working from the inputs to the outputs. (3) Substitute to obtain each output as a function of the inputs, or simply compute the truth table row by row. (4) Describe the function (for example "majority", "parity", "adder").

Design procedure.

  1. Specify the inputs, the outputs and what each output must be. Choose the number of bits and the coding.
  2. Build the truth table. Mark input combinations that can never occur as don't cares for every output.
  3. Minimise each output (K-map for up to 4 or 5 variables, tabular method beyond), using the don't cares. Look for terms shared between outputs: a product term used by two outputs is built once, which can lower the total cost even if one output is no longer minimal alone.
  4. Implement with the required gate type (AND-OR, NAND-NAND, NOR-NOR, or a mix) and check the fan-in and the number of inverters.
  5. Verify by simulation or by recomputing the truth table of the final circuit.

Cost. The usual measures are the number of gates, the number of gate inputs (equal to literals plus the number of terms in a two-level circuit), and the number of levels. Unless the question says otherwise, inverters on inputs are counted as gates only when the complemented inputs are not available. Many GATE questions say "using only 2-input gates", which turns the cost into a gate count of a tree.

Delay. The propagation delay of a gate is the time from an input change to the output change. The delay of a circuit is the sum of the gate delays along its critical path, the longest path from any input to any output. Levels are only a proxy: gates differ (an XOR is slower than a NAND).

Two-level and multi-level. A two-level circuit (AND-OR, NAND-NAND, and so on) has the smallest delay but may be large. Factoring (using the distributive law to share work) gives a multi-level circuit with fewer gates and more delay. For example AC+AD+BC+BDAC + AD + BC + BD needs 4 AND gates and a 4-input OR (8 literals) while (A+B)(C+D)(A + B)(C + D) needs 2 OR gates and 1 AND gate (4 literals), at the same two-level depth in this example (OR-AND instead of AND-OR).

Standard functions worth knowing.

  • Majority of three: M=AB+BC+AC=(A+B)(B+C)(A+C)M = AB + BC + AC = (A+B)(B+C)(A+C), 1 when at least two inputs are 1 (this is the carry of a full adder).
  • Parity: the XOR of all inputs. An even-parity generator produces a bit P=A⊕B⊕CP = A \oplus B \oplus C so that the total number of 1s including PP is even. A parity checker XORs all the received bits including PP; the output 1 signals an error (a single bit flip).
  • Code converters, for example BCD to excess-3: the output is the 4-bit binary code of d+3d + 3 for the digit dd (0 to 9). The six codes 1010 to 1111 never occur as BCD input and are don't cares.

How it works

Follow one complete design. BCD to excess-3. Inputs ABCDA B C D are a BCD digit (0 to 9), outputs wxyzw x y z are the 4-bit binary code of d+3d + 3.

digitABCDwxyz
000000011
100010100
200100101
300110110
401000111
501011000
601101001
701111010
810001011
910011100

For rows 10 to 15 all outputs are don't care. The animation minimises output xx (ones at digits 1, 2, 3, 4, 9).

BCD to excess-3, output x (digits 1, 2, 3, 4, 9 give x = 1; codes 10 to 15 never occur): Fill in the map

Exact minimiser, not typed
AB\CD00011110
0000111312
0114050706
11X12X13X15X14
100819X11X10

Small number = minterm index. X = don't care. Row and column labels are in Gray-code order.

Groups so far (product terms)

None yet.

Step 1

A BCD digit is 0 to 9, so the six input codes 1010 to 1111 can never occur and are don't cares. Output x is the second bit of digit plus 3: it is 1 for the digits 1, 2, 3, 4 (sums 4 to 7) and 9 (sum 12).

1 / 5
computed by script: exact integer, Fraction and truth-table evaluation (IEEE 754 patterns via Python struct where used), not typed by hand. python3 scripts/gen-dl-traces.py

The four minimised outputs, each with the six don't cares used, are

w=A+BC+BD,x=B′C+B′D+BC′D′,y=CD+C′D′,z=D′.w = A + BC + BD,\quad x = B'C + B'D + BC'D',\quad y = CD + C'D',\quad z = D'.

The C program below implements exactly these equations and checks them against d+3d + 3 for all ten digits.

Worked examples

EX 1Analyse a circuit: majority of three

Easy

A circuit has three AND gates computing ABAB, BCBC, ACAC feeding a 3-input OR gate. The output is F=AB+BC+ACF = AB + BC + AC.

Step 1 (truth table). FF is 1 on 011, 101, 110, 111, that is when at least two inputs are 1: the majority function. F=∑m(3,5,6,7)F = \sum m(3,5,6,7).

Step 2 (another form). The animation shows that the product-of-sums (A+B)(B+C)(A+C)(A+B)(B+C)(A+C) gives the same table.

Majority of three: SOP and POS agree

Computed exactly, not typed
ABCABBCACAB+BC+AC(A+B)(B+C)(A+C)
000·····
001·····
010·····
011·····
100·····
101·····
110·····
111·····

Step 0

Claim: the output is 1 when at least two of the three inputs are 1, whether you write it as an OR of ANDs or as an AND of ORs.

0 / 9
computed by script: exact integer, Fraction and truth-table evaluation (IEEE 754 patterns via Python struct where used), not typed by hand. python3 scripts/gen-dl-traces.py

Cost. 3 AND gates plus 1 OR gate, 4 gates and 9 gate inputs; 2 levels.

EX 2Design BCD to excess-3

Medium
#include <stdio.h>
 
/* BCD digit (A B C D, A most significant) to excess-3 (w x y z) with the minimised equations */
static unsigned excess3(int a, int b, int c, int d) {
    int w = a || (b && d) || (b && c);
    int x = (!b && d) || (!b && c) || (b && !c && !d);
    int y = (!c && !d) || (c && d);
    int z = !d;
    return (unsigned)(w << 3 | x << 2 | y << 1 | z);
}
 
int main(void) {
    int wrong = 0;
    for (int digit = 0; digit < 10; digit++) {
        unsigned code = excess3((digit >> 3) & 1, (digit >> 2) & 1, (digit >> 1) & 1, digit & 1);
        printf("%d -> %u%u%u%u\n", digit, (code >> 3) & 1, (code >> 2) & 1, (code >> 1) & 1, code & 1);
        wrong += code != (unsigned)(digit + 3);
    }
    printf("rows different from digit + 3: %d\n", wrong);
    int maj_bad = 0, par_bad = 0, fac_bad = 0;
    for (int i = 0; i < 8; i++) {
        int a = (i >> 2) & 1, b = (i >> 1) & 1, c = i & 1;
        maj_bad += ((a && b) || (b && c) || (a && c)) != (a + b + c >= 2);
        par_bad += (a ^ b ^ c) != ((a + b + c) % 2);
    }
    for (int i = 0; i < 16; i++) {
        int a = (i >> 3) & 1, b = (i >> 2) & 1, c = (i >> 1) & 1, d = i & 1;
        fac_bad += ((a && c) || (a && d) || (b && c) || (b && d)) != ((a || b) && (c || d));
    }
    printf("majority wrong on %d rows, parity wrong on %d rows, factoring wrong on %d rows\n", maj_bad, par_bad, fac_bad);
    return 0;
}
0 -> 0011
1 -> 0100
2 -> 0101
3 -> 0110
4 -> 0111
5 -> 1000
6 -> 1001
7 -> 1010
8 -> 1011
9 -> 1100
rows different from digit + 3: 0
majority wrong on 0 rows, parity wrong on 0 rows, factoring wrong on 0 rows

Step 1. Output zz is the lowest bit of d+3d + 3, which is the complement of the lowest bit of dd: z=D′z = D'.

Step 2. Output yy is 1 for digits 0, 3, 4, 7, 8, which are the codes where C=DC = D: y=CD+C′D′y = CD + C'D' (an XNOR).

Step 3. For xx and ww use the maps (the animation above shows xx). The don't cares at 10 to 15 let ww be as simple as A+BC+BDA + BC + BD.

Cost. In sum-of-products form the outputs w,x,y,zw, x, y, z need 3, 3, 2 and 0 product terms (z is just an inverter). The inverters for B′B', C′C' and D′D' can be shared by all outputs.

EX 3Parity generator and checker

Medium

Generator. Three data bits A,B,CA, B, C and the even-parity bit P=A⊕B⊕CP = A \oplus B \oplus C. For data 101 the parity bit is 0, and the word 1010 has an even number (two) of ones. With 2-input XOR gates in a tree you need 3−1=23 - 1 = 2 gates for 3 inputs.

Checker. The receiver computes E=A⊕B⊕C⊕PE = A \oplus B \oplus C \oplus P (33 gates). E=0E = 0 for a correct word and E=1E = 1 if one bit (or any odd number of bits) is flipped. It cannot detect two flipped bits.

The program above confirms A⊕B⊕CA \oplus B \oplus C equals the parity of the number of ones.

EX 4Factoring saves gates

Medium

F=AC+AD+BC+BDF = AC + AD + BC + BD in sum of products form needs 4 AND gates and one 4-input OR gate (8 literals). Factor it: F=(A+B)(C+D)F = (A + B)(C + D). That needs 2 OR gates and 1 AND gate, 3 gates and 4 literals. The program confirms the two forms agree on all 16 rows. The SOP form is already minimal as a sum of products (4 terms, 8 literals, the K-map has no larger groups), so the saving comes from leaving the two-level SOP form.

EX 5Critical path and delay

GATE level

Assume each 2-input NAND, AND or OR gate has delay 1 ns and each 2-input XOR gate 2 ns (illustrative figures, not a convention). The four-input parity A⊕B⊕C⊕DA \oplus B \oplus C \oplus D can be built as a chain ((A⊕B)⊕C)⊕D((A \oplus B) \oplus C) \oplus D with 3 XORs on the critical path (6 ns), or as a balanced tree (A⊕B)⊕(C⊕D)(A \oplus B) \oplus (C \oplus D) with 2 XORs on the critical path (4 ns). Both use 3 gates, but the tree is faster. For nn inputs the tree has ⌈log⁡2n⌉\lceil \log_2 n \rceil levels against n−1n - 1 for the chain.

EX 6Shared terms across outputs

GATE level

Two outputs F1=AB+CF_1 = AB + C and F2=AB+DF_2 = AB + D share the term ABAB. Building ABAB once (one AND gate) and using it in two OR gates gives 3 gates. Building each output separately gives 4 gates (two AND, two OR). Always check the cost with the sharing the question allows.

Cheat box

Cheat box

  • Combinational: no memory, no feedback. nn inputs, mm outputs: mm functions of nn variables.
  • Design: specify, truth table (mark don't cares), minimise (K-map), implement, verify.
  • Analysis: label gate outputs, write expressions, build the truth table.
  • Cost: gates, gate inputs (literals), levels. Delay = sum of gate delays on the critical path.
  • Two-level is fastest but may be large; factoring trades delay for gates. Share common terms between outputs.
  • Majority =AB+BC+AC= AB + BC + AC. Parity == XOR of all bits; an nn-input tree has n−1n-1 gates and ⌈log⁡2n⌉\lceil \log_2 n \rceil levels.
  • BCD to excess-3: w=A+BC+BDw = A + BC + BD, x=B′C+B′D+BC′D′x = B'C + B'D + BC'D', y=CD+C′D′y = CD + C'D', z=D′z = D' (codes 1010 to 1111 are don't cares).
  • Even-parity bit P=A⊕B⊕CP = A \oplus B \oplus C; one flipped bit is detected, two are not.

Traps and GATE patterns

Connections

The adder circuits in adders and subtractors are the first complete designs from this procedure; multiplexers and decoders are standard building blocks that can implement any function. A ROM or a PLA is a table-driven way to build many outputs at once (ROM, PLA and PAL). Glitches in two-level circuits are the topic of hazards. When the output must also depend on history, the circuit becomes sequential: flip-flops.

PYQs

2 previous year questions from your book. I re-solved each one myself (2 by running or simulating, 0 by reasoning only); the book's key is shown next to my answer. All PYQs

GATE 2007 · MCQ · 1 markQ17 · page 177 of the book
The line in the following figure is permanently
connected to the ground.

Which of the following inputs (X1 X2 X3 X4)
will detect the fault?
  • (a)0000
  • (b)0111
  • (c)1111
  • (d)None of these
GATE 2006 · MCQ · 1 markQ20 · page 177 of the book
The majority function is a Boolean function
f(x,y,z)that takes the value 1 whenever a majority of
the variables x, y, z are 1. In the circuit diagram for

DIGITAL LOGIC
the majority function shown below, the logic gates
for the boxes  labeled P and Q are, respectively.
  • (a)XOR, AND
  • (b)XOR, XOR
  • (c)OR, OR
  • (d)OR, AND

Self-check

Question 1

How many 2-input XOR gates and how many levels does a 7-input parity generator need as a balanced tree?

Show answer

7−1=67 - 1 = 6 gates and ⌈log⁡27⌉=3\lceil \log_2 7 \rceil = 3 levels.

Question 2

A circuit outputs 1 when exactly two of three inputs are 1. What is the minimal SOP?

Show answer

The output is 1 on 011, 101, 110: F=A′BC+AB′C+ABC′F = A'BC + AB'C + ABC'. No two of these are adjacent on the map (each differs from another in two bits), so no term can be merged: 3 terms of 3 literals.

Question 3

BCD digit 7 is applied to the BCD to excess-3 converter. What are w,x,y,zw, x, y, z?

Show answer

7+3=10=10107 + 3 = 10 = 1010, so w=1,x=0,y=1,z=0w = 1, x = 0, y = 1, z = 0. Check with the equations: w=A+BC+BDw = A + BC + BD with B=C=D=1B = C = D = 1 gives 1; x=B′C+B′D+BC′D′=0x = B'C + B'D + BC'D' = 0; y=CD+C′D′=1y = CD + C'D' = 1; z=D′=0z = D' = 0.

Question 4

Even parity is used. The received 5-bit word is 10110 (4 data bits and the parity bit last). Is an error detected?

Show answer

The word has three 1s, an odd number, so the XOR of all five bits is 1: an error is detected.

Revision card

One-screen revision

  • Combinational = outputs depend on present inputs only. Design: truth table, don't cares, K-map, gates, verify.
  • Share product terms across outputs; factor to save gates, at the cost of levels.
  • Delay = sum of gate delays on the critical path; a balanced tree beats a chain.
  • Majority =AB+BC+AC= AB + BC + AC; parity is an XOR tree (n−1n-1 gates, ⌈log⁡2n⌉\lceil \log_2 n \rceil levels).
  • BCD to excess-3: z=D′z = D', y=CD+C′D′y = CD + C'D', w=A+BC+BDw = A + BC + BD, x=B′C+B′D+BC′D′x = B'C + B'D + BC'D'.

References

  • ·Mano and Ciletti, Digital Design, 5th ed., Chapter 4 Combinational Logic (analysis procedure, design procedure, code converters)
  • ·Kohavi and Jha, Switching and Finite Automata Theory, Chapters on combinational network design

Verification

The excess-3 equations are produced by the exact minimiser (all four outputs have a unique minimal SOP with the six unused BCD codes as don't cares) and are checked in scripts/enum-checks/dl_forms.py, in tests/dl-traces.test.ts (the K-map animation) and by the C program (npm run verify:c). Majority, parity and factoring identities are checked over all rows. Gate delay figures are illustrative assumptions stated in the examples, not GATE conventions. Textbook chapter titles are from memory; the independent second pass has not been run, so the page stays draft. SECOND PASS (2026-11-02, done by the assistant, not a human check): every Self-check question was solved before the printed answer was read and all agreed; the definitions, worked examples, cheat box and traps were read claim by claim and the numbers re-derived by hand or by a small script (conversions, signed ranges and flags, IEEE 754 fields and custom formats, Boolean identities and counts, K-map groups, adder carries, BCD correction, flip-flop conversions, counter sequences and T equations, state reduction, Quine-McCluskey rounds and covers, floating-point alignment and rounding); long C programs were not re-read line by line (they are compiled and compared by npm run verify:c, and their printed outputs were checked against the prose); tables and animations are machine output and were read, not re-run; No other defect found. Status raised to self-checked; verified needs a textbook or human check.

last verified: never