Combinational Logic Circuits

Learn how digital hardware computes results from its present inputs alone. Analyze gate diagrams and design circuits from a specification, then build the standard blocks of digital systems: half and full adders, ripple-carry and carry-lookahead adders, adder-subtractors with overflow detection, BCD adders, code converters, magnitude comparators, decoders, encoders, multiplexers and demultiplexers. Finish with timing: propagation and contamination delay, critical paths, and the glitches that unequal delays cause and how to remove them.

BeginnerLesson 3 of 7 in Digital Logic Design Course

What you will learn

  1. Explain what makes a circuit combinational, work out what a given gate diagram computes, and turn a word specification into a checked circuit, including converters between binary codes.
    • Work out what a gate diagram computes
      Recognize a combinational circuit and derive its output functions and truth table from a gate-level diagram, step by step.
    • Design a circuit from a word specification
      Follow the design procedure from a problem statement to a truth table, simplified expressions, a gate diagram and a final check.
    • Convert between binary codes
      Design code converters for BCD, excess-3 and Gray code, using unused input patterns as don't-cares or with a standard adder block.
  2. Build half adders, full adders and ripple-carry adders, extend them to two's complement subtraction with carry and overflow flags, and correct binary sums for decimal (BCD) digits.
    • Build half adders and full adders
      Derive the sum and carry functions for adding two or three bits, build a full adder from half adders, and describe the matching subtractor cells.
    • Add multi-bit numbers with a ripple-carry adder
      Chain full adders into an n-bit adder, trace the carries through an example, read the carry-out, and estimate how the carry chain sets the delay.
    • Subtract with two's complement and detect overflow
      Use one adder and a row of XOR gates to add or subtract, and interpret the carry flag for unsigned numbers and the overflow flag for signed numbers.
    • Add decimal digits with a BCD adder
      Add two BCD digits with a binary adder, detect when the binary sum needs correcting, add 6, and chain digit stages.
  3. Use generate and propagate signals to compute carries in parallel, and compare the delay and hardware cost of ripple-carry, lookahead and other fast adders.
    • Compute carries in parallel with generate and propagate
      Define generate and propagate, expand the carry equations for a 4-bit group, trace a full example, and form group signals for a block.
    • Compare adder delays and build wide fast adders
      Estimate the delay of block carry-lookahead adders with a simple gate-delay model, and describe multilevel lookahead, prefix and carry-select adders and their trade-offs.
  4. Design magnitude comparators, decoders and encoders, connect them into larger blocks, and use decoders to implement Boolean functions.
    • Compare two binary numbers
      Design equality and magnitude comparators bit by bit, cascade them for wider numbers, and compare by subtraction, including signed numbers.
    • Decode a binary code into separate lines
      Explain decoders with enable and active-low signals, build larger decoders from smaller ones, and implement functions with a decoder and OR gates.
    • Encode active lines as a binary code, with priority
      Design simple and priority encoders, explain why a valid output is needed, and read truth tables that use don't-care inputs.
  5. Select and distribute data with multiplexers, demultiplexers and three-state buffers, and use multiplexers to implement any Boolean function.
    • Select one of several inputs with a multiplexer
      Describe 2-to-1, 4-to-1 and wider multiplexers, build them from smaller ones, and share a wire safely with three-state buffers.
    • Implement Boolean functions with multiplexers
      Use a multiplexer as a lookup table, and implement an n-variable function with a smaller multiplexer by feeding data inputs with 0, 1, a variable or its complement.
    • Distribute one input with a demultiplexer
      Explain how a demultiplexer routes one signal to a selected output, why a decoder with enable is a demultiplexer, and how multiplexer-demultiplexer pairs share one line.
  6. Calculate propagation and contamination delays along the paths of a circuit, find the critical path, and explain, predict and remove glitches.
    • Find propagation delay, contamination delay and the critical path
      Add gate delays along paths, identify the longest and shortest paths, read a timing diagram, and explain what affects and limits circuit speed.
    • Explain, predict and remove glitches
      Explain how unequal path delays cause glitches, trace a glitch through a timing example, remove it with a consensus term, and judge when glitches matter.

Combinational Logic Circuits study guide

6 chapters

1

Analyze and design combinational circuits

A gate diagram, a truth table, and a Boolean expression can describe the same computation. Moving between them lets you discover what an existing circuit does and build a circuit that meets a new specification. You will name intermediate signals, verify a design against its intended behavior, and apply the same process to code converters. Code words need careful interpretation: identical bits can mean different values in different codes.

1.1 Work out what a gate diagram computes

A combinational circuit computes from its present inputs. After the gates settle, repeating an input combination repeats the output. It has no stored history. A sequential circuit also depends on stored values, held in elements such as latches or flip-flops.

Check the connections first

A network is guaranteed to be combinational when its gates are combinational, each internal node has exactly one gate driving it, and no path loops back through the gates. A signal may feed several gate inputs; that is shared use of one signal, not several outputs driving one wire. Feedback can store a value or cause oscillation, so a gate-only drawing still needs this check.

Name each intermediate result

Start at gates connected directly to circuit inputs. Name their outputs, then move forward until you reach the circuit outputs. Write each gate's operation before substituting earlier expressions. This keeps a shared signal visible and prevents the same gate from being counted twice.

For a circuit with inputs A,B,C, suppose the connections give:

T1=A⊕B,T2=AB,T3=T1C F=T1⊕C,G=T2+T3

Substitution gives F=A⊕B⊕C and G=AB+(A⊕B)C. The symbol + means OR inside a Boolean expression; juxtaposition means AND. A prime means complement, and an overbar is another common way to show that complement.

Follow the same signals in a truth table

With three inputs, list all eight combinations in binary order. Compute the intermediate columns before the outputs.

ABCT₁T₂T₃FG
00000000
00100010
01010010
01110101
10010010
10110101
11001001
11101011

For input 101, the first XOR gives 1, the second gives 0, and the carry branches give 0 and 1. Thus GF=10. The table shows that F is odd parity and G is the majority function. Together they form a full adder: the binary number GF equals the arithmetic total of the three input bits.

A function need not have a familiar block name. Its output expressions or complete truth table still specify exactly what it computes. For larger diagrams, use the known behavior of blocks such as adders and muxes to avoid expanding every gate.

Keep bubbles attached to their operations

A bubble means inversion at that location. A NAND output is (AB)′. De Morgan's law gives (AB)′=A′+B′, not A′B′. For input 10, the NAND gives 1 while A′B′ gives 0. A single check row can expose this lost inversion before it spreads through the rest of the analysis.

Key Takeaways

  • Settled outputs depend only on present inputs.
  • Name intermediate gate outputs and work toward the circuit outputs.
  • A truth table has one row for every input combination.
  • Keep each inversion attached to the gate or input it modifies.

1.2 Design a circuit from a word specification

Design starts with a behavior you want, then turns that behavior into gates. The truth table is the link: it states what the outputs must do before you choose an implementation.

Turn words into a precise table

Name every input and output. Decide what 1 means, identify the most significant bit of each word, and resolve any cases where the requirement is unclear. For an active-low input, the asserted state is 0; its name and symbol must make that meaning visible.

Consider three judges with inputs A,B,C, where 1 means “pass.” The result M must be 1 when at least two judges vote to pass. The successful rows are 011, 101, 110, and 111. With A as the most significant input, those are minterms 3, 5, 6, and 7:

M=A′BC+AB′C+ABC′+ABC

The all-1 row belongs in the table: “at least two” includes three. Missing that row would implement “exactly two,” a different specification.

Simplify and choose the gates

Boolean OR is idempotent: X+X=X. You may therefore reuse ABC while combining terms:

A′BC+ABC=BC AB′C+ABC=AC ABC′+ABC=AB

The result is M=AB+AC+BC. Three 2-input AND gates form the pairwise agreements, and one 3-input OR gate combines them. The direct minterm circuit instead needs four 3-input AND gates and a 4-input OR gate.

Implementation choices depend on the available gates, area, and delay. An AND-OR sum of products can be expressed as a NAND-NAND network using De Morgan's law. Count gate inputs and levels as well as gates: a smaller gate count does not by itself tell you the longest path delay.

Use don't-cares only where the specification allows them

An X in an output column means that either output value is acceptable for that input combination. You can choose 0 or 1 to simplify the circuit. It is a design freedom, not a third logic value that the circuit must produce.

An input pattern that is excluded by the system can be a don't-care. If the system must detect or respond to that pattern, it needs a specified output instead. When reviewing a don't-care row, determine what the implementation actually produces and check that this behavior is permitted.

Share work and build in blocks

Several outputs may share intermediate terms. For X=AB+C and Y=AB+D, a single AND gate can supply AB to both OR gates. There is no need to build the common term twice.

A truth table grows quickly: two 8-bit operands mean 16 input bits and 65,536 rows. Hierarchical design makes that scale manageable. Design and verify a small slice, then connect copies, or use standard adders, comparators, decoders, and muxes.

Verify both the table and the diagram

Analyze the finished diagram and compare its output with the table. For a small circuit, check every specified row. For the voter, 101 must pass and 100 must fail. Also check the table against the original words: a diagram can match an incorrect table perfectly. Verification must catch an error in either translation.

Key Takeaways

  • Define signal meanings and bit order before filling the truth table.
  • Convert the specified 1-rows into minterms, then simplify.
  • An output X allows either 0 or 1 for that row.
  • Shared terms and repeated blocks reduce duplicated hardware.
  • Verify the truth table against the words and the circuit against the table.

1.3 Convert between binary codes

A code converter changes how information is represented without changing the information itself. Before writing its truth table, identify the input code and the output code. Four bits do not always represent an ordinary binary number.

Keep decimal digits separate in BCD

Binary-coded decimal, or BCD, uses the 8421 binary weights for each decimal digit. Thus decimal 47 is 0100 0111: one group for 4 and one for 7. Ordinary binary represents 47 as 101111. These are two encodings of the same number.

A single BCD digit has ten valid words, 0000 through 1001. The six words 1010 through 1111 are invalid digits. They are don't-cares only when the converter is allowed to receive valid digits alone. If invalid inputs need reporting, add an error signal. With inputs ABCD, A the MSB:

E=A(B+C)

This detects 1010–1111 while leaving 1000 and 1001 valid, because their B and C bits are both 0.

Convert BCD to excess-3

Excess-3 represents digit d with the binary value d+3. Digit 0 becomes 0011; digit 9 becomes 1100. A 4-bit adder with its second operand fixed at 0011 performs the conversion directly.

A gate implementation can use the invalid BCD rows as don't-cares. For inputs ABCD and outputs wxyz, one resulting set of functions is:

z=D′,y=CD+C′D′ x=B′C+B′D+BC′D′,w=A+BC+BD

For digit 5, the input is 0101. Then z=0, y=0, x=0, and w=1, producing 1000. Its ordinary binary value is 8, which equals 5+3. These equations need to be correct on the ten valid rows; their output on an invalid row is not an excess-3 representation of a decimal digit.

Excess-3 is self-complementing. Inverting the code for digit d gives the code for 9−d. For example, digit 2 has code 0101. Its complement, 1010, encodes digit 7. This is a property of the digit code, not ordinary two's complement negation.

Convert binary to Gray code

Adjacent words in reflected Gray code differ in one bit. The 3-bit order is 000, 001, 011, 010, 110, 111, 101, 100. A position sensor using this order changes only one bit between adjacent positions, reducing ambiguity at a transition.

Copy the binary MSB, then XOR neighboring binary bits:

Gn−1=Bn−1,Gi=Bi+1⊕Bi

For binary 1011, copy 1, then compute 1⊕0=1, 0⊕1=1, and 1⊕1=0. The Gray word is 1110. An n-bit converter needs n−1 XOR gates because the MSB is a direct connection.

Recover binary from Gray

