By the end of this chapter you'll be able to…

  • 1State what makes a circuit combinational and why it equals a truth table
  • 2Write the half adder and full adder expressions
  • 3Recognise the full adder sum as parity and carry as majority
  • 4Build a full adder from two half adders and an OR gate
  • 5Build an adder-subtractor using XOR controlled inverters
  • 6Compute the gate delay of a ripple-carry adder
  • 7Define generate and propagate signals
  • 8Explain how carry lookahead achieves constant depth
  • 9State why fan-in forces hierarchical lookahead in practice
  • 10Describe the carry-select trade-off
  • 11Build an equality comparator from XNOR gates
  • 12Explain why the highest differing bit decides magnitude
  • 13Distinguish even and odd parity and state what a parity bit detects
  • 14Explain why each decoder output is a minterm
  • 15Cascade decoders using enable inputs
  • 16Explain why a plain encoder fails on simultaneous inputs
  • 17State the purpose of the valid output on a priority encoder
  • 18Implement an n-variable function on a multiplexer with n select lines
  • 19Implement an (n+1)-variable function on a multiplexer with n select lines
  • 20Explain why the residue can only be 0, 1, the variable or its complement
  • 21Compare PROM, PAL and PLA by which planes are programmable
  • 22Size a PLA on distinct terms and a PAL on the worst output
  • 23Distinguish static-1, static-0 and dynamic hazards
  • 24Remove a static hazard with a redundant consensus term
  • 25Explain when a hazard is harmless in a synchronous design
💡
Why this chapter matters in GATE
A circuit is combinational when its output depends only on its present inputs, with no memory of what came before. That single restriction means every combinational circuit is exactly a truth table, and the named blocks — adders, decoders, multiplexers — are simply truth tables that turned out to be worth building once and reusing everywhere. So the productive way to reason about a block is to ask what its table says rather than to trace its internal gates. The second organising fact is that two costs matter and they trade against each other: gate count and propagation delay. The ripple-carry adder and the carry-lookahead adder compute the same function, one small and slow, the other large and fast, and almost every design question in this chapter is a point on that trade-off. The third is that delay is not merely a performance concern, since unequal path delays produce hazards, and the fix is logic that is functionally redundant but temporally necessary.

Before you start — revise these

🔗
Boolean Algebra & K-maps
Minterms, minimisation and the consensus term are developed there, and hazard removal is the consensus term deliberately reintroduced.
🔗
Number Representation & Computer Arithmetic
Two's complement subtraction is what makes a single adder serve both operations, and overflow detection uses the adder's carry signals.

Combinational Circuits

A circuit is combinational when its output depends only on its present inputs, with no memory of what came before. That single restriction means every combinational circuit is exactly a truth table, and the named blocks — adders, decoders, multiplexers — are simply truth tables that turned out to be worth building once and reusing everywhere.

So the productive way to reason about a block is to ask what its table says, not to trace its internal gates. A 4-to-1 multiplexer selects one of four inputs; whether it is built from AND-OR logic or transmission gates changes nothing about how it behaves in a larger circuit.

The second organising fact is that two costs matter and they trade against each other: gate count and propagation delay. The ripple-carry adder and the carry-lookahead adder compute the same function; one is small and slow, the other large and fast. Almost every design question in this chapter is a point on that trade-off.

The third is that delay is not merely a performance concern. Unequal path delays inside a circuit produce hazards — momentary wrong outputs — and the fix is to add logic that is functionally redundant but temporally necessary.

1. Adders

The half adder adds two bits and produces a sum and a carry.

It cannot accept a carry from a lower position, which is why it is only ever used in the least significant stage, and often not even there.

The full adder accepts three inputs — two operand bits and a carry in.

The sum is the parity of the three inputs and the carry is the majority of them, which is the fastest way to remember both and to verify an answer.

A full adder can be built from two half adders plus one OR gate, which is a standard question: the first half adder combines and , the second combines that partial sum with , and the OR merges the two carries.

A subtractor is not a separate circuit. Two's complement arithmetic turns into , so an adder with XOR gates on the inputs and the carry-in tied to the same control line performs both operations: control 0 gives addition and control 1 gives subtraction.

That works because and , making the XOR a controlled inverter.

2. Carry Propagation

Chaining full adders gives a ripple-carry adder, in which each stage waits for the carry from the stage below.

The delay is proportional to , since the carry must ripple through every stage. With each full adder contributing two gate delays on the carry path, an -bit ripple-carry adder settles after about gate delays.

The carry-lookahead adder removes the dependence by computing all carries directly from the inputs. Each bit position produces two signals:

Generate means this position produces a carry regardless of what arrives; propagate means it passes along whatever arrives.

The carry recurrence unrolls into a flat expression:

Expanding it gives purely in terms of the and signals and , with no chaining. Every carry is then available after two gate delays — one for the AND terms and one for the OR.

