- Learn
- Engineering
- Electrical Engineering
- Digital Logic Design
- Combinational Logic Circuits
Combinational Logic Circuits
BeginnerLesson 3 of 7 in Digital Logic Design Course
What you will learn
- 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 computesRecognize 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 specificationFollow the design procedure from a problem statement to a truth table, simplified expressions, a gate diagram and a final check.
- Convert between binary codesDesign code converters for BCD, excess-3 and Gray code, using unused input patterns as don't-cares or with a standard adder block.
- Work out what a gate diagram computes
- 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 addersDerive 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 adderChain 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 overflowUse 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 adderAdd two BCD digits with a binary adder, detect when the binary sum needs correcting, add 6, and chain digit stages.
- Build half adders and full adders
- 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 propagateDefine 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 addersEstimate 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.
- Compute carries in parallel with generate and propagate
- Design magnitude comparators, decoders and encoders, connect them into larger blocks, and use decoders to implement Boolean functions.
- Compare two binary numbersDesign 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 linesExplain 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 priorityDesign simple and priority encoders, explain why a valid output is needed, and read truth tables that use don't-care inputs.
- Compare two binary numbers
- 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 multiplexerDescribe 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 multiplexersUse 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 demultiplexerExplain 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.
- Select one of several inputs with a multiplexer
- 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 pathAdd 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 glitchesExplain how unequal path delays cause glitches, trace a glitch through a timing example, remove it with a consensus term, and judge when glitches matter.
- Find propagation delay, contamination delay and the critical path
Combinational Logic Circuits study guide
1Analyze 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 , suppose the connections give:
Substitution gives and . 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.
| A | B | C | T₁ | T₂ | T₃ | F | G |
|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 | 1 | 0 | 1 | 1 |
For input 101, the first XOR gives 1, the second gives 0, and the carry branches give 0 and 1. Thus . The table shows that is odd parity and is the majority function. Together they form a full adder: the binary number 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 . De Morgan's law gives , not . For input 10, the NAND gives 1 while 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 , where 1 means “pass.” The result must be 1 when at least two judges vote to pass. The successful rows are 011, 101, 110, and 111. With as the most significant input, those are minterms 3, 5, 6, and 7:
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: . You may therefore reuse while combining terms:
The result is . 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 and , a single AND gate can supply 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 , the MSB:
This detects 1010–1111 while leaving 1000 and 1001 valid, because their and bits are both 0.
Convert BCD to excess-3
Excess-3 represents digit with the binary value . 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 and outputs , one resulting set of functions is:
For digit 5, the input is 0101. Then , , , and , producing 1000. Its ordinary binary value is 8, which equals . 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 gives the code for . 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:
For binary 1011, copy 1, then compute , , and . The Gray word is 1110. An -bit converter needs XOR gates because the MSB is a direct connection.
Recover binary from Gray
The reverse conversion uses the binary bit just recovered:
For Gray 1110, the recovered bits are 1, then , then , then . 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.
2Add 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 , sum , and carry :
| A | B | Carry | Sum |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 0 |
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 from the lower column. Its outputs satisfy the arithmetic identity , where the right side is an ordinary numerical total.
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 , not .
Build a full adder from half adders
First add and , giving intermediate sum and carry . Add and in the second half adder. Its sum is the final , and its carry is . OR the two carry outputs:
The carries cannot both be 1: makes . 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 borrow is needed for . 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:
Its numerical check is . For inputs , the outputs are , and . 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 receives and produces . Bit 0 is the least significant bit, written on the right of the word. Set for ordinary addition. The final carry sits one place to the left of the 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.
| Stage | Input-bit total | Sum bit | Carry to next stage |
|---|---|---|---|
| 0 | 0 + 1 + 0 = 1 | 1 | 0 |
| 1 | 1 + 1 + 0 = 2 | 0 | 1 |
| 2 | 1 + 1 + 1 = 3 | 1 | 1 |
| 3 | 0 + 0 + 1 = 1 | 1 | 0 |
Reading 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 . 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 -bit ripple adder is:
Here 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 -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 mode signal drives an XOR on each input and also the initial carry. When , the XORs pass and the carry-in is 0, giving addition. When , the XORs invert and the carry-in is 1, giving subtraction. Forgetting that final 1 would compute .
For 0110 − 0011, invert 0011 to 1100. Then . Keep the four result bits 0011 and record carry-out 1 separately.
Read carry for unsigned arithmetic
| Operation | Meaning of carry-out |
|---|---|
| Unsigned addition | 1 means the total exceeds the word's range. |
| Unsigned subtraction using complement-and-add | 1 means no borrow; 0 means a borrow. |
For 0011 − 0110, with carry-out 0. As unsigned operands, 3 is smaller than 6 and a borrow is required. The four result bits represent 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:
These are the carry out of and the carry into the MSB stage, taken from the adder itself. For , the bit result is 1001. The carry into the sign stage is 1 and the carry out is 0, so . The true result 9 is outside −8 through 7; interpreting 1001 as −7 would be wrong.
In contrast, represents . Both sign-stage carries are 1, so despite carry-out 1. Carry-out alone cannot diagnose signed overflow.
Check subtraction at the signed boundary
For , the signed calculation is . The adder computes . Its sign-stage carries are 1 and 0, so overflow is correctly reported.
The same carry rule handles subtracting the most negative value. With , the adder actually receives 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 and its low sum bits , 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 .
The correction signal is:
The carry detects totals 16–19. The other terms detect low sums 10–15. Testing 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 to the low sum. This is 0110 when correction is needed and 0000 otherwise. The decimal carry is itself, not the carry-out of this second adder.
For 8 + 5, the binary total is 01101, giving and . Since , correction is required. Adding 0110 gives . The BCD digit is 0011 (3), and decimal carry 1 supplies the tens digit.
For 9 + 9 + 1, the total is 10011. Now and , so even though the low bits look like a valid digit. Correction gives , 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 gives digit 5 and carry 1. The tens stage adds , 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.
3Speed 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 , define:
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:
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 into the equation for , then continue:
Each product describes a carry source and every stage it must pass. For example, means bit 1 generates and bits 2 and 3 propagate. It does not need , 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 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 and , and . Take .
- : bit 0 propagates, but there is no incoming carry.
- : bit 1 generates.
- : bit 2 propagates the carry from bit 1.
- : bit 3 also propagates it.
XOR each 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:
Then . 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, . 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 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 -bit word into blocks of bits. Each block computes bit and group generate/propagate signals in parallel with the other blocks. A block carry obeys:
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:
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:
For 16 bits in four-bit blocks, the estimate is ps. Ripple carry takes ps. For 32 bits, the same block method gives 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 .
A prefix adder combines group generate/propagate information in a tree, forming the needed carries in roughly 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.
| Structure | How it handles carry | Main cost or limitation |
|---|---|---|
| Ripple | Passes it through bit cells | Delay grows with word length |
| Block lookahead | Computes bit groups, then passes block carries | Extra group logic; block chain remains |
| Multilevel or prefix | Combines group information through levels | More gates and wiring |
| Carry select | Computes both incoming-carry cases | Duplicated 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.
4Compare, 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 . Two four-bit words are equal only when all four pairs match:
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 and a 0 in means . Differences below that position cannot reverse the result. The four-bit expression is:
The equality factors allow a lower position to decide only if every higher position matches. For and , bits 3 and 2 match. Bit 1 is the first difference, and , so . Bit 0 does not affect that decision.
Swap and in each unequal-bit test to form less than. Since exactly one of the three decisions is true, you can also obtain after building greater-than and equality.
Cascade word sections
Two four-bit comparators can compare eight-bit words. Let the high-half outputs be and the low-half outputs be . Then:
The high half decides unless it is equal. ORing and 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 . For unsigned inputs, carry-out 1 means . 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 and overflow :
Without overflow, a negative difference means less than. Overflow reverses the apparent sign, which is why alone is insufficient. For example, four-bit produces 1001, whose sign bit is 1, but overflow is also 1. Their XOR is 0, correctly rejecting .
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 -to- 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 , the output functions are:
Each is a minterm. For input 10, only is 1. An active-high enable changes each equation to . When , 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 can supply both full-adder outputs:
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 . 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 through and output bits . Each output ORs the input indices with a 1 in that binary position:
If only , the code is 110. But if and 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 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 highest and lowest, output bits and valid signal can be:
The factor 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 , the priority result is code 10 with . For 0001, the result is code 00 with . For 0000, and the code bits have no valid meaning.
Read compressed input rows
| Input pattern | Code | Valid |
|---|---|---|
| 1XXX | 11 | 1 |
| 01XX | 10 | 1 |
| 001X | 01 | 1 |
| 0001 | 00 | 1 |
| 0000 | XX | 0 |
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.
5Route 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 select bits, it can choose among data inputs.
Start with a two-input selection
For select , the 2-to-1 mux function is:
When , only the product can contribute. When , only the 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 , with most significant:
Select 01 chooses and select 10 chooses . 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 . The final mux receives 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 -input tree uses 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 -variable function, an -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 -variable function can also fit a mux with only selects. Use those variables to choose pairs of rows, and let the remaining variable determine the output within each pair.
Call the remaining variable . For each select setting, read the output first at , then at :
| Output pair | Connect the data input to |
|---|---|
| 0, 0 | 0 |
| 1, 1 | 1 |
| 0, 1 | z |
| 1, 0 | z′ |
The order within the pair matters. A 1 followed by a 0 is an inversion, not a copy of .
Build a three-input majority function
Let be the selects and the remaining variable. For , the majority output is 0 for both values of , so . For 01 and 10, a second 1 is needed, so the output follows . For 11, a majority already exists, so the output is always 1. The connections are:
This implements the same function as through selection instead of three explicit product terms.
Use all four data choices
For , the truth-table output pairs in order are:
- 00: rows 0 and 1 give (0, 1), so .
- 01: rows 2 and 3 give (1, 0), so .
- 10: rows 4 and 5 give (1, 1), so .
- 11: rows 6 and 7 give (0, 0), so .
At input 101, the select 10 chooses constant 1, correctly producing the value of minterm 5. If and 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:
Here is the data input and is the select minterm for output . With select 11 and , output 3 is 1 and all others are 0. Holding select 11 and changing makes only output 3 follow the data.
When , 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 . Connecting the data signal to 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 to that enable, and the selected line follows 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 , while a demux at the receiving end chooses destination . 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.
6Analyze 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, , is the maximum time until the output reaches its final value. Contamination delay, , 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 change | What the timing specification guarantees |
|---|---|
| Before contamination delay | The output retains its old value. |
| Between contamination and propagation delay | The output may change, including temporary values. |
| After propagation delay | The 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 . Build it from AND1 on , then an OR with , then AND2 with . Each AND has ps and ps; the OR has ps and ps.
- From or : maximum delay ps.
- From : maximum delay ps.
- From : maximum delay 30 ps.
The critical path starts at or and gives 95 ps. For the minimum bound, the paths take 65 ps, 45 ps, and 20 ps respectively. The shortest starts at , 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
| Hazard | Intended output behavior | Possible actual behavior |
|---|---|---|
| Static-1 | Stay at 1 | Brief drop to 0 |
| Static-0 | Stay at 0 | Brief rise to 1 |
| Dynamic | Change once | Three 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 with . Let fall from 1 to 0 at time 0. The initial term and final term 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.
- rises at 10 ps.
- falls at 20 ps.
- rises at 30 ps.
- 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:
The added term is logically redundant. If , either activates or activates , so the settled function was already 1. But the physical path does not depend on the changing . With , 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: . When both data inputs are 1, a select change can produce a low glitch. Adding 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
1Turn gates and requirements into checked functions
14 steps
- 1IntroductionFollow 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.
- 2ExplanationName the gate outputs
Start with gates whose inputs are already known. Give their outputs names before substituting long expressions.
Suppose the first XOR produces . A second XOR produces . The carry branch is .
The shared signal feeds two places but is computed once. No storage or feedback is introduced just because one gate output has several destinations.
- 3ExampleTrace one complete input row
Take input in that network.
- .
- .
- and , so .
Thus the output pair is 10, the binary total of the three input bits. Repeating the process for all eight rows shows that is odd parity and is majority: the network is a full adder.
- 4ChallengeKeep the inversion in place
A NAND produces and a later AND produces . For input , what are and ?
---reveal---
The input AND is , so the NAND gives . Then . Writing would wrongly give 0. The bubble complements the whole AND result, not both inputs of another AND.
- 5ExplanationTranslate a voting rule
Three inputs 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 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.
- 6ExampleSimplify the voter
The direct expression is:
Use in each pair; Boolean OR allows a repeated term without changing the function. Combining gives , , and , so:
Three 2-input AND gates feed an OR gate. Check 100: no pair is active, so the output is 0. Check 110: , so the output is 1.
- 7ChallengeChange the required behavior
A different voter must output 1 for exactly two active inputs. What happens if you reuse 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 . Verification must check the table against the wording as well as the gates against the table.
- 8TipTreat 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.
- 9ExampleConvert 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:
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 .
- 10ExplanationBuild the forward Gray conversion
Copy the binary MSB. Each lower Gray bit is the XOR of neighboring binary bits:
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.
- 11ExampleReverse Gray one bit at a time
Recover binary from Gray 1110 by copying the first bit and working downward.
- Copy .
- .
- .
- .
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.
- 12ChallengeRecover a fresh Gray word
Convert reflected Gray word 1101 to binary. Work from the MSB down.
---reveal---
Copy 1, then compute , , and . 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.
- 13ChallengeSpecify an invalid-input indicator
A BCD converter must report invalid words as well as convert valid digits. Its error output is . 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 . 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.
- 14RecapCheck 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.
2Build arithmetic from bit cells
17 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionSeparate result bits from flags
- 2ExplanationGive each output its proper weight
- 3ExampleUse two half adders
- 4ChallengeAccount for every bit in the cell
- 5ExplanationConnect the carry chain
- 6ExampleCompute the low two stages
- 7ExampleFinish and read the word
- 8ChallengeKeep a carry beyond the word
- 9ExplanationSwitch one adder into subtraction
- 10Key InsightRead no-borrow and overflow separately
- 11ChallengeDiagnose a subtraction result
- 12ExplanationCorrect a decimal column
- 13ExampleCorrect a total below sixteen
- 14ExampleKeep the carry for a total above fifteen
- 15ChallengeAdd two decimal columns
- 16ChallengeChoose the meaning of the same sum
- 17RecapCarry the correct information onward
3Move carries through equations and blocks
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionShorten the carry dependency
- 2ExplanationSeparate generating from passing
- 3ExampleSubstitute out an intermediate carry
- 4ExampleForm the signals for an addition
- 5ExampleFinish the sum from the carries
- 6ChallengePredict a carry without a full sum
- 7ExplanationGive four bits one block description
- 8ExampleCompare a sixteen-bit estimate
- 9ConnectionBuild a higher carry level
- 10ChallengeTime a carry-select decision
- 11ChallengeCheck an OR-propagate redesign
- 12RecapSpend hardware to reduce waiting
4Make comparisons and select indexed lines
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionRead decisions in the right order
- 2ExplanationLet the high difference win
- 3ExampleTrace an unsigned comparison
- 4ChallengeRepair the signed ordering
- 5ExplanationTurn an index into one active line
- 6ExampleBuild two functions from one decoder
- 7ChallengeChoose a bank and a local line
- 8ExplanationResolve several requests
- 9ExampleSuppress the lower request
- 10ChallengeSeparate zero index from no request
- 11ChallengeConnect priority selection to decoding
- 12RecapPreserve priority, polarity, and validity
5Select sources, implement functions, and route data
13 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionControl where the data travels
- 2ExplanationRead the select as an index
- 3ExampleBuild a wider selector in stages
- 4ChallengeCount a mux tree
- 5TipDisconnect before another driver starts
- 6ExplanationTurn two rows into one data input
- 7ExampleWire the first half of a function
- 8ExampleComplete and check the connections
- 9ChallengeImplement a different row pattern
- 10ExplanationSend one signal to an indexed output
- 11ChallengeTest whether the destination remembers
- 12ChallengeCoordinate both ends of the link
- 13RecapKeep the index and data roles clear
6Find settling times and trace a glitch
12 steps
Save this lesson to follow every Walkthrough step by step.
- 1IntroductionAdd timing to the truth table
- 2ExplanationUse the right bound for the question
- 3ExampleList the maximum path totals
- 4ExampleFind the earliest possible change
- 5ChallengeFind both bounds in a fresh network
- 6ExplanationWatch the two terms hand over
- 7ExampleTime the internal gap
- 8ExampleMove the gap to the output
- 9Key InsightSupply a path that does not switch
- 10ChallengeBridge a different handover
- 11ChallengeDecide when waiting is enough
- 12RecapCheck final behavior and transitions
Combinational Logic Circuits practice questions
Set 1: Trace arithmetic and interpret flags10 Practice Questions
Question 1 of 10
Show answerHide answer
Question 2 of 10
Show answerHide answer
Question 3 of 10
Show answerHide answer
Question 4 of 10
Show answerHide answer
Question 5 of 10
Show answerHide answer
Question 6 of 10
Show answerHide answer
Question 7 of 10
Show answerHide answer
Question 8 of 10
Show answerHide answer
Question 9 of 10
Show answerHide answer
Question 10 of 10
Show answerHide answer
Set 2: Read, specify, and calculate10 Practice Questions
Save this lesson to see every answer and practice every set.
Question 1 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
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
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
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
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
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
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
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
Show answerHide answer
Save this lesson to see this answer.
Question 2 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 3 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 4 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 5 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 6 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 7 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 8 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 9 of 10
Show answerHide answer
Save this lesson to see this answer.
Question 10 of 10
Show answerHide answer
Save this lesson to see this answer.
Stuck on your own question? Homework Help
Key Terms
A
Active-low signal
Acyclic network
Adder-subtractor
B
BCD adder
BCD correction
Binary-coded decimal
Block carry lookahead
Borrow
Bus contention
C
Carry-in
Carry-out
Carry-select adder
Circuit analysis
Code converter
Combinational circuit
Comparator cascade
Consensus term
Constant data input
Contamination delay
Critical path
D
Decimal carry
Decoder
Demultiplexer
Digit stage
Don't-care condition
Dynamic hazard
E
Enable
Encoder
Excess-3 code
F
Fan-in
Full adder
Full subtractor
Function hazard
G
Generate
Glitch
Gray code
Group generate
Group propagate
H
Half adder
Half subtractor
Hierarchical design
I
Inactive level
Internal node
L
Least significant bit
Lookup table
M
Magnitude comparator
Minterm
Most significant difference
Multilevel lookahead
Multiplexer
Mux tree
N
No-borrow flag
O
One-hot selection
Output pair
P
Path delay
Prefix adder
Priority
Priority encoder
Propagate
Propagation delay
R
Remaining variable
Ripple-carry adder
S
Select line
Self-complementing code
Sequential circuit
Sign bit
Signed overflow
Specification
Static-0 hazard
Static-1 hazard
Sum of products
T
Three-state buffer
Time-division multiplexing
Two's complement
V
Valid output
Verification
X
XNOR
About this lesson
Make your own Study Materials
Turn your notes, slides and documents into Study Guides, Practice Questions, Flashcards and 6 more tools.