The reverse conversion uses the binary bit just recovered:

Bn−1=Gn−1,Bi=Bi+1⊕Gi

For Gray 1110, the recovered bits are 1, then 1⊕1=0, then 0⊕1=1, then 1⊕0=1. The result is 1011.

Do not XOR neighboring Gray bits independently. That would give 1001 for this example. In the forward direction, each XOR reads the original binary word. In the reverse direction, each XOR depends on the binary result immediately to its left.

Key Takeaways

  • BCD encodes each decimal digit in a separate 4-bit group.
  • Excess-3 encodes a digit by adding 3 to its value.
  • Complementing an excess-3 word gives the code for the complementary decimal digit.
  • Binary-to-Gray conversion XORs neighboring binary bits.
  • Gray-to-binary conversion uses the binary bit already recovered.
  • Invalid BCD inputs need an error output when they must be detected.
2

Add and subtract binary numbers with adder circuits

Addition hardware starts with a cell that handles one bit position. Connecting those cells gives a word adder; changing the second operand and the initial carry lets the same hardware subtract. You will trace the carries, distinguish unsigned carry from signed overflow, and adapt binary addition to decimal digits. The output bits alone are not enough: their interpretation depends on the number representation and the flags that accompany them.

2.1 Build half adders and full adders

An adder separates a total into a bit for the current column and a carry for the next one. For one-bit inputs, the output pair is a two-bit binary number with the carry on the left.

Add two bits with a half adder

A half adder has inputs A,B, sum S, and carry C:

S=A⊕B,C=AB
ABCarrySum
0000
0101
1001
1110

One XOR and one AND gate implement it. The XOR matters in the last row: adding two 1s gives binary 10. OR would incorrectly leave the sum bit at 1.

Include an incoming carry

A full adder also accepts Cin from the lower column. Its outputs satisfy the arithmetic identity 2Cout+S=A+B+Cin, where the right side is an ordinary numerical total.

S=A⊕B⊕Cin Cout=AB+ACin+BCin

The sum is 1 for an odd number of 1-inputs. The carry is 1 for at least two 1-inputs. These are different questions: a single 1 makes the sum 1 but cannot make a carry. Replacing the carry function with an OR of all inputs would fail on every row containing exactly one 1.

With inputs 111, the total is 3, so carry and sum are both 1. With inputs 101, the total is 2, so carry is 1 and sum is 0. The output ordering is CoutS, not SCout.

Build a full adder from half adders

First add A and B, giving intermediate sum T=A⊕B and carry AB. Add T and Cin in the second half adder. Its sum is the final S, and its carry is TCin. OR the two carry outputs:

Cout=AB+(A⊕B)Cin

The carries cannot both be 1: AB=1 makes A⊕B=0. This implementation uses two XOR gates, two AND gates, and one OR gate. The majority carry form can instead use three AND gates and an OR, placing the carry logic in two levels after its inputs are available.

Account for a borrow in subtraction

A half subtractor computes one column of A−B:

D=A⊕B,Bout=A′B

A borrow is needed for 0−1. Borrowing one unit from the next column supplies two units in this column, leaving difference 1 and borrow-out 1.

A full subtractor also subtracts a borrow-in:

D=A⊕B⊕Bin Bout=A′B+A′Bin+BBin

Its numerical check is A−B−Bin=D−2Bout. For inputs A=0,B=1,Bin=0, the outputs are D=1,Bout=1, and −1=1−2. The difference XOR resembles an adder's sum XOR, but the borrow function differs from the carry function. Multi-bit subtraction is usually built with an adder and two's complement.

Key Takeaways

  • A half adder adds two bits; a full adder includes a carry-in.
  • The full-adder sum is odd parity; its carry is the majority function.
  • Two half adders and one OR gate form a full adder.
  • A subtractor borrows when the current column cannot supply the amount subtracted.

2.2 Add multi-bit numbers with a ripple-carry adder

A ripple-carry adder joins one full adder per bit position. Each cell computes a sum bit and passes its carry to the next cell, so a wide addition is built from repeated one-bit work.

Connect the columns in order

Stage i receives Ai,Bi,Ci and produces Si,Ci+1. Bit 0 is the least significant bit, written on the right of the word. Set C0=0 for ordinary addition. The final carry Cn sits one place to the left of the n sum bits.

A half adder can handle bit 0 when the incoming carry is permanently zero. Full adders at every stage give a uniform design that also supports a carry-in and can be connected to another adder block.

Trace a four-bit addition

Add 0110 (6) and 0111 (7), with initial carry 0. Work from right to left while keeping the bit indices in view.

StageInput-bit totalSum bitCarry to next stage
00 + 1 + 0 = 110
11 + 1 + 0 = 201
21 + 1 + 1 = 311
30 + 0 + 1 = 110

Reading S3S2S1S0 gives 1101, or 13. The carry generated at stage 1 contributes to stage 2; it is not written as an extra sum bit at stage 1.

For unsigned addition, keep the final carry if the full numerical result is needed. Adding 1011 (11) and 0110 (6) gives sum bits 0001 and C4=1. The complete result is 10001 (17). Reading only 0001 gives the result modulo 16 and loses the overflow beyond four bits.

Understand why the carry must ripple

Real gates take time. A high sum bit may depend on a carry that has not yet arrived from below. In 1111 + 0001, the low column generates a carry and every higher column passes it onward. The sum wires can show intermediate values while this chain settles.

A simple worst-case estimate for an n-bit ripple adder is:

tripple≈n tFA

Here tFA is the full-adder carry-path delay used by the estimate. With 150 ps per stage, 32 bits take about 4800 ps, or 4.8 ns; 64 bits take about 9.6 ns. A detailed gate analysis can distinguish carry and sum paths, but this estimate shows the central scaling: doubling the word length roughly doubles the delay.

Assemble wider blocks

Two 4-bit blocks make an 8-bit adder when the lower block's carry-out feeds the upper block's carry-in. Both operands must be split consistently: low bits enter the low block, high bits enter the high block. The blocks may compute local signals together, but the upper result still waits for its incoming carry.

Ripple carry is regular and small, about five gates per bit in the two-half-adder construction. For narrow words, its simplicity is useful. For wide words, the carry chain becomes a timing bottleneck, which motivates computing carries through lookahead logic.

Key Takeaways

  • Pass each stage’s carry to the next more significant stage.
  • Read the sum bits from MSB to LSB after tracing from the LSB upward.
  • For unsigned addition, carry-out extends the result by one bit.
  • The worst-case ripple delay grows in proportion to word length.
  • Cascading adder blocks preserves the same carry dependency.

2.3 Subtract with two's complement and detect overflow

An adder can subtract by changing the bits it receives. The resulting bit pattern supports either unsigned or signed arithmetic, but the meaning of its flags depends on which interpretation you use.

Make subtraction an addition

For an n-bit word, two's complement negation inverts every bit and adds 1. Four-bit two's complement has range −8 through 7 because the MSB has weight −8. The subtraction identity is:

A−B=A+B′+1

A mode signal M drives an XOR on each B input and also the initial carry. When M=0, the XORs pass B and the carry-in is 0, giving addition. When M=1, the XORs invert B and the carry-in is 1, giving subtraction. Forgetting that final 1 would compute A−B−1.

For 0110 − 0011, invert 0011 to 1100. Then 0110+1100+1=1 0011. Keep the four result bits 0011 and record carry-out 1 separately.

Read carry for unsigned arithmetic
OperationMeaning of carry-out
Unsigned addition1 means the total exceeds the word's range.
Unsigned subtraction using complement-and-add1 means no borrow; 0 means a borrow.

For 0011 − 0110, 0011+1001+1=1101 with carry-out 0. As unsigned operands, 3 is smaller than 6 and a borrow is required. The four result bits represent 3−6+16=13 modulo 16. As two's complement, the same 1101 is −3.

Detect signed overflow

Signed overflow occurs when the mathematical result is outside the two's complement range. Adding opposite signs cannot overflow. Adding equal signs can overflow when the result's sign changes. Subtracting opposite signs can overflow as well.

The hardware rule works for both modes:

V=Cn⊕Cn−1

These are the carry out of and the carry into the MSB stage, taken from the adder itself. For 0101+0100, the bit result is 1001. The carry into the sign stage is 1 and the carry out is 0, so V=1. The true result 9 is outside −8 through 7; interpreting 1001 as −7 would be wrong.

In contrast, 1100+1101=1 1001 represents −4+(−3)=−7. Both sign-stage carries are 1, so V=0 despite carry-out 1. Carry-out alone cannot diagnose signed overflow.

Check subtraction at the signed boundary

For 0111−1111, the signed calculation is 7−(−1)=8. The adder computes 0111+0000+1=1000. Its sign-stage carries are 1 and 0, so overflow is correctly reported.

The same carry rule handles subtracting the most negative value. With 0000−1000, the adder actually receives 0000+0111+1 and produces 1000 with overflow. The result +8 cannot fit. There is no need to form a separately representable positive version of −8 before doing the subtraction.

Key Takeaways

  • A mode-controlled XOR bank and carry-in let one adder add or subtract.
  • In complement-and-add unsigned subtraction, carry-out 1 means no borrow.
  • Signed overflow is the XOR of the carries into and out of the sign stage.
  • Carry-out and signed overflow answer different range questions.
  • The adder’s carry-based overflow test also works at the most-negative operand.

2.4 Add decimal digits with a BCD adder

A binary adder can produce totals that are not valid BCD digits. A BCD adder corrects those totals so that each 4-bit output group again represents one decimal digit.

Detect when the sum needs correction

Add the two valid digits and the incoming decimal carry with a 4-bit binary adder. Call its carry K and its low sum bits Z8Z4Z2Z1, named for their weights. The total can range from 0 through 19.

Totals 0–9 are already correct. Totals 10–19 require adding 6 to the low four bits and sending a decimal carry to the next digit. Adding 6 skips the six unused BCD words. For a total between 10 and 15, the low result after correction is total+6−16=total−10.

The correction signal is:

C=K+Z8Z4+Z8Z2

The carry K detects totals 16–19. The other terms detect low sums 10–15. Testing Z8 alone would also correct 8 and 9, which are already valid digits. Testing only the low sum would miss 16–19 because their low four bits look like 0–3.

Use a second adder

A second 4-bit adder adds 0CC0 to the low sum. This is 0110 when correction is needed and 0000 otherwise. The decimal carry is C itself, not the carry-out of this second adder.

For 8 + 5, the binary total is 01101, giving K=0 and Z=1101. Since Z8Z4=1, correction is required. Adding 0110 gives 1101+0110=1 0011. The BCD digit is 0011 (3), and decimal carry 1 supplies the tens digit.

For 9 + 9 + 1, the total is 10011. Now K=1 and Z=0011, so C=1 even though the low bits look like a valid digit. Correction gives 0011+0110=1001, digit 9. This second addition has no carry-out, yet the decimal carry is still 1 and the result is 19.

Chain digits with decimal carries

For 47 + 38, work on the units first. The units total 7+8=15 gives digit 5 and carry 1. The tens stage adds 4+3+1=8, giving digit 8 with no further carry. The BCD result is 1000 0101, or 85.

Treating the entire BCD word as one ordinary binary operand fails: pure binary addition of 0100 0111 and 0011 1000 gives 0111 1111, which contains an invalid low digit. Each decimal digit needs its own correction stage and its own carry connection.

Key Takeaways

  • Correct a digit whenever the binary total exceeds 9.
  • The correction signal includes both the binary carry and invalid low-digit patterns.
  • Add 0110 when correction is needed.
  • Pass the correction signal itself as the decimal carry.
3

Speed up addition with carry lookahead

A ripple adder waits for carries to move through one bit after another. Carry lookahead shortens that dependency by describing when each position generates a carry or passes one onward. The same idea works on groups of bits, allowing wider adders to compute carries through blocks or trees. You will derive the equations, follow a complete addition, and compare speed with the extra gates and wiring needed to obtain it.