The cost is fan-in. The expression for a high-order carry has many terms, and gate fan-in is bounded in real hardware, so lookahead is applied in blocks of four and the blocks are themselves chained or looked ahead over. That is why practical adders are hierarchical rather than flat.

The carry-select adder takes a different route: compute each block twice, once assuming a carry-in of 0 and once assuming 1, then select the right answer when the actual carry arrives. It buys speed with area rather than with fan-in.

3. Comparators and Parity

A magnitude comparator produces three outputs: greater than, equal to, and less than.

Equality is the exclusive-NOR of every bit pair, ANDed together, since two numbers are equal exactly when they agree in every position.

For magnitude, the comparison proceeds from the most significant bit downward: the first position where the numbers differ decides the result, and all lower positions are irrelevant. That is why a comparator's high-order logic dominates its delay.

A parity generator is a chain of XOR gates producing 1 when the number of 1s is odd. Even parity appends a bit making the total number of 1s even; odd parity makes it odd.

The checker is the same circuit applied to the transmitted word including its parity bit, and a non-zero result signals an error. A single parity bit detects any odd number of bit errors and no even number, which is why it detects single errors and misses double ones.

4. Decoders and Encoders

An -to- decoder asserts exactly one of its outputs, selected by the input lines.

Each output of a decoder is a minterm, which is why a decoder plus an OR gate implements any function directly: OR together the outputs corresponding to the function's minterms.

An enable input allows decoders to be cascaded. A 3-to-8 decoder can be built from two 2-to-4 decoders with the third input driving the enables, and larger structures follow the same pattern.

An encoder does the reverse, producing the binary index of an asserted input. A plain encoder misbehaves when two inputs are asserted at once, because it effectively ORs the two codes and produces a third, meaningless value.

A priority encoder fixes this by defining a precedence, outputting the index of the highest-priority asserted input and typically supplying a valid bit to distinguish "no input asserted" from "input zero asserted".

That valid output matters: without it, an all-zero output is ambiguous between the two cases, which is exactly the distinction interrupt-controller questions turn on.

5. Multiplexers

A -to-1 multiplexer routes one of data inputs to the output, chosen by select lines. A demultiplexer does the reverse, routing one input to one of several outputs.

A multiplexer with select lines implements any function of variables directly: connect the variables to the select lines and wire each data input to the constant 0 or 1 that the truth table requires.

The more useful result is the one that halves the size. A multiplexer with select lines can implement any function of variables. Connect variables to the select lines, and connect each data input to one of , , the remaining variable, or its complement.

The reason is that fixing the select variables leaves a function of one remaining variable, and a one-variable function can only be one of those four things.

For an example on three variables using a 4-to-1 multiplexer: put and on the selects, then for each of the four combinations examine the two rows of the truth table that share it and read off whether the output equals 0, 1, or .

A demultiplexer with its data input tied to 1 behaves exactly like a decoder, which is why the two are often the same physical part.

6. Programmable Logic

Programmable devices implement sum-of-products expressions with an AND plane feeding an OR plane, and they differ in which planes are programmable.

DeviceAND planeOR plane
PROMFixed (full decoder)Programmable
PALProgrammableFixed
PLAProgrammableProgrammable

A PROM generates every minterm, so it wastes hardware on a sparse function but requires no minimisation at all. Its AND plane is a full decoder, so an -input PROM has product lines whether they are needed or not.

A PLA is the most flexible and the most expensive, since both planes are programmable and product terms can be shared between several outputs. Sharing is the point: a term appearing in three output functions is implemented once.

A PAL sacrifices OR-plane flexibility for speed and cost. Each output has a fixed number of product terms available to it, so a function needing more terms than the part provides simply does not fit, and no sharing across outputs is possible.

The examinable consequence is a sizing question: given a set of functions, count the distinct product terms to size a PLA, and check the per-output term count to see whether a PAL suffices.

7. Hazards

A hazard is a momentary incorrect output caused by unequal delays along different paths, even though the circuit is logically correct.

A static-1 hazard occurs when an output that should remain at 1 momentarily dips to 0 during an input change. A static-0 hazard is the mirror case. A dynamic hazard is an output that changes more than once when it should change only once.

The cause is always the same shape. Two adjacent K-map groups cover the two input states involved, but no single group covers both, so during the transition one term switches off slightly before the other switches on.

The fix is to add a redundant product term covering the boundary between the two groups. That term is logically unnecessary — the function is unchanged — but it holds the output steady during the transition.

This is precisely the consensus term from Boolean algebra, and it is why consensus terms are deliberately reintroduced in hazard-free design after minimisation removed them.

Hazards matter only in circuits where the momentary glitch is observed. In a synchronous design where outputs are sampled only at a clock edge, a glitch that settles before the edge is harmless, which is one of the main arguments for synchronous design.

8. Worked Examples

Example 1. How many gate delays does an 8-bit ripple-carry adder take to settle, and how does a carry-lookahead adder compare?

