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 inputs and outputs is described by Boolean functions of variables, that is a truth table with rows and 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.
- Specify the inputs, the outputs and what each output must be. Choose the number of bits and the coding.
- Build the truth table. Mark input combinations that can never occur as don't cares for every output.
- 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.
- 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.
- 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 needs 4 AND gates and a 4-input OR (8 literals) while 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: , 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 so that the total number of 1s including is even. A parity checker XORs all the received bits including ; 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 for the digit (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 are a BCD digit (0 to 9), outputs are the 4-bit binary code of .
| digit | ABCD | wxyz |
|---|---|---|
| 0 | 0000 | 0011 |
| 1 | 0001 | 0100 |
| 2 | 0010 | 0101 |
| 3 | 0011 | 0110 |
| 4 | 0100 | 0111 |
| 5 | 0101 | 1000 |
| 6 | 0110 | 1001 |
| 7 | 0111 | 1010 |
| 8 | 1000 | 1011 |
| 9 | 1001 | 1100 |
For rows 10 to 15 all outputs are don't care. The animation minimises output (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\CD | 00 | 01 | 11 | 10 |
|---|---|---|---|---|
| 00 | 00 | 11 | 13 | 12 |
| 01 | 14 | 05 | 07 | 06 |
| 11 | X12 | X13 | X15 | X14 |
| 10 | 08 | 19 | X11 | X10 |
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).
The four minimised outputs, each with the six don't cares used, are
The C program below implements exactly these equations and checks them against for all ten digits.
Worked examples
EX 1Analyse a circuit: majority of three
EasyA circuit has three AND gates computing , , feeding a 3-input OR gate. The output is .
Step 1 (truth table). is 1 on 011, 101, 110, 111, that is when at least two inputs are 1: the majority function. .
Step 2 (another form). The animation shows that the product-of-sums gives the same table.
Majority of three: SOP and POS agree
Computed exactly, not typed| A | B | C | AB | BC | AC | AB+BC+AC | (A+B)(B+C)(A+C) |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | · | · | · | · | · |
| 0 | 0 | 1 | · | · | · | · | · |
| 0 | 1 | 0 | · | · | · | · | · |
| 0 | 1 | 1 | · | · | · | · | · |
| 1 | 0 | 0 | · | · | · | · | · |
| 1 | 0 | 1 | · | · | · | · | · |
| 1 | 1 | 0 | · | · | · | · | · |
| 1 | 1 | 1 | · | · | · | · | · |
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.
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 rowsStep 1. Output is the lowest bit of , which is the complement of the lowest bit of : .
Step 2. Output is 1 for digits 0, 3, 4, 7, 8, which are the codes where : (an XNOR).
Step 3. For and use the maps (the animation above shows ). The don't cares at 10 to 15 let be as simple as .
Cost. In sum-of-products form the outputs need 3, 3, 2 and 0 product terms (z is just an inverter). The inverters for , and can be shared by all outputs.
EX 3Parity generator and checker
MediumGenerator. Three data bits and the even-parity bit . 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 gates for 3 inputs.
Checker. The receiver computes ( gates). for a correct word and if one bit (or any odd number of bits) is flipped. It cannot detect two flipped bits.
The program above confirms equals the parity of the number of ones.
EX 4Factoring saves gates
Mediumin sum of products form needs 4 AND gates and one 4-input OR gate (8 literals). Factor it: . 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 levelAssume 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 can be built as a chain with 3 XORs on the critical path (6 ns), or as a balanced tree with 2 XORs on the critical path (4 ns). Both use 3 gates, but the tree is faster. For inputs the tree has levels against for the chain.
EX 6Shared terms across outputs
GATE levelTwo outputs and share the term . Building 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. inputs, outputs: functions of 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 . Parity XOR of all bits; an -input tree has gates and levels.
- BCD to excess-3: , , , (codes 1010 to 1111 are don't cares).
- Even-parity bit ; one flipped bit is detected, two are not.
Traps and GATE patterns
Connections
Across subjects
No cross-subject links yet.
Within this subject
Journeys that pass through here
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
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
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 answerHide
gates and levels.
Question 2
A circuit outputs 1 when exactly two of three inputs are 1. What is the minimal SOP?
Show answerHide
The output is 1 on 011, 101, 110: . 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 ?
Show answerHide
, so . Check with the equations: with gives 1; ; ; .
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 answerHide
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 ; parity is an XOR tree ( gates, levels).
- BCD to excess-3: , , , .
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
My notes (saved in this browser)