3.1 Compute carries in parallel with generate and propagate

Carry lookahead changes how carries are computed, not the arithmetic result. It starts by expressing each stage's behavior with two signals that can be calculated before the incoming carry arrives.

Describe generate and propagate

For bit i, define:

Gi=AiBi,Pi=Ai⊕Bi

Generate is 1 when both operand bits are 1. That stage produces a carry even with carry-in 0. Propagate is 1 when exactly one operand bit is 1. Then an incoming carry becomes an outgoing carry. If both bits are 0, neither signal is 1 and the outgoing carry is 0.

The carry and sum rules are:

Ci+1=Gi+PiCi,Si=Pi⊕Ci

Used stage by stage, the carry rule still describes ripple carry. Lookahead comes from replacing each intermediate carry with its own expression.

Expand the chain

Substitute the equation for C1 into the equation for C2, then continue:

C1=G0+P0C0 C2=G1+P1G0+P1P0C0 C3=G2+P2G1+P2P1G0+P2P1P0C0 C4=G3+P3G2+P3P2G1+P3P2P1G0+P3P2P1P0C0

Each product describes a carry source and every stage it must pass. For example, P3P2G1 means bit 1 generates and bits 2 and 3 propagate. It does not need P1, because the carry is created at bit 1.

If the required multi-input gates are available, all these expressions have one AND level and one OR level after the bit signals. Count one level for generating P,G and one final XOR for the sum: about four gate delays for a 4-bit sum. This count describes that gate structure; fan-in limits matter when the word gets wider.

Follow an addition

For A=1011 and B=0110, G=0010 and P=1101. Take C0=0.

  • C1=0: bit 0 propagates, but there is no incoming carry.
  • C2=1: bit 1 generates.
  • C3=1: bit 2 propagates the carry from bit 1.
  • C4=1: bit 3 also propagates it.

XOR each Pi with its own incoming carry. The sum bits are 0001 with carry-out 1, making 10001 (17). The expanded equations give these same carries without waiting for physical stage-by-stage propagation.

Treat a group as a larger stage

For bits 3 through 0:

P3:0=P3P2P1P0 G3:0=G3+P3G2+P3P2G1+P3P2P1G0

Then C4=G3:0+P3:0C0. Group propagate requires every bit to propagate; group generate collects the internal carry sources that can reach the group output.

Some circuits use OR-propagate, Pi=Ai+Bi. It produces the same carries because a pair of 1s already makes generate 1. It cannot replace XOR in the sum rule: when both operand bits are 1 and carry-in is 0, OR-propagate would incorrectly make the sum 1.

Key Takeaways

  • Generate creates a carry; XOR-propagate passes an incoming carry.
  • Expanded equations compute carries directly from bit signals and the initial carry.
  • Group generate and propagate let the same carry rule operate on blocks.
  • The sum rule needs XOR even when the carry network uses OR-propagate.
  • Wide flat lookahead requires gates with growing fan-in.

3.2 Compare adder delays and build wide fast adders

A flat carry equation gets wider as the word grows. Even the expression for C4 contains a five-input product and a five-term OR. Wide adders therefore organize lookahead into blocks and levels.

Pass carries between blocks

Split an N-bit word into blocks of k bits. Each block computes bit and group generate/propagate signals in parallel with the other blocks. A block carry obeys:

Cout=Gblock+PblockCin

The carry now moves through one AND-OR stage per block instead of through every bit cell. This is block lookahead with ripple between blocks. It still has a serial dependency, but each link covers several bits.

Compare delays using one stated model

Use 2-input gates with delay 50 ps and a full-adder delay of 150 ps. A 4-bit group's generate can be factored as:

G3+P3(G2+P2(G1+P1G0))

The three nested AND-OR stages take six gate delays, or 300 ps, after the bit signals. A simple block-adder estimate allows bit-signal formation, block signals, carry travel between blocks, and a ripple through the final block:

tCLA=tpg+tpg,block+(N/k−1)tAND-OR+k tFA

For 16 bits in four-bit blocks, the estimate is 50+300+3(100)+4(150)=1250 ps. Ripple carry takes 16(150)=2400 ps. For 32 bits, the same block method gives 50+300+7(100)+600=1650 ps, compared with 4800 ps for ripple.

These are estimates for this structure and these gate delays. Counting a flat network's large gates as one level and then assigning it the delay of a 2-input gate would mix two different models.

Add a second level of lookahead

Four blocks can supply their group signals to another lookahead unit. It uses the same equations to calculate all block carries. Repeating this arrangement makes each further level cover four times as many bits, giving growth roughly proportional to log⁡4N.

A prefix adder combines group generate/propagate information in a tree, forming the needed carries in roughly log⁡2N levels. The tree cuts the serial dependency but adds gates and wiring.

Precompute both possibilities with carry select

A carry-select adder makes two copies of an upper block. One assumes carry-in 0; the other assumes carry-in 1. Both compute before the actual carry arrives. A multiplexer then chooses the matching sum and carry. The selection is quick, but duplicating upper blocks costs nearly twice their adder hardware.

StructureHow it handles carryMain cost or limitation
RipplePasses it through bit cellsDelay grows with word length
Block lookaheadComputes bit groups, then passes block carriesExtra group logic; block chain remains
Multilevel or prefixCombines group information through levelsMore gates and wiring
Carry selectComputes both incoming-carry casesDuplicated upper-block hardware

Ripple carry offers the smallest conventional structure and low power for simple, narrow additions. Faster structures spend hardware to meet a tighter timing target. Lookahead reduces delay growth; it does not make delay independent of word length.

Key Takeaways

  • Compare adder delays with a consistent gate and block model.
  • Block lookahead reduces carry travel to one stage per block.
  • Multilevel and prefix structures combine carry information through trees.
  • Carry select trades duplicated computation for a short final selection.
  • Faster carry structures require extra gates, area, and wiring.
  • Lookahead delay still grows as words become wider.
4

Compare, decode and encode binary values

Binary words can be compared, expanded into separate selection lines, or formed from active request lines. These operations support decisions throughout digital hardware. You will build comparison from the most significant differing bit, combine decoder outputs to form functions, and resolve competing encoder inputs with priority. Signal polarity and validity matter: a selected line can be low, and an all-zero code can be a valid result.

4.1 Compare two binary numbers

A magnitude comparator produces three decisions: greater than, equal to, and less than. For each pair of stable input words, exactly one decision is true. Start with unsigned words, then account for signed representation.

Check equality bit by bit

An XNOR gate is 1 when its inputs match. Define xi=(Ai⊕Bi)′. Two four-bit words are equal only when all four pairs match:

(A=B)=x3x2x1x0

An XOR followed by inversion can form the same bit-equality signal. AND combines the bit tests because one mismatch is enough to reject equality.

Let the highest differing bit decide

For unsigned words, scan from the MSB. At the first difference, a 1 in A and a 0 in B means A>B. Differences below that position cannot reverse the result. The four-bit expression is:

(A>B)=A3B3′+x3A2B2′+x3x2A1B1′+x3x2x1A0B0′

The equality factors allow a lower position to decide only if every higher position matches. For A=1011 and B=1001, bits 3 and 2 match. Bit 1 is the first difference, and 1>0, so A>B. Bit 0 does not affect that decision.

Swap A and B in each unequal-bit test to form less than. Since exactly one of the three decisions is true, you can also obtain LT=(GT+EQ)′ after building greater-than and equality.

Cascade word sections

Two four-bit comparators can compare eight-bit words. Let the high-half outputs be GTH,EQH and the low-half outputs be GTL,EQL. Then:

GT=GTH+EQHGTL,EQ=EQHEQL

The high half decides unless it is equal. ORing GTH and GTL without the equality condition would allow a low-half comparison to overrule a higher difference.

Compare through subtraction

An adder-subtractor already supplies useful comparison information. Compute A−B. For unsigned inputs, carry-out 1 means A≥B. If every difference bit is 0, the words are equal; no-borrow together with a nonzero difference means strictly greater.

For two's complement, use the difference sign N and overflow V:

(A<B)=N⊕V

Without overflow, a negative difference means less than. Overflow reverses the apparent sign, which is why N alone is insufficient. For example, four-bit 7−(−2)=9 produces 1001, whose sign bit is 1, but overflow is also 1. Their XOR is 0, correctly rejecting 7<−2.

Adapt an unsigned comparator for signed inputs

Two's complement words put negative values in the upper half of the unsigned ordering. For example, 1111 is unsigned 15 but signed −1. Flip the MSB of both operands before an unsigned comparison. This moves the negative half before the nonnegative half while preserving the order within each half. Thus 1111 and 0001 become 0111 and 1001, correctly placing −1 before 1.

Key Takeaways

  • Unsigned magnitude is decided by the most significant differing bit.
  • Word equality is the AND of the bitwise XNOR results.
  • A lower comparator block decides only when all higher bits match.
  • Unsigned subtraction carry-out 1 means greater than or equal.
  • For signed subtraction, less-than is the difference sign XOR overflow.
  • Flipping both sign bits allows an unsigned comparator to compare signed words.

4.2 Decode a binary code into separate lines

A decoder turns a binary index into a separate active line. An enabled n-to-2n decoder activates exactly one output: the line whose index matches the input word.

Produce every minterm

For a 2-to-4 decoder with input order AB, the output functions are:

D0=A′B′,D1=A′B,D2=AB′,D3=AB

Each is a minterm. For input 10, only D2 is 1. An active-high enable E changes each equation to Di=Emi. When E=0, all outputs are inactive.

The number of outputs is exponential: four address bits select among 16 lines. It is not twice the number of address bits.

Read active-low outputs correctly

Some decoders assert their selected output at 0, with all other outputs at 1. Bubbles on the outputs mark this polarity. For an enabled 3-to-8 decoder with input 101, output 5 is 0 and the other seven are 1. That single 0 marks the selected line.

Keep output polarity separate from enable polarity. A decoder may have an active-low enable as well, in which case enable 0 turns decoding on. “Inactive” means the unasserted level for that signal, not always 0.

Build functions from decoder outputs

An active-high decoder supplies every minterm of its input variables. OR the lines where a desired function is 1. A 3-to-8 decoder with inputs A,B,Cin can supply both full-adder outputs:

S=Σm(1,2,4,7),Cout=Σm(3,5,6,7)

Use two four-input OR gates, both fed by the same decoder. With active-low decoder outputs, NAND the corresponding lines instead. De Morgan's law changes the inverted minterms back into their required OR.

For a function that is 1 on most rows, collecting its few zero-rows may use fewer inputs. NOR those active-high minterm lines. For example, a function that is 0 only at rows 0 and 7 is F=(D0+D7)′. This selects the complement of the zero-row set.

Expand with enables

Two enabled 3-to-8 decoders form a 4-to-16 decoder. Send the three low input bits to both devices. Let the MSB enable the upper decoder and its complement enable the lower one. The lower device serves indices 0–7; the upper serves 8–15.

For input 1010, the MSB enables the upper device. Its local input 010 selects local line 2, which is overall line 10. Both devices seeing the low bits does not mean both should be enabled.

Recognize the role of the block

Address decoders select a memory chip or device. A decoder with an enable can also route a data signal when that signal drives the enable, giving a demultiplexer. A BCD-to-seven-segment device is commonly called a decoder, but its pattern may light several segments at once; it is a code converter, not a one-of-many selector.

Key Takeaways

  • An enabled binary decoder activates one indexed output.
  • The output count is two raised to the number of address bits.
  • A selected active-low output is 0.
  • OR active-high minterms or NAND active-low minterms to form a function.
  • Enables select the correct bank when smaller decoders are expanded.

4.3 Encode active lines as a binary code, with priority