In a ripple-carry adder each full adder produces its carry-out two gate levels after its carry-in arrives: one level for the AND terms and one for the OR.

With 8 stages, the final carry emerges after gate delays, and the most significant sum bit needs one more XOR level, so about 17 in total.

A carry-lookahead adder computes all and in one gate delay, since each is a single AND or XOR of the inputs.

Every carry is then a two-level sum-of-products in those signals, adding two more delays, so all carries are available after about 3 gate delays regardless of width. The sum bits need one further XOR.

The comparison is 17 delays against roughly 4, and the difference grows linearly with width — which is exactly why lookahead exists.

The price is fan-in: the expression for contains nine product terms, one with nine literals, which no real gate provides. This forces the hierarchical block structure used in practice.

Example 2. Implement using a 4-to-1 multiplexer.

A 4-to-1 multiplexer has two select lines, so it can implement a 3-variable function using the rule.

Put and on the select lines, leaving as the residue variable.

Now examine each select combination against the truth table.

covers minterms 0 and 1. Minterm 0 is in the list and 1 is not, so the output is 1 when and 0 when . That is .

covers minterms 2 and 3. Both are in the list, so the output is 1 regardless of . That is the constant 1.

covers minterms 4 and 5. Only 5 is in the list, and 5 has , so the output equals .

covers minterms 6 and 7. Neither is in the list, so the output is the constant 0.

Wire the four data inputs to , 1, and 0 respectively.

Note that the select lines must be connected in the right order: to the more significant select and to the less significant, matching how the minterm indices were formed.

Example 3. A combinational circuit implements . Identify the hazard and remove it.

Consider the input transition where and changes from 1 to 0.

Before the change, makes the term equal to 1, so . After the change, makes equal to 1, so again. The output should hold steady at 1.

But the two terms depend on through different paths. The term waits for the inverter on , while responds to directly. So falls before rises, and the output dips to 0 for the duration of the inverter delay.

That is a static-1 hazard.

The fix is to add the consensus term , giving .

The added term does not change the function — consensus terms are always redundant — but during the transition holds at 1 throughout, so the output never falls.

On the K-map, the two original groups are adjacent but not overlapping, and is precisely the group that bridges the boundary between them.

Example 4. How many 2-to-4 decoders with enable are needed to build a 4-to-16 decoder?

A 4-to-16 decoder has 16 outputs, and each 2-to-4 decoder supplies 4, so at least 4 decoders are needed for the outputs.

Those four must be selected between, one at a time, which requires a decoder driving their enable inputs. The two high-order address bits select which group of four is active, so a fifth 2-to-4 decoder drives the four enables.

The two low-order bits go to the data inputs of all four output decoders in parallel.

The total is 5 decoders.

The general pattern is worth extracting: building a larger decoder from smaller ones needs one extra decoder as the enable driver at each level, which is the same recursive structure that appears in memory address decoding.

Example 5. A set of four Boolean functions of five variables shares 12 distinct product terms among them, with the largest single function needing 5 terms. Would a PAL with 4 product terms per output suffice, and what does a PLA require?

The PAL question is decided per output, not in total. Its OR plane is fixed, so each output has a fixed allocation of product terms and nothing can be borrowed from another output.

The largest function needs 5 terms and the part supplies 4, so it does not fit. The function would have to be split across two outputs and recombined externally, or a larger PAL chosen.

The PLA question is decided in total, because its programmable OR plane lets any product term feed any output. Twelve distinct terms are needed, so a PLA with at least 12 product lines and at least 5 inputs and 4 outputs suffices.

The comparison is the whole point of the device family: a PLA sizes on distinct terms across all outputs, a PAL sizes on the worst single output, and a PROM ignores both and simply provides all 32 minterms of a 5-variable input.

Example 6. Show that a full adder can be built from two half adders and one OR gate, and verify the carry expression.

The first half adder takes and , producing and .

The second half adder takes and , producing , which is the required sum, and .

The final carry is , produced by one OR gate.

Verify this equals the majority function. When exactly two of the three inputs are 1, the sum should be 0 and the carry 1.

Take , , : so , and . Correct.

Take , , : but so and , with sum . Correct.

The structure also explains the two-gate-delay carry path that sets the ripple-carry adder's timing: the carry passes through one AND and one OR at each stage.

Summary

A combinational circuit is a truth table, so reason about a block from what it does rather than from how it is built.

The half adder gives sum as XOR and carry as AND; the full adder gives sum as the parity and carry as the majority of its three inputs.

A subtractor is an adder with XOR controlled inverters on one operand and the same control tied to the carry-in.

Ripple carry costs about gate delays. Carry lookahead computes generate and propagate signals and produces every carry in constant depth, at the price of fan-in, which is why practical adders are hierarchical.

Equality is the XNOR of every bit pair ANDed together; magnitude comparison is decided by the highest differing bit.

Each decoder output is a minterm, so a decoder plus an OR gate implements any function. Enable inputs allow cascading, and a larger decoder needs one extra decoder to drive the enables.