An encoder turns an active input line into a binary index. A simple encoder assumes exactly one input is active. A priority encoder resolves multiple active inputs, and a valid output distinguishes an actual request from no request.

Encode a one-hot input

An 8-to-3 encoder has inputs D0 through D7 and output bits xyz. Each output ORs the input indices with a 1 in that binary position:

x=D4+D5+D6+D7 y=D2+D3+D6+D7 z=D1+D3+D5+D7

If only D6=1, the code is 110. But if D3 and D6 are both active, the OR network outputs 111, which names neither request. This is not an acceptable arbitration rule; it is a violation of the simple encoder's one-hot input requirement.

With no inputs active, those equations output 000, just as they do for D0 alone. A code alone therefore cannot distinguish those cases.

Assign priority and validity

A priority encoder returns the highest-priority active input's index. For a four-input encoder with D3 highest and D0 lowest, output bits xy and valid signal V can be:

x=D3+D2 y=D3+D2′D1 V=D3+D2+D1+D0

The factor D2′ suppresses input 1's contribution to the low output bit when input 2 is active. Without it, inputs 2 and 1 together would incorrectly give code 11.

For input word D3D2D1D0=0110, the priority result is code 10 with V=1. For 0001, the result is code 00 with V=1. For 0000, V=0 and the code bits have no valid meaning.

Read compressed input rows
Input patternCodeValid
1XXX111
01XX101
001X011
0001001
0000XX0

An X in an input column stands for both values. The 1XXX row covers eight combinations because lower-priority inputs cannot change the winner. The row counts are 8, 4, 2, 1, and 1, totaling all 16 input combinations. An X in the final output row means the code is irrelevant when valid is 0; it does not promise a particular electrical level.

Build a wider priority decision

Divide requests into high and low groups, each with a local priority encoder. The high group's valid signal decides whether to select its code or the low group's code. Include the group choice in the final index. This preserves global priority: any valid high-group request outranks every low-group request.

Interrupt selection and leading-one detection use this pattern. A leading-one detector reports the position of the most significant 1; a valid output is still needed for the all-zero word.

Key Takeaways

  • A simple encoder requires exactly one active input.
  • A priority encoder chooses one winner when several inputs are active.
  • A valid signal separates no input from a valid index of zero.
  • Input X values stand for combinations that cannot change the priority decision.
5

Route data with multiplexers and demultiplexers

Selection logic controls where a signal comes from and where it goes. A multiplexer chooses one source, while a demultiplexer sends one source to a selected destination. You will build larger selectors from smaller ones, use a mux to implement a truth table, and compare gate selection with a shared bus driven by three-state buffers. Follow the select-bit order carefully, and keep routing separate from storing a value.

5.1 Select one of several inputs with a multiplexer

A multiplexer, or mux, passes one selected data input to one output. Its select word names the input index. With n select bits, it can choose among 2n data inputs.

Start with a two-input selection

For select S, the 2-to-1 mux function is:

Y=S′I0+SI1

When S=0, only the I0 product can contribute. When S=1, only the I1 product can contribute. The select is a control input; the data value on the chosen line becomes the output value.

A 4-to-1 mux uses select word S1S0, with S1 most significant:

Y=S1′S0′I0+S1′S0I1+S1S0′I2+S1S0I3

Select 01 chooses I1 and select 10 chooses I2. Reversing the select wires reverses those two choices. Internally, the select logic acts like a decoder: it enables the appropriate data product, and an OR combines the products.

Select words as well as individual bits

To choose between two 8-bit words, place a 2-to-1 mux on each bit position and give all eight muxes the same select. Each mux chooses between corresponding bits. One control line selects an entire word, but the data path still needs eight separate bit channels.

A mux with an enable forces its output to its specified inactive state when disabled. The enable is separate from the select index; it does not provide another data choice.

Build a mux tree

An 8-to-1 mux can use two 4-to-1 muxes in the first level and one 2-to-1 mux in the second. Both first-level muxes receive S1S0. The final mux receives S2 and chooses the lower or upper group.

Using only 2-to-1 muxes, eight inputs need four muxes, then two, then one: seven total and three levels. In general, a 2n-input tree uses 2n−1 cells. The levels determine how many selection stages a data signal passes through.

Share a bus with three-state buffers

A three-state buffer drives its input value when enabled. When disabled, its output is high impedance, written Z: it disconnects from the wire. Z is not another way to drive logic 0.

Several such outputs can share a wire if at most one driver is enabled at a time. The active driver supplies the selected source. If two enabled drivers try to impose different levels, contention produces current between them, an undefined wire level, and heating. Turn the old driver off before enabling the new one.

A decoder gives a single active enable after its outputs settle. During a select change, unequal delays can briefly overlap enables, so settled-state one-hot behavior is not enough to ensure a safe bus handover.

Muxes also select arithmetic results, route register inputs, and choose between the two precomputed carry cases in a carry-select adder. Stepping a mux's selects through successive input indices places those sources onto one output in successive time slots.

Key Takeaways

  • A select word names the input whose value reaches the output.
  • One mux per bit lets a shared select choose a whole word.
  • A tree of 2-to-1 muxes selects among many inputs.
  • A disabled three-state buffer disconnects its output; Z is not 0.
  • Shared bus drivers need nonoverlapping enable timing.

5.2 Implement Boolean functions with multiplexers

A multiplexer can implement a Boolean function as well as route changing signals. The select word chooses a truth-table row or a group of rows; the data input supplies the function value for that choice.

Use constants as a lookup table

For an n-variable function, an n-select mux has one data input per truth-table row. Connect the variables to the select lines in the table's bit order. Tie each data input to 0 or 1 according to that row's output. Each stable input word then selects its own function value.

This is the selection principle behind an FPGA lookup table. The mux is still selecting data; the chosen data happens to be the stored or fixed truth-table value.

Leave one variable on the data side

An n-variable function can also fit a mux with only n−1 selects. Use those variables to choose pairs of rows, and let the remaining variable determine the output within each pair.

Call the remaining variable z. For each select setting, read the output first at z=0, then at z=1:

Output pairConnect the data input to
0, 00
1, 11
0, 1z
1, 0z′

The order within the pair matters. A 1 followed by a 0 is an inversion, not a copy of z.

Build a three-input majority function

Let A,B be the selects and C the remaining variable. For AB=00, the majority output is 0 for both values of C, so I0=0. For 01 and 10, a second 1 is needed, so the output follows C. For 11, a majority already exists, so the output is always 1. The connections are:

I0=0,I1=C,I2=C,I3=1

This implements the same function as AB+AC+BC through selection instead of three explicit product terms.

Use all four data choices

For F(A,B,C)=Σm(1,2,4,5), the truth-table output pairs in AB order are:

  • 00: rows 0 and 1 give (0, 1), so I0=C.
  • 01: rows 2 and 3 give (1, 0), so I1=C′.
  • 10: rows 4 and 5 give (1, 1), so I2=1.
  • 11: rows 6 and 7 give (0, 0), so I3=0.

At input 101, the select 10 chooses constant 1, correctly producing the value of minterm 5. If A and B are swapped on the select wires, the data connections must be reordered too; otherwise a different truth-table row is chosen.

Choose between a mux and a decoder

One decoder makes all minterms available, so different OR gates can form several output functions from it. One mux produces one output function. Both are standard-block implementations of truth-table behavior, and either can be useful when a custom gate network would be harder to organize.

Key Takeaways

  • A full-size mux implements a truth table with constant data inputs.
  • A smaller mux groups rows by the select variables.
  • For remaining variable z, the pair order is the output at z = 0 followed by z = 1.
  • The four possible row pairs map to 0, 1, z, or z′.
  • Changing select-variable order requires changing the data-input order.

5.3 Distribute one input with a demultiplexer

A demultiplexer, or demux, routes one input to one selected output. It reverses the routing direction of a mux: one source can reach several possible destinations, but only the selected destination receives it.

Gate data with a selection minterm

For a 1-to-4 demux with active-high outputs:

Yi=D mi(S1,S0)

Here D is the data input and mi is the select minterm for output i. With select 11 and D=1, output 3 is 1 and all others are 0. Holding select 11 and changing D makes only output 3 follow the data.

When D=0, every output is 0. The selected destination still has index 3, but no active-high data is present. Do not infer the select setting solely by looking for a 1 at the outputs.

Use a decoder's enable as data

An enabled decoder has equations Yi=Emi. Connecting the data signal to E gives exactly the demux equation. The same block can therefore be described as a decoder or a demultiplexer according to how its inputs are used.

Polarity changes the inactive levels. A decoder with active-low outputs and an active-low enable has selected output equal to the enable level; the other outputs stay at 1. Feed data D to that enable, and the selected line follows D while unselected lines stay high. The data is asserted low in that arrangement.

Share a link in time slots

A mux at the sending end can choose source i, while a demux at the receiving end chooses destination i. Both ends must use the same select value during the same slot. If they disagree, the selected source reaches the wrong destination.

This is time-division multiplexing: different sources take turns using the link. For example, stepping both select words through 00, 01, 10, and 11 successively connects four source-destination pairs.

Keep routing separate from memory

A combinational demux does not retain the previous value on an unselected output. That line returns to its inactive level when selection moves elsewhere. A destination that must keep a value between slots needs storage, such as a register.

Demuxes also distribute write-enable pulses to registers or memory banks. The selected line carries the pulse while the other destinations remain inactive; the demux chooses where the event goes.

Key Takeaways

  • A demux routes one data input to a selected output.
  • A decoder becomes a demux when its enable is used as data.
  • The output polarity determines the inactive levels.
  • Mux-demux links need matching select timing.
  • Unselected demux outputs do not remember earlier data.
6

Analyze timing: propagation delay and glitches

A truth table describes the final result, but gates need time to reach it. Different paths can respond at different times, producing temporary values that the table does not show. You will add gate delays along paths, find the latest settling time and earliest possible change, and trace a glitch through a simple circuit. A final design must meet both its Boolean function and the timing needs of the circuit that receives its outputs.

6.1 Find propagation delay, contamination delay and the critical path

Real signals do not change everywhere at once. Timing analysis describes the interval between an input change and a settled output, using minimum and maximum gate delays.

Distinguish the two delay bounds

Propagation delay, tpd, is the maximum time until the output reaches its final value. Contamination delay, tcd, is the minimum time before the output can start changing. Transition delays are commonly measured between the 50% voltage points of the input and output edges.

Time after an input changeWhat the timing specification guarantees
Before contamination delayThe output retains its old value.
Between contamination and propagation delayThe output may change, including temporary values.
After propagation delayThe output has settled to the result for the new stable inputs.

These bounds do not mean that every input change causes an output transition. For example, changing one input of an AND gate cannot change its output while the other input stays 0.

Add delays along paths

A path follows one input through connected gates to an output. Add maximum delays along each path and take the largest total for the circuit's propagation-delay bound. This longest path is the critical path. For contamination delay, add minimum delays along each path and take the smallest total.

Consider Y=(AB+C)D. Build it from AND1 on A,B, then an OR with C, then AND2 with D. Each AND has tpd=30 ps and tcd=20 ps; the OR has tpd=35 ps and tcd=25 ps.

  • From A or B: maximum delay 30+35+30=95 ps.
  • From C: maximum delay 35+30=65 ps.
  • From D: maximum delay 30 ps.

The critical path starts at A or B and gives 95 ps. For the minimum bound, the paths take 65 ps, 45 ps, and 20 ps respectively. The shortest starts at D, so the contamination delay is 20 ps.

Do not add every gate in the drawing. Gates on parallel branches are not one serial path. Also include an inverter if a path needs a complemented input; it takes time just like the other gates.

Improve the path that limits settling

Gate delay depends on gate type, input count, driven load, wire, supply voltage, and temperature. Rising and falling edges may have different delays. Counting levels gives a useful first estimate only when the assumed gate delays are comparable.

To reduce overall settling time, shorten the critical path or use faster logic on it. Connect a late-arriving input nearer the output when the function permits it. Speeding up a path that remains shorter than the critical path leaves the overall propagation delay unchanged.

A logic delay of 2 ns alone corresponds to 500 MHz. In a clocked system, register timing also uses part of the clock period, so the usable clock frequency is lower. The minimum delay matters too: an output that changes too early can violate a receiving register's hold requirement.

Key Takeaways

  • Propagation delay bounds final settling; contamination delay bounds the earliest change.
  • Add gate delays along each connected input-to-output path.
  • Use maximum delays on the longest path for propagation delay.
  • Use minimum delays on the shortest path for contamination delay.
  • Only an improvement to a limiting path can reduce the overall settling bound.

6.2 Explain, predict and remove glitches

A glitch is a brief unwanted output pulse. It can occur even when a circuit's truth table is correct, because signals taking different paths do not arrive together.

Recognize the expected transition
HazardIntended output behaviorPossible actual behavior
Static-1Stay at 1Brief drop to 0
Static-0Stay at 0Brief rise to 1
DynamicChange onceThree or more changes before settling

A hazard is the circuit's potential for such a glitch. The Boolean expression alone does not specify its pulse duration.

Trace a static-1 glitch

Consider F=AB+A′C with B=C=1. Let A fall from 1 to 0 at time 0. The initial term AB and final term A′C should keep the result at 1. Use a transport-delay model, where each edge is shifted by the gate delay: inverter 10 ps, AND gates 20 ps, and OR gate 20 ps.

  1. A′ rises at 10 ps.
  2. AB falls at 20 ps.
  3. A′C rises at 30 ps.
  4. Both OR inputs are 0 from 20 to 30 ps, so the OR output is 0 from 40 to 50 ps.

The model predicts a 10 ps low pulse. A physical gate can filter a very short pulse; the trace demonstrates the path mismatch with an explicit delay model.

Add a term that bridges the change

The consensus theorem gives:

AB+A′C=AB+A′C+BC

The added term BC is logically redundant. If BC=1, either A=1 activates AB or A=0 activates A′C, so the settled function was already 1. But the physical BC path does not depend on the changing A. With B=C=1, it holds the OR output high during the handover.

In a two-level sum of products, look for a single input change that transfers the 1-output from one product term to another with no term spanning both combinations. A consensus term can bridge that gap. Minimizing away the extra term preserves the truth table while removing the protection.

A 2-to-1 mux has the same pattern: Y=S′D0+SD1. When both data inputs are 1, a select change can produce a low glitch. Adding D0D1 holds the output high for that change.

Allow several inputs to settle

If several inputs change, an intermediate input combination may have a different correct output. This function hazard cannot be eliminated simply by adding redundant terms: the circuit must still compute the function at that intermediate combination. Wait until the inputs and paths settle before relying on the result.

Glitches between properly timed sampling edges do not change the sampled result. They still cause extra switching and power use. They can also trigger unwanted actions if the output drives an edge-sensitive clock, asynchronous reset, or counter input. Do not use a possibly glitching combinational output as a clock. A zero-delay simulation checks final logic but cannot reveal the unequal-delay behavior.

Key Takeaways

  • Unequal path delays can cause glitches despite a correct truth table.
  • Static hazards disturb a constant output; dynamic hazards add extra transitions.
  • The consensus term holds a static-1 output during a handover between product terms.
  • Redundant logic can preserve a function while changing its timing behavior.
  • Several changing inputs can produce a function hazard.
  • Delay-aware analysis is needed to see glitches.

Combinational Logic Circuits examples

6 Walkthroughs

1

Turn gates and requirements into checked functions

14 steps
Analyze named signals, design a voting circuit, and convert codes with worked steps and short challenges.
  1. 1
    IntroductionFollow the information

    A combinational circuit maps a present input word to a settled output word. You can follow that mapping from gates to a function, or start with a required function and choose the gates.

    We will analyze a small network, build a voting circuit from words, and then convert code words. At each stage, keep the input meaning and bit order fixed so that the same table describes the same behavior.

  2. 2
    ExplanationName the gate outputs

    Start with gates whose inputs are already known. Give their outputs names before substituting long expressions.

    Suppose the first XOR produces T=A⊕B. A second XOR produces F=T⊕C. The carry branch is G=AB+TC.

    The shared signal T feeds two places but is computed once. No storage or feedback is introduced just because one gate output has several destinations.

  3. 3
    ExampleTrace one complete input row

    Take input ABC=101 in that network.

    1. T=1⊕0=1.
    2. F=1⊕1=0.
    3. AB=0 and TC=1, so G=1.

    Thus the output pair GF is 10, the binary total of the three input bits. Repeating the process for all eight rows shows that F is odd parity and G is majority: the network is a full adder.

  4. 4
    ChallengeKeep the inversion in place

    A NAND produces T=(AB)′ and a later AND produces Y=TC. For input ABC=011, what are T and Y?

    ---reveal---

    The input AND is 0⋅1=0, so the NAND gives T=1. Then Y=1⋅1=1. Writing T=A′B′ would wrongly give 0. The bubble complements the whole AND result, not both inputs of another AND.

  5. 5
    ExplanationTranslate a voting rule

    Three inputs A,B,C mean “pass” when they are 1. The output should be 1 when at least two inputs are 1.

    The passing words are 011, 101, 110, and 111. With A as MSB, they are minterms 3, 5, 6, and 7. The all-1 case matters: “at least two” includes three. Settle that meaning before selecting gates, because a later simplification cannot repair a wrong requirement.

  6. 6
    ExampleSimplify the voter

    The direct expression is:

    M=A′BC+AB′C+ABC′+ABC

    Use ABC in each pair; Boolean OR allows a repeated term without changing the function. Combining gives BC, AC, and AB, so:

    M=AB+AC+BC

    Three 2-input AND gates feed an OR gate. Check 100: no pair is active, so the output is 0. Check 110: AB=1, so the output is 1.

  7. 7
    ChallengeChange the required behavior

    A different voter must output 1 for exactly two active inputs. What happens if you reuse AB+AC+BC unchanged? Name the failing row.

    ---reveal---

    It wrongly outputs 1 for 111. The correct specification requires 0 there. The other passing rows remain 011, 101, and 110, so the minterm form keeps those three terms and omits ABC. Verification must check the table against the wording as well as the gates against the table.

  8. 8
    TipTreat an X as a design choice

    An output X means either 0 or 1 is allowed for that row. Choose the value that helps simplify the circuit. The implemented output still resolves to ordinary logic values.

    If a supposedly unused pattern must trigger an error, it is no longer unrestricted. Specify the error behavior explicitly. Large circuits also need manageable blocks: verify small slices and their connections instead of writing an enormous flat truth table.

  9. 9
    ExampleConvert one decimal digit

    BCD encodes each decimal digit separately. To convert digit 5 to excess-3, begin with BCD 0101 and add the fixed binary offset 0011:

    0101+0011=1000

    The output’s ordinary binary value is 8, but it represents decimal digit 5 in excess-3. Complementing this output gives 0111, the excess-3 code for digit 4, matching the self-complementing rule 9−5=4.

  10. 10
    ExplanationBuild the forward Gray conversion

    Copy the binary MSB. Each lower Gray bit is the XOR of neighboring binary bits:

    Gi=Bi+1⊕Bi

    For binary 1011, the copied bit is 1. The XOR results are 1, 1, and 0, giving Gray 1110. Neighboring Gray positions change one bit, which helps a position sensor avoid a mixed reading from several changing code bits at an adjacent transition.

  11. 11
    ExampleReverse Gray one bit at a time

    Recover binary from Gray 1110 by copying the first bit and working downward.

    1. Copy B3=1.
    2. B2=B3⊕G2=1⊕1=0.
    3. B1=B2⊕G1=0⊕1=1.
    4. B0=B1⊕G0=1⊕0=1.

    The recovered word is 1011. Each step uses the binary bit just found, so the reverse conversion is not a row of independent neighboring-Gray XORs.

  12. 12
    ChallengeRecover a fresh Gray word

    Convert reflected Gray word 1101 to binary. Work from the MSB down.

    ---reveal---

    Copy 1, then compute 1⊕1=0, 0⊕0=0, and 0⊕1=1. The binary result is 1001. XORing neighboring Gray bits would give a different result because it fails to carry the recovered binary value into the next step.

  13. 13
    ChallengeSpecify an invalid-input indicator

    A BCD converter must report invalid words as well as convert valid digits. Its error output is E=A(B+C). What should happen for input 1011, and may the error output be a don't-care there?

    ---reveal---

    The input is an invalid BCD digit and gives E=1. Its error output cannot be a don't-care because reporting invalid words is required. The conversion bits may remain unrestricted for that row if the specification permits it.

  14. 14
    RecapCheck meaning before implementation

    Analysis follows named signals from inputs to outputs. Design moves from a precise requirement through a truth table and expressions to verified gates.

    Code conversion adds another check: the input and output words must represent the same information in different codes. Keep valid-code conditions and bit order visible, and recover Gray-to-binary bits from the already recovered binary neighbor.

2

Build arithmetic from bit cells

17 steps
Trace binary addition, subtraction flags, and BCD correction from one-bit cells to complete results.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionSeparate result bits from flags
  2. 2
    ExplanationGive each output its proper weight
  3. 3
    ExampleUse two half adders
  4. 4
    ChallengeAccount for every bit in the cell
  5. 5
    ExplanationConnect the carry chain
  6. 6
    ExampleCompute the low two stages
  7. 7
    ExampleFinish and read the word
  8. 8
    ChallengeKeep a carry beyond the word
  9. 9
    ExplanationSwitch one adder into subtraction
  10. 10
    Key InsightRead no-borrow and overflow separately
  11. 11
    ChallengeDiagnose a subtraction result
  12. 12
    ExplanationCorrect a decimal column
  13. 13
    ExampleCorrect a total below sixteen
  14. 14
    ExampleKeep the carry for a total above fifteen
  15. 15
    ChallengeAdd two decimal columns
  16. 16
    ChallengeChoose the meaning of the same sum
  17. 17
    RecapCarry the correct information onward
3

Move carries through equations and blocks

12 steps
Derive lookahead signals, trace an addition, and compare fast-adder structures with a consistent delay model.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionShorten the carry dependency
  2. 2
    ExplanationSeparate generating from passing
  3. 3
    ExampleSubstitute out an intermediate carry
  4. 4
    ExampleForm the signals for an addition
  5. 5
    ExampleFinish the sum from the carries
  6. 6
    ChallengePredict a carry without a full sum
  7. 7
    ExplanationGive four bits one block description
  8. 8
    ExampleCompare a sixteen-bit estimate
  9. 9
    ConnectionBuild a higher carry level
  10. 10
    ChallengeTime a carry-select decision
  11. 11
    ChallengeCheck an OR-propagate redesign
  12. 12
    RecapSpend hardware to reduce waiting
4

Make comparisons and select indexed lines

12 steps
Work from bit comparisons to decoder functions and priority choices, with explicit polarity and validity checks.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionRead decisions in the right order
  2. 2
    ExplanationLet the high difference win
  3. 3
    ExampleTrace an unsigned comparison
  4. 4
    ChallengeRepair the signed ordering
  5. 5
    ExplanationTurn an index into one active line
  6. 6
    ExampleBuild two functions from one decoder
  7. 7
    ChallengeChoose a bank and a local line
  8. 8
    ExplanationResolve several requests
  9. 9
    ExampleSuppress the lower request
  10. 10
    ChallengeSeparate zero index from no request
  11. 11
    ChallengeConnect priority selection to decoding
  12. 12
    RecapPreserve priority, polarity, and validity
5