A plain encoder breaks on simultaneous inputs; a priority encoder resolves them and needs a valid bit to distinguish no input from input zero.

A multiplexer with select lines implements any function of variables, with each data input tied to 0, 1, the residue variable, or its complement.

PROM has a fixed AND plane, PAL a fixed OR plane, and PLA neither. A PLA sizes on distinct terms overall; a PAL sizes on the worst single output.

Hazards come from unequal path delays; the cure is the redundant consensus term bridging two adjacent K-map groups, and in a synchronous design a glitch that settles before the clock edge is harmless.

Key formulas & results

Everything to memorise for the exam hall, in one card. Screenshot this for revision.

The organising tool
EVERY COMBINATIONAL CIRCUIT IS EXACTLY A TRUTH TABLE. THE NAMED BLOCKS ARE TRUTH TABLES THAT TURNED OUT TO BE WORTH BUILDING ONCE AND REUSING.
ASK WHAT A BLOCK'S TABLE SAYS RATHER THAN TRACING ITS INTERNAL GATES. HOW IT IS BUILT CHANGES NOTHING ABOUT HOW IT BEHAVES IN A LARGER CIRCUIT.
The two costs
GATE COUNT AND PROPAGATION DELAY TRADE AGAINST EACH OTHER, AND ALMOST EVERY DESIGN QUESTION IS A POINT ON THAT TRADE-OFF.
THE RIPPLE-CARRY AND CARRY-LOOKAHEAD ADDERS COMPUTE THE SAME FUNCTION; ONE IS SMALL AND SLOW, THE OTHER LARGE AND FAST.
Half adder
S = A XOR B, AND C = A AND B.
IT CANNOT ACCEPT A CARRY FROM A LOWER POSITION, WHICH IS WHY IT IS ONLY EVER USED IN THE LEAST SIGNIFICANT STAGE.
Full adder
S = A XOR B XOR C_in, AND C_out = AB + C_in TIMES (A XOR B).
THE SUM IS THE PARITY OF THE THREE INPUTS AND THE CARRY IS THE MAJORITY OF THEM, WHICH IS THE FASTEST WAY TO REMEMBER AND VERIFY BOTH.
Full adder from half adders
TWO HALF ADDERS PLUS ONE OR GATE: THE FIRST COMBINES A AND B, THE SECOND COMBINES THAT PARTIAL SUM WITH C_in, AND THE OR MERGES THE TWO CARRIES.
THE CARRY PATH PASSES THROUGH ONE AND AND ONE OR AT EACH STAGE, WHICH IS EXACTLY THE TWO-GATE DELAY THAT SETS RIPPLE-CARRY TIMING.
Adder-subtractor
PUT XOR GATES ON THE B INPUTS AND TIE THE CARRY-IN TO THE SAME CONTROL LINE. CONTROL 0 GIVES ADDITION AND CONTROL 1 GIVES SUBTRACTION.
IT WORKS BECAUSE B XOR 0 = B AND B XOR 1 = NOT-B, MAKING THE XOR A CONTROLLED INVERTER, AND A MINUS B IS A PLUS NOT-B PLUS 1.
Ripple-carry delay
THE DELAY IS PROPORTIONAL TO n, AT ABOUT 2n GATE DELAYS FOR AN n-BIT ADDER, PLUS ONE MORE XOR LEVEL FOR THE TOP SUM BIT.
EACH STAGE WAITS FOR THE CARRY FROM THE STAGE BELOW, AND EACH FULL ADDER CONTRIBUTES TWO GATE DELAYS ON THAT CARRY PATH.
Generate and propagate
G_i = A_i AND B_i, AND P_i = A_i XOR B_i.
GENERATE MEANS THIS POSITION PRODUCES A CARRY REGARDLESS OF WHAT ARRIVES; PROPAGATE MEANS IT PASSES ALONG WHATEVER ARRIVES.
Carry lookahead
C_(i+1) = G_i + P_i TIMES C_i, WHICH UNROLLS INTO A FLAT EXPRESSION IN THE G AND P SIGNALS AND C_0 ONLY.
EVERY CARRY IS THEN AVAILABLE AFTER TWO GATE DELAYS, ONE FOR THE AND TERMS AND ONE FOR THE OR, REGARDLESS OF ADDER WIDTH.
Why lookahead is hierarchical
THE EXPRESSION FOR A HIGH-ORDER CARRY HAS MANY TERMS AND GATE FAN-IN IS BOUNDED, SO LOOKAHEAD IS APPLIED IN BLOCKS OF FOUR AND THE BLOCKS ARE THEMSELVES LOOKED AHEAD OVER.
THE CARRY-SELECT ADDER TAKES A DIFFERENT ROUTE, COMPUTING EACH BLOCK TWICE FOR BOTH POSSIBLE CARRY-INS AND SELECTING WHEN THE REAL CARRY ARRIVES.
Comparators
EQUALITY IS THE XNOR OF EVERY BIT PAIR, ANDED TOGETHER. MAGNITUDE IS DECIDED BY THE HIGHEST POSITION WHERE THE NUMBERS DIFFER.
ALL LOWER POSITIONS ARE IRRELEVANT ONCE A DIFFERENCE IS FOUND, WHICH IS WHY A COMPARATOR'S HIGH-ORDER LOGIC DOMINATES ITS DELAY.
Parity
EVEN PARITY APPENDS A BIT MAKING THE TOTAL NUMBER OF ONES EVEN; ODD PARITY MAKES IT ODD. THE GENERATOR IS A CHAIN OF XOR GATES.
A SINGLE PARITY BIT DETECTS ANY ODD NUMBER OF BIT ERRORS AND NO EVEN NUMBER, WHICH IS WHY IT CATCHES SINGLE ERRORS AND MISSES DOUBLE ONES.
Decoders
AN n-TO-2^n DECODER ASSERTS EXACTLY ONE OUTPUT, AND EACH OUTPUT IS A MINTERM.
A DECODER PLUS AN OR GATE IMPLEMENTS ANY FUNCTION DIRECTLY: OR TOGETHER THE OUTPUTS CORRESPONDING TO THE FUNCTION'S MINTERMS.
Cascading decoders
AN ENABLE INPUT ALLOWS DECODERS TO BE CASCADED, WITH ONE EXTRA DECODER DRIVING THE ENABLES OF THE OTHERS.
A 4-TO-16 DECODER NEEDS FOUR 2-TO-4 DECODERS FOR THE OUTPUTS PLUS A FIFTH TO DRIVE THEIR ENABLES, WHICH IS THE SAME PATTERN AS MEMORY ADDRESS DECODING.
Encoders and priority
AN ENCODER PRODUCES THE BINARY INDEX OF AN ASSERTED INPUT, BUT MISBEHAVES WHEN TWO ARE ASSERTED, EFFECTIVELY ORING THE CODES INTO A MEANINGLESS THIRD VALUE.
A PRIORITY ENCODER DEFINES A PRECEDENCE AND SUPPLIES A VALID BIT, WITHOUT WHICH AN ALL-ZERO OUTPUT IS AMBIGUOUS BETWEEN NO INPUT AND INPUT ZERO.
Multiplexer as function generator
A MULTIPLEXER WITH n SELECT LINES IMPLEMENTS ANY FUNCTION OF n VARIABLES BY WIRING EACH DATA INPUT TO THE CONSTANT THE TRUTH TABLE REQUIRES.
MORE USEFULLY, IT IMPLEMENTS ANY FUNCTION OF n PLUS 1 VARIABLES, WITH EACH DATA INPUT TIED TO 0, 1, THE REMAINING VARIABLE, OR ITS COMPLEMENT.
Why the residue has four cases
FIXING THE n SELECT VARIABLES LEAVES A FUNCTION OF ONE REMAINING VARIABLE, AND A ONE-VARIABLE FUNCTION CAN ONLY BE 0, 1, THE VARIABLE, OR ITS COMPLEMENT.
CONNECT THE SELECT LINES IN THE RIGHT ORDER, MATCHING HOW THE MINTERM INDICES WERE FORMED, OR THE DATA ASSIGNMENTS WILL BE PERMUTED.
Demultiplexer as decoder
A DEMULTIPLEXER WITH ITS DATA INPUT TIED TO 1 BEHAVES EXACTLY LIKE A DECODER.
THIS IS WHY THE TWO ARE OFTEN THE SAME PHYSICAL PART, WITH THE DATA INPUT SERVING AS AN ENABLE.
Programmable logic families
PROM HAS A FIXED AND PLANE, WHICH IS A FULL DECODER, AND A PROGRAMMABLE OR PLANE. PAL HAS A PROGRAMMABLE AND PLANE AND A FIXED OR PLANE. PLA HAS BOTH PROGRAMMABLE.
A PROM GENERATES EVERY MINTERM AND NEEDS NO MINIMISATION BUT WASTES HARDWARE ON A SPARSE FUNCTION. A PLA IS THE MOST FLEXIBLE AND EXPENSIVE.
Sizing programmable logic
A PLA SIZES ON THE NUMBER OF DISTINCT PRODUCT TERMS ACROSS ALL OUTPUTS, SINCE TERMS CAN BE SHARED. A PAL SIZES ON THE WORST SINGLE OUTPUT, SINCE NOTHING CAN BE BORROWED.
A FUNCTION NEEDING MORE TERMS THAN A PAL PROVIDES PER OUTPUT SIMPLY DOES NOT FIT, HOWEVER MUCH SPARE CAPACITY OTHER OUTPUTS HAVE.
Hazards
A STATIC-1 HAZARD IS AN OUTPUT THAT SHOULD STAY AT 1 MOMENTARILY DIPPING TO 0; STATIC-0 IS THE MIRROR CASE; A DYNAMIC HAZARD CHANGES MORE THAN ONCE WHEN IT SHOULD CHANGE ONCE.
THE CAUSE IS ALWAYS TWO ADJACENT K-MAP GROUPS COVERING THE TWO INPUT STATES WITH NO SINGLE GROUP COVERING BOTH.
Hazard removal
ADD A REDUNDANT PRODUCT TERM COVERING THE BOUNDARY BETWEEN THE TWO ADJACENT GROUPS. THIS IS EXACTLY THE CONSENSUS TERM.
THE TERM IS LOGICALLY UNNECESSARY BUT HOLDS THE OUTPUT STEADY DURING THE TRANSITION, WHICH IS WHY CONSENSUS TERMS ARE REINTRODUCED AFTER MINIMISATION.
When hazards are harmless
IN A SYNCHRONOUS DESIGN WHERE OUTPUTS ARE SAMPLED ONLY AT A CLOCK EDGE, A GLITCH THAT SETTLES BEFORE THE EDGE IS HARMLESS.
THIS IS ONE OF THE MAIN ARGUMENTS FOR SYNCHRONOUS DESIGN, AND IT IS WHY HAZARD ANALYSIS MATTERS MOST IN ASYNCHRONOUS AND LEVEL-SENSITIVE LOGIC.
⚠️