Select sources, implement functions, and route data

13 steps
Build mux selections, translate truth-table pairs into mux inputs, and coordinate a sending mux with a receiving demux.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionControl where the data travels
  2. 2
    ExplanationRead the select as an index
  3. 3
    ExampleBuild a wider selector in stages
  4. 4
    ChallengeCount a mux tree
  5. 5
    TipDisconnect before another driver starts
  6. 6
    ExplanationTurn two rows into one data input
  7. 7
    ExampleWire the first half of a function
  8. 8
    ExampleComplete and check the connections
  9. 9
    ChallengeImplement a different row pattern
  10. 10
    ExplanationSend one signal to an indexed output
  11. 11
    ChallengeTest whether the destination remembers
  12. 12
    ChallengeCoordinate both ends of the link
  13. 13
    RecapKeep the index and data roles clear
6

Find settling times and trace a glitch

12 steps
Calculate maximum and minimum path bounds, then follow an unequal-delay pulse and remove its static hazard.

Save this lesson to follow every Walkthrough step by step.

  1. 1
    IntroductionAdd timing to the truth table
  2. 2
    ExplanationUse the right bound for the question
  3. 3
    ExampleList the maximum path totals
  4. 4
    ExampleFind the earliest possible change
  5. 5
    ChallengeFind both bounds in a fresh network
  6. 6
    ExplanationWatch the two terms hand over
  7. 7
    ExampleTime the internal gap
  8. 8
    ExampleMove the gap to the output
  9. 9
    Key InsightSupply a path that does not switch
  10. 10
    ChallengeBridge a different handover
  11. 11
    ChallengeDecide when waiting is enough
  12. 12
    RecapCheck final behavior and transitions

Combinational Logic Circuits practice questions

60 Practice Questions in 6 sets

Set 1: Trace arithmetic and interpret flags10 Practice Questions

Question 1 of 10

What is the complete unsigned result of 1101+1011 in a four-bit ripple adder with carry-in 0?
  1. 01100
  2. 10100
  3. 11010
  4. 11000
Show answerHide answer
Answer: D
The operands represent 13 and 11, so the total is 24, or five-bit 11000. The four sum wires carry 1000 and the final carry is 1. A result of 10100 drops a carry within the word; writing each column’s outgoing carry above the next column prevents that error.

Question 2 of 10

A 40-bit ripple adder is estimated at 90 ps per carry stage. What is its worst-case delay in nanoseconds?
  1. 3.6 ns
  2. 0.36 ns
  3. 36 ns
  4. 4.5 ns
Show answerHide answer
Answer: A
Forty dependent stages at 90 ps each give 3600 ps, which is 3.6 ns. A result of 0.36 ns misplaces the unit conversion: one nanosecond is 1000 picoseconds. This estimate follows the longest carry chain, even though many additions settle earlier.

Question 3 of 10

A four-bit adder-subtractor computes unsigned 0101−1001. What low result and carry-out should appear?
  1. 1100, carry 1
  2. 0100, carry 0
  3. 1100, carry 0
  4. 0100, carry 1
Show answerHide answer
Answer: C
The hardware adds 0101+0110+1=1100, with carry-out 0. The unsigned difference requires a borrow because 5 is below 9; the low result wraps to 12 modulo 16. Carry-out 1 would mean no borrow in this implementation, so it cannot describe this subtraction.

Question 4 of 10

A four-bit adder adds 1001 and 1100. What are its final carry-out and signed overflow flag?
  1. Carry 0, overflow 0
  2. Carry 0, overflow 1
  3. Carry 1, overflow 0
  4. Carry 1, overflow 1
Show answerHide answer
Answer: D
The bit sum is 1 0101, so carry-out is 1. Signed operands −7 and −4 have true sum −11, below the four-bit minimum −8; the stored positive result therefore has overflow 1. A final carry does not make a signed result valid: the two range tests are independent.

Question 5 of 10

A four-bit signed addition has carry into the sign stage 1 and carry out 1. What is the overflow flag?
  1. 1, because carry-out is set
  2. 0, because the carries agree
  3. 1, because carry entered the sign stage
  4. 0, because a carry always clears overflow
Show answerHide answer
Answer: B
Overflow is the XOR of the sign-stage carries. Equal carries 1 and 1 give XOR 0, so this addition has no signed overflow. Checking only carry-out would wrongly flag it; checking both carries is what distinguishes a valid signed result from a wrapped one.

Question 6 of 10

An eight-bit adder-subtractor computes signed 10000000−00000001. What result and overflow should it report?
  1. 10000001, overflow 0
  2. 01111111, overflow 0
  3. 01111111, overflow 1
  4. 10000001, overflow 1
Show answerHide answer
Answer: C
The true signed difference is −128−1=−129, below the eight-bit minimum. The hardware wraps to 01111111, or +127, and sets overflow 1. Reporting overflow 0 because the low bits look like a valid positive number confuses a representable bit pattern with a valid result for these operands.

Question 7 of 10

What correction is added to a BCD digit’s low binary sum when its total is 11?
  1. 0110
  2. 0011
  3. 0001
  4. 1010
Show answerHide answer
Answer: A
A total of 11 exceeds digit 9, so the correction is six, written 0110. Adding it to 1011 gives 1 0001, leaving units digit 1 with a decimal carry. Adding 0011 would confuse BCD addition correction with the separate offset used by excess-3 encoding.

Question 8 of 10

A BCD stage adds digits 9 and 8 with carry-in 0. What are its corrected digit, decimal carry, and correction-adder carry-out?
  1. 0001; 1; 1
  2. 0111; 0; 0
  3. 0111; 1; 1
  4. 0111; 1; 0
Show answerHide answer
Answer: D
The first binary sum is 1 0001, so the original carry requires correction. Adding 0110 to low word 0001 gives 0111 without a second-adder carry. The digit is 7 and decimal carry is 1; taking the second adder’s carry as the decimal carry would incorrectly turn 17 into 7.

Question 9 of 10

What is the BCD result of decimal 56+29?
  1. 1000 0100
  2. 1000 0101
  3. 0111 1111
  4. 0111 0101
Show answerHide answer
Answer: B
The units stage adds 6+9=15, producing digit 5 and decimal carry 1. The tens stage then adds 5+2+1=8, giving BCD 1000 0101. Omitting the units carry gives 75, so the stage-to-stage signal must be the decimal carry after correction.

Question 10 of 10

For a half adder with both inputs equal to 1, what are sum and carry?
  1. Sum 1, carry 0
  2. Sum 0, carry 1
  3. Sum 1, carry 1
  4. Sum 0, carry 0
Show answerHide answer
Answer: B
One plus one is binary 10, so the low sum bit is 0 and the carry is 1. XOR produces that low bit, while AND produces the carry. Using OR for the sum would wrongly give sum 1 and turn the encoded total into three instead of two.
Set 2: Read, specify, and calculate10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

What are the low four sum bits and final carry when unsigned 1001 and 0101 are added with initial carry 0?
  1. Sum 1110, carry 1
  2. Sum 0110, carry 1
  3. Sum 1110, carry 0
  4. Sum 1100, carry 0
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

How many input rows are needed to specify a combinational circuit with six independent binary inputs and two outputs?
  1. 12 rows
  2. 16 rows
  3. 64 rows
  4. 128 rows
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A circuit has T=(AB)′ and Y=T⊕C. What are T and Y for input ABC=101?
  1. T=1, Y=0
  2. T=0, Y=1
  3. T=1, Y=1
  4. T=0, Y=0
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A three-sensor indicator must turn on when exactly two sensors are active. What output is required when all three sensors are active?
  1. 1, because a pair is active
  2. X, because three is beyond two
  3. 1, because a majority is active
  4. 0, because exactly two are required
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

An interlock has inputs R (run requested), C (cover closed), and F (fault present). It permits a request only when the cover is closed and no fault is present. L is an active-low permit output; H is an active-high blocked-request output. What functions implement both outputs?
  1. L=RCF′,H=R(C′+F)
  2. L=(RCF′)′,H=R(C′+F)
  3. L=(RCF′)′,H=C′+F
  4. L=(RCF)′,H=R(C′+F′)
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

What is the excess-3 representation of decimal digit 6?
  1. 0110
  2. 1001
  3. 1010
  4. 0011
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

What binary word corresponds to reflected Gray code 1010?
  1. 1010
  2. 1100
  3. 1111
  4. 1001
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A BCD converter uses error output E=A(B+C), with A the MSB. For input 1100, what should the error output report, and why?
  1. Error 1; it is an invalid digit
  2. Error 0; it encodes digit twelve
  3. Error 0; only 1111 is invalid
  4. Error 1; any leading 1 is invalid
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

What carry-out and sum does a full adder produce for A=0, B=0, and carry-in = 1?
  1. Carry 1, sum 1
  2. Carry 1, sum 0
  3. Carry 0, sum 0
  4. Carry 0, sum 1
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A full subtractor receives A=1, B=1, and borrow-in = 1. What difference and borrow-out does it produce?
  1. Difference 1, borrow 1
  2. Difference 0, borrow 1
  3. Difference 1, borrow 0
  4. Difference 0, borrow 0
Show answerHide answer

Save this lesson to see this answer.

Set 3: Compute carries and compare words10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

What are XOR-propagate and generate for operand bits Ai=1 and Bi=1?
  1. P=1, G=0
  2. P=0, G=0
  3. P=1, G=1
  4. P=0, G=1
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

For a three-bit addition, G2G1G0=001, P2P1P0=110, and C0=0. What are carries C₁, C₂, C₃ in that order?
  1. 1, 0, 0
  2. 1, 1, 1
  3. 0, 1, 1
  4. 0, 0, 1
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

For four-bit operands A=1101 and B=0010 with initial carry 1, what are the sum bits and final carry?
  1. 0000, carry 1
  2. 1111, carry 0
  3. 1110, carry 1
  4. 0000, carry 0
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

What term represents a carry generated at bit 1 and reaching the output of bit 4 without another carry source?
  1. P4P3P2P1G1
  2. P3P2G1
  3. P4P3P2G1
  4. P4P3G1
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A block-lookahead estimate uses 60 ps for bit signals, 360 ps for block signals, 120 ps per block-to-block link, and 180 ps per final ripple bit. What is the estimate for 12 bits in three four-bit blocks?
  1. 900 ps
  2. 1260 ps
  3. 1500 ps
  4. 1380 ps
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

Upper-block candidate results in a carry-select adder are ready 420 ps after launch. Its actual carry arrives at 610 ps, and the selecting mux takes 70 ps after its last input settles. When is the selected result ready?
  1. 490 ps
  2. 680 ps
  3. 1030 ps
  4. 1100 ps
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A designer doubles a block-lookahead adder’s width while keeping four-bit blocks and a serial chain between them. What part of its delay estimate grows?
  1. The ripple depth inside the last block
  2. The bit-signal delay in every gate
  3. The number of block carry links
  4. The number of possible carry values
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Which relation holds for unsigned words A=0101 and B=0110?
  1. A<B
  2. A>B
  3. A=B
  4. A≥B
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

An eight-bit subtractor computes A=01111111 minus B=11111110. What is the signed less-than result using the subtraction flags?
  1. 1, because result sign N=1
  2. 1, because unsigned carry is 0
  3. 0, because result sign N=0
  4. 0, because N=1 and V=1
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

High comparator blocks report equal, and low blocks report A<B. What should the complete word comparison report?
  1. A>B
  2. A<B
  3. A=B
  4. A≥B
Show answerHide answer

Save this lesson to see this answer.

Set 4: Decode, encode, and route10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A 4-to-1 mux has data I0I1I2I3=0101 and select S1S0=10. Which input is selected, and what is the output value?
  1. Input 2, output 0
  2. Input 1, output 1
  3. Input 2, output 1
  4. Input 1, output 0
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

An enabled 3-to-8 decoder has active-low outputs and address 011. What output pattern appears on D₇ through D₀?
  1. 11110111
  2. 00001000
  3. 11111011
  4. 11101111
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A function is 1 on every input row except rows 2 and 5. An active-high 3-to-8 decoder supplies outputs D₀ through D₇. What combining function needs only those two lines?
  1. D2+D5
  2. D2D5
  3. (D2D5) ′
  4. (D2+D5) ′
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

Two active-high 2-to-4 decoders with active-high enables form a 3-to-8 decoder. A is the bank-select MSB and BC feeds both address ports. For input 110, which bank and local output must be active?
  1. Lower bank, local output 2
  2. Upper bank, local output 2
  3. Upper bank, local output 1
  4. Lower bank, local output 3
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

An eight-input priority encoder gives higher indices higher priority. Inputs 1, 4, and 5 are active. What binary index should it output?
  1. 100
  2. 111
  3. 101
  4. 001
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

What code and valid signal should a highest-index-first four-input priority encoder produce when only input 0 is active?
  1. Code 00, valid 0
  2. Code 01, valid 1
  3. Code 01, valid 0
  4. Code 00, valid 1
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

An eight-input priority encoder has requests 2 and 6 active, with higher indices winning. Its code addresses an active-low 3-to-8 decoder, enabled by the encoder’s valid signal. Decoder output 6 is then inverted to produce J. What code, valid signal, and J result?
  1. Code 010; valid 1; J=0
  2. Code 110; valid 1; J=1
  3. Code 110; valid 1; J=0
  4. Code 110; valid 0; J=0
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

Two bus drivers can force opposite values. The old driver disconnects 35 ps after disable, while the new driver begins driving 20 ps after enable. If old disable is at time 0, what is the earliest safe new-enable time for zero overlap?
  1. 0 ps
  2. 20 ps
  3. 15 ps
  4. 35 ps
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

An active-high 1-to-8 demux has data 0 and select 101. What are its eight outputs?
  1. Only output 5 is 1
  2. Every output is 1
  3. Only output 0 is 1
  4. Every output is 0
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A sender mux selects source 2 while a receiving demux selects destination 3 on the same link. Where does source 2’s current value go?
  1. Destination 2
  2. Destination 3
  3. Both destinations
  4. Neither destination
Show answerHide answer

Save this lesson to see this answer.

Set 5: Implement functions and check timing10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

What extra product removes the single-input static-1 hazard in F=PQ+P′R?
  1. QR
  2. PR
  3. PQ′
  4. Q′R
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

With remaining variable z, what mux data input produces output pair (0, 1), ordered by z = 0 then z = 1?
  1. 0
  2. z ′
  3. 1
  4. z
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A 4-to-1 mux implements F(A,B,C)=Σm(0,3,5,6,7) with A and B on S₁ and S₀. What are I₀, I₁, I₂, and I₃?
  1. C′,C,C,1
  2. C,C′,C,1
  3. C′,C,C,0
  4. C′,C′,C,1
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

An 8-to-1 mux implements a three-input truth table with inputs A, B, C on selects S₂, S₁, S₀. The function is 1 only for minterms 0, 2, 6, and 7. What constants should I₀ through I₇ receive?
  1. 10100110
  2. 11000011
  3. 10100011
  4. 01011100
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A path contains an inverter, an AND, and an OR with maximum delays 12 ps, 28 ps, and 34 ps. What is its maximum path delay?
  1. 62 ps
  2. 74 ps
  3. 34 ps
  4. 46 ps
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A circuit implements Y=(A+B)C using an OR followed by an AND. The OR maximum/minimum delays are 50/18 ps, and the AND delays are 30/12 ps. What are the circuit’s propagation and contamination bounds?
  1. 80 ps; 30 ps
  2. 50 ps; 12 ps
  3. 30 ps; 18 ps
  4. 80 ps; 12 ps
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

A circuit’s two potentially critical paths have maximum delays 140 ps and 125 ps. An optimization reduces only the second path to 90 ps. What is the new overall propagation-delay bound?
  1. 140 ps
  2. 125 ps
  3. 90 ps
  4. 230 ps
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

An output should remain 0 during a single-input transition but briefly rises to 1. What hazard does this demonstrate?
  1. Static-1 hazard
  2. Dynamic hazard
  3. Static-0 hazard
  4. Function hazard
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

For F=XY+X′Z, Y=Z=1 and X falls at time 0. Use transport delays: inverter 16 ps, each AND 24 ps, OR 30 ps. During what interval is F low?
  1. 24–40 ps
  2. 54–70 ps
  3. 40–54 ps
  4. 30–46 ps
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A two-input XOR changes from input 00 to 11, but one input arrives first. Why can its output pulse high even with a hazard-free gate implementation?
  1. The XOR gate has stored the old input
  2. A redundant term is missing from XOR
  3. Its final output is required to be 1
  4. An intermediate input word requires 1
Show answerHide answer

Save this lesson to see this answer.

Set 6: Combine blocks and diagnose designs10 Practice Questions

Save this lesson to see every answer and practice every set.

Question 1 of 10

A combinational XOR output feeds two later gates, and no output is connected back to an earlier node. Does this shared signal alone create stored state?
  1. Yes; two loads make a stored value
  2. Yes; sharing creates a feedback loop
  3. No; sharing does not add storage
  4. No; clockless circuits cannot store state
Show answerHide answer

Save this lesson to see this answer.

Question 2 of 10

A four-bit binary position word changes from 0111 to 1000. What are the reflected Gray words at the two endpoints, and how many bits differ?
  1. 0100 to 1100; one bit
  2. 0111 to 1000; four bits
  3. 0100 to 1000; two bits
  4. 0011 to 1100; four bits
Show answerHide answer

Save this lesson to see this answer.

Question 3 of 10

A four-bit adder-subtractor computes 1010−0011. What are the low result, unsigned no-borrow carry, and signed overflow?
  1. 0111; carry 1; overflow 1
  2. 0111; carry 0; overflow 1
  3. 0111; carry 1; overflow 0
  4. 1001; carry 1; overflow 1
Show answerHide answer

Save this lesson to see this answer.

Question 4 of 10

A BCD adder computes 68+57. What hundreds, tens, and units BCD groups should it produce?
  1. 0001 0001 1111
  2. 0001 0010 0101
  3. 0000 1100 0101
  4. 0001 0011 0101
Show answerHide answer

Save this lesson to see this answer.

Question 5 of 10

A four-bit block has G3:0=1 and P3:0=0. What is its carry-out for incoming carries 0 and 1 respectively?
  1. 0, then 0
  2. 0, then 1
  3. 1, then 0
  4. 1, then 1
Show answerHide answer

Save this lesson to see this answer.

Question 6 of 10

A carry-select unit has low-block carry ready at 300 ps and upper candidates ready at 260 ps. The final mux takes 80 ps. A ripple alternative settles in 620 ps. How much delay does carry select save?
  1. 80 ps
  2. 320 ps
  3. 240 ps
  4. 360 ps
Show answerHide answer

Save this lesson to see this answer.

Question 7 of 10

An unsigned comparator is reused for signed four-bit values by preprocessing that preserves signed order for every operand pair. For A=1101 and B=0010, what transformed words and relation should it use?
  1. 0101 and 1010; A<B
  2. 1101 and 0010; A>B
  3. 0101 and 0010; A>B
  4. 1101 and 1010; A>B
Show answerHide answer

Save this lesson to see this answer.

Question 8 of 10

A 4-to-1 mux implements F=Σm(0,1,4,7) of variables A, B, C, but its selects are S1=B and S0=A. What data inputs I₀ through I₃ are needed?
  1. 1,0,C′,C
  2. C′,1,0,C
  3. 1,C,0,C′
  4. 1,C′,0,C
Show answerHide answer

Save this lesson to see this answer.

Question 9 of 10

A decoder has active-low enable and active-low outputs. Its address stays at 01 while data D on its enable changes from 1 to 0. What happens to selected output 1 and the others?
  1. Output 1 rises; others remain 0
  2. Output 1 falls; others remain 1
  3. Output 1 stays 1; others fall
  4. Output 1 falls; others remain 0
Show answerHide answer

Save this lesson to see this answer.

Question 10 of 10

A mux implements Y=S′D0+SD1+D0D1. Both data inputs are stable at 1 while S changes. What role does the final product play?
  1. It changes the selected input index
  2. It stores the earlier output value
  3. It holds Y high during selection
  4. It forces the output to equal S
Show answerHide answer

Save this lesson to see this answer.

Stuck on your own question? Homework Help

Key Terms

77 Key Terms, each with its definition

A

Active-low signal
An active-low signal is asserted at logic 0 and inactive at logic 1, often shown with a bubble or a complemented name.
The selected line of an active-low decoder is its single low output, not one of the high outputs.
Acyclic network
An acyclic network has no directed connection path that returns through the gates to a point already visited.
A forward chain of AND, OR, and XOR gates has no feedback path leading back to an earlier gate.
Adder-subtractor
An adder-subtractor uses a mode signal to pass or complement the second operand and set the initial carry for addition or subtraction.
Mode 1 inverts every B input and supplies carry-in 1, making the hardware compute A − B.

B

BCD adder
A BCD adder adds two valid decimal-digit codes and a carry-in, then corrects the binary total to a digit and decimal carry.
A BCD stage turns the binary total for 7 + 6 into digit 3 and a carry to the tens position.
BCD correction
BCD correction adds six to a digit’s low binary sum when the total exceeds nine, skipping the six unused digit codes.
For total 12, adding 0110 to low sum 1100 leaves digit 0010 and decimal carry 1.
Binary-coded decimal
Binary-coded decimal encodes each decimal digit separately as a four-bit binary value from 0000 through 1001.
Decimal 62 is BCD 0110 0010, with one group for digit 6 and another for digit 2.
Block carry lookahead
Block carry lookahead computes generate and propagate for bit groups, reducing serial carry travel to links between those groups.
An adder split into four-bit blocks passes carry through fewer serial links than a bitwise ripple chain.
Borrow
A borrow supplies two units to a binary column by taking one unit from the next more significant column during subtraction.
A column computing zero minus one needs a borrow before it can leave difference bit one.
Bus contention
Bus contention occurs when enabled output drivers attempt conflicting levels on a shared wire, causing current flow and an undefined level.
One driver forcing 1 while another forces 0 can heat the drivers during an unsafe bus handover.

C

Carry-in
A carry-in is the extra bit entering an addition stage from the lower column or from the adder’s initial carry input.
In an adder built from two four-bit blocks, the upper block receives the lower block's carry-out as its initial carry-in.
Carry-out
A carry-out is the bit passed above an addition stage; the final carry extends an unsigned sum beyond its original word width.
Adding unsigned 14 and 3 in four bits gives low sum 0001 with final carry-out 1.
Carry-select adder
A carry-select adder precomputes upper blocks for both possible carry-ins and uses multiplexers to select the correct result.
When the actual carry arrives, the upper sum is already available in one of the two copies.
Circuit analysis
Circuit analysis determines the output functions of an existing network by following its gates or evaluating a truth table.
An analyst computes intermediate signals before using them to calculate the final output for input 101.
Code converter
A code converter is a combinational circuit that translates a code word into another representation of the same information.
Adding binary 0011 to a valid BCD digit produces its matching excess-3 representation.
Combinational circuit
A combinational circuit produces settled outputs from its present input values alone, without using stored history.
Repeating the same inputs to a full adder produces the same settled sum and carry outputs.
Comparator cascade
A comparator cascade combines smaller comparison blocks so that a lower block decides only when the higher blocks are equal.
The low-half greater-than result is gated by high-half equality before it contributes to the word decision.
Consensus term
A consensus term is a logically redundant product that can bridge a timing gap between product terms during a single-input change.
Adding BC to AB+A′C holds the output high while A changes with B and C fixed at 1.
Constant data input
A constant data input is a mux input tied to 0 or 1 because its selected output does not depend on the remaining function variable.
Equal pair (1, 1) means the data input is fixed high for both values of the remaining variable.
Contamination delay
Contamination delay is the minimum specified time from an input change before an output can begin changing from its old value.
A 20 ps contamination-delay bound guarantees the old output for the first 20 ps after an input change.
Critical path
The critical path is the input-to-output path with the largest sum of maximum gate delays, setting the circuit’s settling-time bound.
Speeding up a shorter parallel branch leaves the overall propagation delay unchanged if the critical path remains.