Traps GATE sets — and how to dodge them

These are the exact option-traps and misreads that cost marks under negative marking.

WATCH OUT
Writing the full adder carry as AB plus C-in alone
The carry is AB + C_in times (A XOR B), which is the majority of the three inputs. Checking against the majority rule catches this immediately, since two ones out of three must produce a carry.
WATCH OUT
Designing a separate subtractor circuit
Two's complement makes A minus B equal to A plus not-B plus 1, so XOR gates on the B inputs with the control tied to the carry-in give one circuit that does both operations.
WATCH OUT
Assuming carry lookahead makes an adder constant-delay at any width
The flat carry expression needs gates with fan-in growing with position, which real hardware does not provide. Practical designs apply lookahead in blocks and chain the blocks, so the delay grows logarithmically rather than staying constant.
WATCH OUT
Computing ripple-carry delay as one gate per stage
Each full adder contributes two gate delays on the carry path, one AND level and one OR level. An 8-bit ripple-carry adder settles after about 16 delays on the carry plus one more XOR for the top sum bit.
WATCH OUT
Using a plain encoder where several inputs may be active
A plain encoder effectively ORs the codes of all asserted inputs and produces a meaningless third value. A priority encoder is required whenever simultaneous assertion is possible, as it is in any interrupt controller.
WATCH OUT
Omitting the valid output on a priority encoder
Without it, an all-zero output cannot be distinguished between no input asserted and input zero asserted. The valid bit is what makes the encoding unambiguous.
WATCH OUT
Believing a multiplexer with n selects handles only n variables
It handles n plus 1. Fixing the n select variables leaves a function of a single residue variable, which can only be 0, 1, that variable or its complement, and any of the four can be wired to a data input.
WATCH OUT
Connecting multiplexer select lines in the wrong order
The most significant select must correspond to the most significant variable in the minterm indexing used to build the data table. Swapping them permutes the data assignments and silently implements a different function.
WATCH OUT
Sizing a PAL on the total number of product terms
A PAL has a fixed OR plane, so each output has its own allocation and nothing can be shared. Size on the single output needing the most terms, not on the total across outputs.
WATCH OUT
Sizing a PLA per output rather than in total
A PLA's programmable OR plane lets any product term feed any output, so a term appearing in three functions is implemented once. Size on the number of distinct terms across all outputs.
WATCH OUT
Assuming a PROM needs minimisation
Its AND plane is a full decoder generating every minterm, so the function is programmed directly from its truth table. It wastes hardware on sparse functions but requires no simplification at all.
WATCH OUT
Treating a hazard as a logic error
The circuit is logically correct; the glitch comes from unequal path delays. The fix is not to redo the minimisation but to add back a redundant term that minimisation had removed.
WATCH OUT
Removing consensus terms in a circuit that must be hazard-free
Consensus terms are exactly the ones that bridge adjacent K-map groups. Minimisation removes them because they are logically redundant, and hazard-free design reintroduces them because they are temporally necessary.
WATCH OUT
Worrying about hazards in a fully synchronous design
If outputs are sampled only at clock edges and the glitch settles within the clock period, it has no effect. Hazard analysis matters for asynchronous logic, level-sensitive latches and asynchronous resets.