D

Decimal carry
A decimal carry is the unit passed to the next decimal digit when a BCD digit total reaches ten or more.
The units stage of 58 + 27 passes one carry so that the tens stage computes 5 + 2 + 1.
Decoder
A binary decoder asserts one indexed output for an enabled input code, expanding n address bits into up to 2ⁿ separate lines.
Address 110 selects line 6 of an enabled 3-to-8 binary decoder, according to its output polarity.
Demultiplexer
A demultiplexer routes one data input to the output named by its select word and leaves all other outputs at their inactive levels.
An active-high 1-to-4 demux with select 10 makes only output 2 follow the incoming data signal.
Digit stage
A digit stage is one BCD addition block that handles a single decimal place and passes its decimal carry to the next place.
A three-digit decimal adder connects separate units, tens, and hundreds stages through carries.
Don't-care condition
A don't-care condition permits either 0 or 1 as an output for an input case, allowing the designer to simplify the implementation.
An invalid BCD row can be marked X when the surrounding system excludes that input from operation.
Dynamic hazard
A dynamic hazard is the potential for an output to change three or more times during a transition that should produce one change.
An output sequence 1 → 0 → 1 → 0 contains extra transitions before reaching its intended final value.

E

Enable
An enable is a control signal that allows a block to operate when asserted and forces its specified inactive behavior otherwise.
A disabled active-high-output decoder leaves all selection lines low even if its address changes.
Encoder
A simple encoder produces the binary index of a single active input line and relies on the input satisfying that one-active-line condition.
If only request line 5 is active in an eight-input encoder, the three output code bits are 101.
Excess-3 code
Excess-3 code represents a decimal digit by the four-bit binary value obtained by adding three to that digit.
Decimal digit 6 becomes excess-3 word 1001 because its encoded binary value is nine.

F

Fan-in
Fan-in is the number of inputs to a gate; growing fan-in makes wide flat carry-lookahead expressions harder to implement quickly.
In a flat four-bit carry-lookahead equation for carry-out, the last product requires five signals at one AND gate.
Full adder
A full adder adds two operand bits and a carry-in, producing one sum bit and a carry-out for the next column.
Three input 1s produce sum 1 and carry 1, which together encode the arithmetic total of three.
Full subtractor
A full subtractor subtracts an operand bit and a borrow-in from another bit, producing a difference and borrow-out.
For inputs 0, 1, and borrow-in 1, the difference is 0 and borrow-out is 1, representing −2.
Function hazard
A function hazard occurs when several changing inputs pass through an intermediate combination whose required output differs from the endpoints.
Adding redundant terms cannot make XOR stay low through a skewed 00-to-11 change without altering its function.

G

Generate
Generate is the bit signal that is 1 when both operand bits are 1, meaning that the stage creates a carry regardless of carry-in.
At an operand-bit pair 11, generate is 1 even when no carry arrives from the lower stage.
Glitch
A glitch is a short unwanted output pulse that can arise when related input changes travel through paths with unequal delays.
A mux output can briefly fall during selection even when both the old and new data inputs are 1.
Gray code
Reflected Gray code orders bit patterns so that each neighboring value differs in exactly one bit position.
At an adjacent position change, a Gray-coded sensor changes one code bit instead of several.
Group generate
Group generate indicates that a block creates an outgoing carry from its own operand bits, independently of its incoming carry.
A carry generated low in a block contributes to group generate when all higher bits pass it onward.
Group propagate
Group propagate is the AND of a block’s bit-propagate signals, indicating that an incoming carry can pass through the entire block.
If one stage kills the carry, the four-bit group-propagate signal must be 0.

H

Half adder
A half adder adds two input bits and produces their low sum bit with XOR and their carry bit with AND.
When both inputs are 1, the half adder produces carry 1 and sum 0, the binary total 10.
Half subtractor
A half subtractor computes the difference of two bits and reports a borrow when the first bit is 0 and the second is 1.
Subtracting input B = 1 from A = 0 gives difference 1 while borrowing from the next column.
Hierarchical design
Hierarchical design builds a large circuit from smaller verified blocks or repeated slices with defined input and output roles.
An eight-bit adder can be assembled from two four-bit blocks by joining their carry connections.

I

Inactive level
An inactive level is the unasserted logic state of a signal, which is 0 for active-high signals and 1 for active-low signals.
Unselected active-low demux outputs stay at 1 while the selected output follows its data input.
Internal node
An internal node is a connection inside a circuit that carries an intermediate signal between gates or blocks.
Naming an XOR output T makes it easier to follow that shared signal into both sum and carry logic.

L

Least significant bit
The least significant bit is the bit with the smallest place value in a word, indexed as bit 0 and written on the right.
The carry trace for an ordinary binary addition begins at the rightmost operand-bit pair.
Lookup table
A lookup table implements a function by storing or fixing the output for each input combination and selecting the indexed value.
A mux with constant data inputs supplies the truth-table output named by its select word.

M

Magnitude comparator
A magnitude comparator reports whether one input word is greater than, equal to, or less than another under the chosen number reading.
An unsigned comparator places 1000 above 0111, while their signed ordering is reversed.
Minterm
A minterm is an AND of every input variable in true or complemented form, equal to 1 on exactly one truth-table row.
For input order ABC, row 101 has minterm AB′C, which is 1 only on that input row.
Most significant difference
The most significant difference is the highest bit position where two words differ, which determines their unsigned magnitude order.
In 1001 versus 0111, the top bit decides even though every lower bit favors the second word.
Multilevel lookahead
Multilevel lookahead applies carry-lookahead equations to groups of blocks, computing block carries through a hierarchy of levels.
A second lookahead unit combines the group signals of four four-bit blocks in a 16-bit adder.
Multiplexer
A multiplexer passes one selected data input to a single output, with the select word giving the index of the chosen input.
Select word 11 makes a 4-to-1 mux pass input 3, whether that input currently holds 0 or 1.
Mux tree
A mux tree connects smaller multiplexers in successive levels so that many candidate inputs are reduced to one selected output.
Sixteen data inputs need fifteen 2-to-1 mux cells arranged in four selection levels.

N

No-borrow flag
A no-borrow flag is the carry-out of complement-and-add unsigned subtraction, asserted when the first operand is at least the second.
Unsigned 9 − 4 produces carry-out 1, confirming that subtraction did not require a borrow.

O

One-hot selection
One-hot selection asserts exactly one line in a group, representing an index through the position of the asserted signal.
An enabled active-high decoder with address 01 produces one-hot pattern 0010 on lines 3 through 0.
Output pair
An output pair lists a function’s two values for one fixed select setting, first with the remaining variable 0 and then with it 1.
The pair (1, 0) requires the complemented remaining variable at the corresponding mux data input.

P

Path delay
A path delay is the sum of gate delays along one connected route from an input to an output, including any inverters on that route.
An AND–OR–AND route with delays 30, 35, and 30 ps has a maximum path delay of 95 ps.
Prefix adder
A prefix adder combines generate and propagate information in a tree to compute the carries needed at successive word positions.
A wider prefix adder adds tree levels as the word grows instead of one serial carry stage per bit.
Priority
Priority is the ordering that determines which active request wins when several inputs are asserted at the same time.
A valid high-group request overrides all low-group requests in a hierarchical priority encoder.
Priority encoder
A priority encoder reports the index of the highest-priority active input, resolving combinations with more than one active request.
With higher indices taking priority, active request lines 1 and 2 produce code 10, for line 2.
Propagate
XOR-propagate is the bit signal that is 1 when exactly one operand bit is 1, allowing an incoming carry to pass onward.
At operand-bit pair 10, the outgoing carry equals the incoming carry because propagate is 1.
Propagation delay
Propagation delay is the maximum specified time from an input change until an output settles to the value for the new stable inputs.
A 95 ps propagation-delay bound means the final output is available after that settling interval.

R

Remaining variable
The remaining variable is the function input left off the select lines in the smaller-mux method and used to form data-input functions.
With A and B on a 4-to-1 mux’s selects, each data input can depend on the remaining variable C.
Ripple-carry adder
A ripple-carry adder chains bit adders so that each carry-out becomes the carry-in of the next more significant stage.
A low-end carry in 1111 + 0001 must reach the top of the word before the complete result settles.

S

Select line
A select line is a control bit that helps identify which data input or output participates in a routing operation.
Four select lines provide sixteen possible indices for a 16-to-1 mux’s data inputs.
Self-complementing code
A self-complementing decimal code yields the representation of digit 9 − d when every bit of the code for digit d is inverted.
Complementing excess-3 word 0100 for digit 1 gives 1011, the excess-3 word for digit 8.
Sequential circuit
A sequential circuit contains stored state, so its behavior depends on past events as well as current input values.
A register keeps an earlier value even after the signal that supplied that value has changed.
Sign bit
The sign bit is the most significant bit of a two’s complement word, with a negative place weight and value 1 for negative numbers.
In four-bit two’s complement, 1000 is −8, so its leading 1 has weight −8 rather than +8.
Signed overflow
Signed overflow occurs when an arithmetic result lies outside the range representable by the chosen two’s complement word width.
Four-bit 6 + 3 gives stored bits 1001 and overflow because positive nine cannot fit.
Specification
A specification states the required circuit behavior, including signal meanings and the outputs required for allowed input cases.
A voter that passes with at least two approvals must also pass when all three inputs are 1.
Static-0 hazard
A static-0 hazard is the potential for a brief high output pulse during an input transition for which the output should remain 0.
A temporary rising pulse between two settled zero-output states is classified as a static-0 glitch.
Static-1 hazard
A static-1 hazard is the potential for a brief low output pulse during an input transition for which the output should remain 1.
The terms AB and A′C can leave a timing gap while A changes and B and C stay 1.
Sum of products
A sum of products is a Boolean expression that ORs together AND terms, each made from input variables or their complements.
The expression AB+AC+BC for a two-of-three voter directly describes three AND gates feeding one OR gate.

T

Three-state buffer
A three-state buffer drives its input value when enabled and disconnects its output at high impedance when disabled.
Turning off a bus driver puts it in state Z so another enabled driver can control the shared wire.
Time-division multiplexing
Time-division multiplexing lets several source-destination pairs use a shared link in different time slots with coordinated selection.
A sender mux and receiver demux both select channel 2 during the slot assigned to that channel.
Two's complement
Two's complement represents signed integers with a negative weight on the MSB; negation inverts the bits and adds one.
The four-bit word 1101 represents −3 because its weighted value is −8 + 4 + 1.

V

Valid output
A valid output indicates that at least one encoder input is active, separating no request from a genuine zero-index request.
An encoder code of 00 is meaningful for input 0 only when its valid signal is also asserted.
Verification
Verification checks that a circuit implements its specified behavior, including checking the table against the original requirement.
Comparing gates with a table alone would miss a voter's table that mistakenly omitted the case where all inputs approve.

X

XNOR
An XNOR operation produces 1 for equal input bits and 0 for unequal input bits, making it a bitwise equality test.
ANDing four bit-pair XNOR outputs checks whether two complete four-bit words are equal.

About this lesson

By StudeliReport a mistake

Make your own Study Materials

Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.

Get Started