Exam-pattern practice

PYQ-style questions with full solutions. Work through them as a readiness check — mark yourself honestly and get your gap report at the end.

Readiness check

Are you exam-ready for Combinational Circuits?

9 problems from this chapter. Try each one, reveal the worked solution, mark yourself honestly — get your gap report at the end.

9 questions~6 min

5-minute revision

The whole chapter, distilled. Read this the night before the exam.

  • A combinational circuit is exactly a truth table.
  • Gate count and delay trade against each other.
  • Half adder sum is XOR, carry is AND.
  • Full adder sum is the parity of three inputs.
  • Full adder carry is the majority of three inputs.
  • Two half adders plus an OR make a full adder.
  • The carry path is two gate delays per stage.
  • A subtractor is an adder with XOR controlled inverters.
  • B XOR 1 inverts; B XOR 0 passes through.
  • Ripple carry takes about 2n gate delays.
  • Generate is A AND B; propagate is A XOR B.
  • Carry lookahead unrolls the recurrence into a flat expression.
  • All lookahead carries arrive in about three gate delays.
  • Fan-in forces lookahead into hierarchical blocks.
  • Carry-select computes both cases and picks one.
  • Equality is XNOR of every bit pair, ANDed.
  • The highest differing bit decides magnitude.
  • A parity bit detects odd numbers of errors only.
  • Each decoder output is a minterm.
  • A decoder plus OR implements any function.
  • Enables allow decoders to cascade.
  • A larger decoder needs one extra decoder for enables.
  • A plain encoder breaks on simultaneous inputs.
  • A priority encoder needs a valid output.
  • A MUX with n selects implements n+1 variables.
  • Data inputs are 0, 1, the residue variable or its complement.
  • Select-line order must match the minterm indexing.
  • A demultiplexer with data tied to 1 is a decoder.
  • PROM has a fixed AND plane and needs no minimisation.
  • PAL has a fixed OR plane and cannot share terms.
  • PLA has both planes programmable and shares terms.
  • Size a PLA on distinct terms in total.
  • Size a PAL on the worst single output.
  • A static-1 hazard dips to 0 momentarily.
  • Hazards come from unequal path delays.
  • The cure is a redundant consensus term.
  • Consensus terms bridge adjacent K-map groups.
  • A glitch settling before the clock edge is harmless.

GATE question blueprint

How this topic is asked, tier by tier — so you can prep to the pattern.

Typical weightage: Digital Logic contributes roughly 6-8 of the 72 core-CS marks; combinational circuits supply 2-3 of those across 1-2 questions

Question styleMarks eachTypical countWhat it tests
Adders1~1Half and full adder expressions and construction from half adders
Carry lookahead2~1Generate and propagate signals, unrolled carries and delay comparison
Decoders1~1Minterm outputs, enable cascading and counting parts
Multiplexers2~1Implementing an (n+1)-variable function and residue assignment
Programmable logic2~1Which planes are programmable and sizing a PLA against a PAL
Hazards2~1Identifying a static hazard and adding the consensus term
Comparators and parity1~1Equality logic, the deciding bit for magnitude and parity detection limits

Exam-hall strategy

Battle-tested tips from mentors and toppers for this topic under the sectional clock.

  1. Identify the block by what its truth table does before tracing any gates.
  2. For adder delay questions, count two gate delays per ripple stage.
  3. For multiplexer implementation, group the truth table by the select variables and read off the residue.
  4. Check select-line ordering against the minterm indexing before assigning data inputs.
  5. For PLA sizing count distinct terms; for PAL sizing check the worst output.
  6. For hazard questions, find the single-variable transition that moves between two product terms.
  7. Adder delay and decoder counts are commonly set as NAT, which carries no negative marking, so never leave one blank.
  8. For 1-mark and 2-mark MCQs, negative marking is -1/3 and -2/3, so guess only after eliminating an option.
  9. GATE gives a single freely-navigable 180-minute window, so flag a long multi-level delay calculation and return to it.

Beyond the exam

Where this skill shows up in the job you're competing for — and in life.

Choosing an adder for a datapath

The ripple-versus-lookahead trade-off is the actual decision made when a processor's ALU is designed, balancing cycle time against area.

Decoding a memory address

High-order address bits driving chip enables while low-order bits select a location is exactly the cascaded-decoder structure from this chapter.

Building an interrupt controller

A priority encoder with a valid output is what turns several simultaneous interrupt requests into one unambiguous vector.

Fitting glue logic into a programmable part

Counting distinct product terms for a PLA and worst-output terms for a PAL is the sizing calculation done before choosing a device.

Where else this topic is tested

Prepare once, score in every exam that asks it.

GATE EC and EEVery high overlap — adders, decoders, multiplexers and programmable logic are examined identically across engineering GATE papers
UGC NET Computer ScienceHigh overlap — multiplexer function implementation and decoder counts are examined as direct recall
ISRO / BARC / DRDO computer science papersVery high overlap — carry-lookahead delay, PLA versus PAL sizing and hazard removal are recurring MCQ topics

Questions aspirants ask

Pulled from the Q&A community and mentor sessions.

Because a carry out means the three input bits sum to at least two, and that is precisely the majority condition. Writing the truth table makes it obvious: the carry is 1 for the input combinations 011, 101, 110 and 111, which are exactly the rows with two or more ones. The usual algebraic form AB + C_in times (A XOR B) is the same function written to share the XOR term with the sum, which saves a gate. The other common form AB + BC + AC is the direct majority expression and is equally correct. This matters practically for two reasons. First, it gives a fast check on any answer: whenever two of three inputs are 1, the carry must be 1 and the sum must be 0; whenever all three are 1, both are 1. Any candidate expression can be tested against those two rows in seconds. Second, it pairs with the observation that the sum is the parity of the three inputs, so the whole full adder is remembered as parity and majority rather than as two expressions to memorise. That pairing carries over to the counter-based view used in multiplier design, where a full adder is described as a three-to-two compressor: it takes three bits of equal weight and produces two bits, one of the same weight and one of the next weight up.

Because the flat expression demands gate fan-in that hardware does not provide. Unrolling the recurrence gives the carry out of position i as a sum of i plus 1 product terms, and the longest of those products has i plus 1 literals. For a 16-bit adder, the top carry needs a 17-input OR gate fed by AND gates with up to 17 inputs. Real CMOS gates are practical up to about four inputs; beyond that, series transistor stacks slow down so much that the supposed constant depth is lost in the transistor-level delay, and the gate area grows quadratically. The standard resolution is hierarchy. Lookahead is applied within blocks of four bits, where fan-in stays reasonable, and each block also produces block-level generate and propagate signals describing whether the whole block generates or propagates a carry. Those block signals then feed a second level of lookahead across blocks, and so on. The result is delay proportional to the logarithm of the width rather than constant, which is still a large improvement over the linear ripple-carry delay. The worked example in this chapter shows a simpler hybrid where four lookahead blocks are chained by ripple carry, giving about ten gate delays for sixteen bits against thirty-three for pure ripple, at a fraction of the fan-in cost of a flat design.

Because fixing the select variables reduces the function to a function of whatever variables remain, and if exactly one remains, there are only four possibilities for it. Suppose the function has variables A, B and C, and A and B are connected to the two select lines of a 4-to-1 multiplexer. For each of the four combinations of A and B, the truth table has two rows, distinguished only by the value of C. Comparing the outputs in those two rows gives one of four cases: both 0, so the data input is the constant 0; both 1, so it is the constant 1; output matching C, so the data input is C; or output opposite to C, so it is the complement of C. Every one of those four is available as a wire, which is why no extra gates are needed beyond a single inverter for the complement. The technique extends. A multiplexer with n selects can in principle handle n plus 2 variables if the residue functions of two variables happen to be simple, but in general the residues then require gates and the method loses its appeal. Two practical cautions apply. The select lines must be connected in the order matching how the minterm indices were formed, since swapping them permutes the data assignments and silently implements a different function. And the residue variable must be the one left off the selects consistently throughout the table construction.

By asking how dense the functions are, whether terms are shared, and how much flexibility is worth paying for. A PROM has a fixed AND plane that is a complete decoder, so it generates all 2^n minterms whether the function needs them or not, and only the OR plane is programmed. That makes it the right choice when the function is dense, when n is small, or when no minimisation is wanted, since the truth table is programmed directly. It is wasteful for a sparse function of many variables, because the hardware cost is exponential in the input count regardless of how few minterms are used. A PLA programs both planes, so it implements exactly the product terms required and can share a term between several outputs. That makes it the right choice when several functions share terms, and its sizing is the number of distinct terms across all outputs. It is the most expensive per unit because both planes need programmable connections. A PAL programs only the AND plane and hard-wires each output to a fixed number of product terms. It is cheaper and faster than a PLA because a fixed OR plane has no programmable elements in the signal path, but it cannot share terms and it imposes a hard per-output limit. The examinable consequence is the sizing rule: count distinct terms in total for a PLA, and check the worst single output against the per-output limit for a PAL.

Because a momentary wrong value can be captured by whatever is downstream, and once captured it is indistinguishable from a genuine value. The circuit is logically correct in the sense that after all signals settle the output is right; the problem is entirely about the interval before settling. Consider F = AC + not-A B with B and C both held at 1 while A falls. The term AC responds to A immediately, while not-A B waits for an inverter, so for the duration of that inverter delay neither term is asserted and the output dips to 0 even though it should hold at 1. If that output feeds the clock input of a flip-flop, the glitch is a spurious clock edge. If it feeds an asynchronous set or reset, the glitch sets state that was never intended. If it drives an SR latch or any level-sensitive element, the latch may capture the wrong value permanently. The cure is to add the consensus term BC, which is held at 1 throughout the transition and keeps the output steady. It is logically redundant, which is exactly why minimisation removed it, and temporally necessary, which is why hazard-free design puts it back. The important qualification is that in a fully synchronous design where every output is sampled only at a clock edge, a glitch that settles within the clock period is invisible and no consensus term is needed. That guarantee is one of the strongest arguments for synchronous design, and it is why hazard analysis concentrates on asynchronous logic, latch enables and asynchronous resets.
Header Logo