Unit 3 — Applications of Boolean Algebra
Unit Overview (click to expand)
Welcome to Unit 3, where Boolean algebra leaves the chalkboard and enters the real world. Now it is time to use the rules and identities to design actual digital circuits, starting from plain English descriptions and ending with hardware that performs useful work. The first skill you will develop is translating a word problem into a Boolean equation and a truth table. Real specifications map to identifying inputs, defining outputs, filling in the truth table row by row, and writing the Boolean expression. This translation step is where engineering judgment meets mathematical precision. With that process in hand, we move on to essential building blocks. The half adder takes two single-bit inputs and produces a sum and a carry. The full adder extends that idea by accepting a carry-in from a previous stage, making it possible to chain adders together for multi-bit arithmetic. Magnitude comparators tell you whether one binary number is greater than, less than, or equal to another. We then explore parity generators and checkers for error detection, code converters that translate between different binary codes, and seven-segment display decoders that convert a four-bit binary value into the signals that light up a numeric display. Throughout these designs, you will encounter don't care conditions — input combinations that can never occur or whose output does not matter. Don't cares give you freedom during simplification, and that flexibility often makes the difference between a good design and a great one. **Key Takeaways** 1. Translating English specifications into truth tables and Boolean equations is the essential first step in any digital design workflow. 2. Building blocks like adders, comparators, parity checkers, and display decoders are reusable components that appear throughout digital systems. 3. Don't care conditions provide valuable flexibility during simplification, often enabling significantly smaller and faster circuits.Summary
This unit bridges Boolean algebra theory with practical digital circuit design, demonstrating how to translate real-world problems into working logic circuits. Students will learn systematic methods for converting English specifications into Boolean equations and truth tables, then implementing these as combinational logic circuits. The unit covers essential arithmetic circuits—half adders, full adders, and subtractors—that form the foundation of computer arithmetic units. Additional applications include magnitude comparators for decision-making circuits, parity generators/checkers for error detection, code converters for translating between number representations, and seven-segment display decoders for human-readable output. The concept of incompletely specified functions introduces don't care conditions that enable more efficient circuit implementations.
Concepts Covered
- Combinational Logic
- Sequential Logic
- Logic Circuit
- Circuit Analysis
- Circuit Synthesis
- Specification to Circuit
- Word Problems to Boolean
- Switching Functions
- Binary Decision
- Enable Signal
- Control Signal
- Half Adder
- Full Adder
- Carry Bit
- Sum Bit
- Ripple Carry Adder
- Half Subtractor
- Full Subtractor
- Borrow Bit
- Difference Bit
- Adder Subtractor Circuit
- Comparator Circuit
- Magnitude Comparator
- Parity Generator
- Parity Checker
- Even Parity
- Odd Parity
- Code Converter
- BCD Code
- Gray Code
- BCD to Binary Converter
- Binary to Gray Converter
- Seven Segment Display
- Seven Segment Decoder
- Incompletely Specified Function
Prerequisites
Before beginning this unit, students should have:
- Mastery of Boolean algebra operations and theorems (Unit 2)
- Ability to construct and interpret truth tables
- Understanding of logic gates and their symbols
- Familiarity with binary number representations (Unit 1)
3.1 Combinational vs Sequential Logic
Digital circuits are classified into two fundamental categories based on how they process information.
Combinational logic circuits produce outputs that depend solely on the current input values. There is no memory — the same inputs always produce the same outputs, regardless of what happened before. Examples include adders, decoders, and multiplexers.
Sequential logic circuits produce outputs that depend on both current inputs AND the circuit's previous state (history). These circuits contain memory elements like flip-flops. Examples include counters, registers, and state machines.
| Characteristic | Combinational | Sequential |
|---|---|---|
| Memory | None | Has memory elements |
| Output depends on | Current inputs only | Current inputs + past state |
| Timing | Instantaneous (after propagation) | Clock-synchronized |
| Examples | Adders, decoders | Counters, registers |
This unit focuses exclusively on combinational logic. A logic circuit is any arrangement of logic gates that implements a Boolean function, and our goal is to design circuits that correctly realize specified behavior.
3.2 The Design Process: Specification to Circuit
The process of creating a digital circuit follows a systematic methodology, moving from informal requirements to a working implementation.
Circuit analysis starts with an existing circuit and determines its behavior — deriving the Boolean expression and truth table from the gate connections. This is useful for understanding, verifying, or documenting circuits.
Circuit synthesis starts with a specification (what the circuit should do) and creates a circuit that implements it. This is the primary design activity.
The Synthesis Process
Specification to circuit follows these steps:
- Understand the problem — Identify inputs, outputs, and requirements
- Create truth table — List all input combinations and desired outputs
- Derive Boolean expression — Extract SOP or POS from truth table
- Simplify expression — Apply Boolean algebra or K-maps (Unit 5)
- Draw circuit diagram — Implement the simplified expression with gates
- Verify correctness — Test all input combinations
A switching function is the formal name for a Boolean function that describes circuit behavior, mapping binary inputs to binary outputs.
Diagram: Design Flow Visualization
3.3 Word Problems to Boolean Expressions
Real design problems often begin as English descriptions. Word problems to Boolean conversion requires careful translation of natural language into precise logical statements.
| English Phrase | Boolean Equivalent |
|---|---|
| "A and B" | \(A \cdot B\) |
| "A or B" | \(A + B\) |
| "not A", "A is false" | \(\overline{A}\) |
| "if A then B" | \(\overline{A} + B\) |
| "A only if B" | \(\overline{A} + B\) |
| "A if and only if B" | \(A \odot B\) (XNOR) |
| "exactly one of A, B" | \(A \oplus B\) (XOR) |
| "neither A nor B" | \(\overline{A} \cdot \overline{B}\) |
Example: Security System
Problem: An alarm should sound if the door is open while the system is armed, OR if motion is detected while the system is armed at night.
Step 1: Identify variables
- \(D\) = Door is open, \(A\) = System is armed, \(M\) = Motion detected, \(N\) = Night time, \(F\) = Alarm sounds (output)
Step 2: Translate to Boolean
"door is open while system is armed" → \(D \cdot A\) "motion detected while system is armed at night" → \(M \cdot A \cdot N\) "OR" combines these conditions
Example: Voting System
Problem: A three-person committee approves proposals by majority vote. Design a circuit that outputs 1 when at least two of three members vote yes.
Step 1: Identify variables — \(A\), \(B\), \(C\) = member votes yes; \(F\) = proposal approved
Step 2: Create truth table
| A | B | C | F | Reason |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | No votes |
| 0 | 0 | 1 | 0 | Only 1 vote |
| 0 | 1 | 0 | 0 | Only 1 vote |
| 0 | 1 | 1 | 1 | 2 votes (majority) |
| 1 | 0 | 0 | 0 | Only 1 vote |
| 1 | 0 | 1 | 1 | 2 votes (majority) |
| 1 | 1 | 0 | 1 | 2 votes (majority) |
| 1 | 1 | 1 | 1 | 3 votes (unanimous) |
Step 3: Derive Boolean expression (SOP from rows where F = 1)
Step 4: Simplify — factor and apply Boolean algebra:
Since \(AB\overline{C} + ABC = AB\):
This is the majority function — the output is 1 when any two (or more) inputs are 1. It requires three AND gates and one OR gate.
Binary Decisions and Control Signals
A binary decision is a circuit output that represents a yes/no choice based on input conditions. Many applications involve enable signals and control signals that activate or configure circuit behavior.
An enable signal allows a circuit to operate when active (1) and disables output when inactive (0):
A control signal selects between different operating modes, such as choosing between addition and subtraction in an ALU.
Diagram: Word Problem Translator
3.4 Arithmetic Circuits: Adders
Binary addition is fundamental to computer arithmetic. Digital systems implement addition using specialized circuits built from basic logic gates.
Half Adder
A half adder adds two single-bit inputs (A and B) and produces two outputs: the sum bit (S) and the carry bit (C). It is called "half" because it cannot accept a carry-in from a previous stage.
| A | B | Sum (S) | Carry (C) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
From the truth table:
- Sum = 1 when inputs differ → \(S = A \oplus B\) (XOR)
- Carry = 1 when both inputs are 1 → \(C = A \cdot B\) (AND)
The half adder requires one XOR gate and one AND gate.
Full Adder
A full adder adds three single-bit inputs: A, B, and a carry-in (\(C_{in}\)) from a previous stage. It produces a sum bit (S) and a carry-out (\(C_{out}\)).
| A | B | \(C_{in}\) | Sum (S) | \(C_{out}\) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 |
| 0 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
The Boolean equations are:
A full adder can be built from two half adders and an OR gate, or directly from the Boolean expressions.
Ripple Carry Adder
A ripple carry adder connects multiple full adders to add multi-bit numbers. The carry-out of each stage connects to the carry-in of the next stage, with carries "rippling" through the chain.
For an n-bit ripple carry adder:
- Use n full adders connected in series
- First stage \(C_{in} = 0\) (or a carry-in for subtraction)
- Final \(C_{out}\) indicates overflow (for unsigned) or is discarded (for signed with overflow detection)
Limitation: The ripple carry adder is slow for wide operands because each stage must wait for the previous carry to propagate. An 8-bit addition requires 8 sequential carry propagations.
Carry-Lookahead Adder (Preview)
The ripple carry adder's delay grows linearly with bit width because each carry depends on the previous stage. The carry-lookahead adder (CLA) eliminates this bottleneck by computing all carries simultaneously using two auxiliary signals for each bit position:
- Generate: \(G_i = A_i \cdot B_i\) — stage \(i\) produces a carry regardless of carry-in
- Propagate: \(P_i = A_i \oplus B_i\) — stage \(i\) passes an incoming carry through
Using these signals, each carry can be expressed directly in terms of the original inputs:
Each equation depends only on the original inputs \(A_i\), \(B_i\), and \(C_{in}\) — not on the output of a previous stage. This means all carries are available after just two gate delays (one for G/P, one for the carry equation), regardless of the adder width.
Example (2-bit CLA): For \(A = 11\), \(B = 01\), \(C_{in} = 0\):
- \(G_0 = 1 \cdot 1 = 1\), \(P_0 = 1 \oplus 1 = 0\) → \(C_0 = 1 + 0 \cdot 0 = 1\)
- \(G_1 = 1 \cdot 0 = 0\), \(P_1 = 1 \oplus 0 = 1\) → \(C_1 = 0 + 1 \cdot 1 = 1\)
Result: \(S = 00\) with \(C_{out} = 1\), confirming \(3 + 1 = 4\). Both carries were computed in parallel, not sequentially.
Diagram: Binary Adder Visualizer
3.5 Arithmetic Circuits: Subtractors
Binary subtraction can be implemented directly with subtractor circuits or by using adders with two's complement representation.
Half Subtractor
A half subtractor subtracts one bit (B) from another (A), producing a difference bit (D) and a borrow bit (\(B_{out}\)).
| A | B | Difference (D) | Borrow (\(B_{out}\)) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
The Boolean equations are:
Note: The difference is identical to the sum in a half adder (XOR), but the borrow differs from carry.
Full Subtractor
A full subtractor subtracts B from A while also accounting for a borrow-in (\(B_{in}\)) from a previous stage.
| A | B | \(B_{in}\) | Difference (D) | \(B_{out}\) |
|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 0 | 0 |
| 1 | 1 | 1 | 1 | 1 |
The Boolean equations are:
Adder-Subtractor Circuit
An adder-subtractor circuit uses a single set of full adders to perform both addition and subtraction, controlled by a mode signal M:
- When \(M = 0\): Perform \(A + B\) (addition)
- When \(M = 1\): Perform \(A - B\) (subtraction via two's complement)
The design XORs each bit of B with M:
- If \(M = 0\): \(B \oplus 0 = B\) (unchanged)
- If \(M = 1\): \(B \oplus 1 = \overline{B}\) (complemented)
Setting \(C_{in} = M\) adds 1 when subtracting, completing the two's complement operation:
Overflow Detection
When adding two signed (two's complement) numbers, the result can exceed the representable range. Overflow occurs when two positive numbers produce a negative result, or two negative numbers produce a positive result.
The overflow flag \(V\) can be computed by comparing the carry into the sign bit with the carry out of the sign bit:
Where \(C_{n-1}\) is the carry into the MSB (sign position) and \(C_n\) is the carry out. When these two carries differ, the sign bit has been corrupted.
Example (4-bit signed): Compute \(7 + 1\):
| \(C_3\) | \(A_3\) | \(B_3\) | \(A_2\) | \(B_2\) | \(A_1\) | \(B_1\) | \(A_0\) | \(B_0\) | |
|---|---|---|---|---|---|---|---|---|---|
| Values | 0 | 0 | 1 | 0 | 1 | 0 | 1 | 1 | |
| Carries | \(C_4=0\) | \(C_3=1\) | \(C_2=1\) | \(C_1=1\) | |||||
| Sum | 1 | 0 | 0 | 0 |
Result: \(0111 + 0001 = 1000\) = \(-8\) in two's complement. Since \(V = C_3 \oplus C_4 = 1 \oplus 0 = 1\), overflow is detected. The result should be \(+8\), which cannot be represented in 4-bit signed format (\(-8\) to \(+7\)).
Diagram: Adder-Subtractor Circuit Builder
3.6 Comparator Circuits
Comparator circuits determine the relationship between two binary numbers, producing outputs that indicate whether one number is greater than, less than, or equal to another.
Single-Bit Comparator
For two single bits A and B, three relationships are possible:
| Relationship | Output | Boolean Expression |
|---|---|---|
| A > B | G | \(A \cdot \overline{B}\) |
| A < B | L | \(\overline{A} \cdot B\) |
| A = B | E | \(\overline{A \oplus B} = A \odot B\) |
Magnitude Comparator
A magnitude comparator compares multi-bit numbers. For n-bit inputs, it produces three outputs: \(G\) (A > B), \(L\) (A < B), and \(E\) (A = B).
Design approach for 4-bit comparator: The comparison proceeds from the most significant bit to least significant:
- If \(A_3 > B_3\), then \(A > B\) regardless of other bits
- If \(A_3 < B_3\), then \(A < B\) regardless of other bits
- If \(A_3 = B_3\), compare \(A_2\) with \(B_2\), and so on
The equality output is:
The greater-than output is:
The less-than output is: \(L = \overline{G} \cdot \overline{E}\) (or derive symmetrically).
Design Walkthrough: 2-Bit Magnitude Comparator
Let us design a 2-bit comparator from scratch. Inputs are \(A = A_1A_0\) and \(B = B_1B_0\); outputs are \(G\) (A > B), \(L\) (A < B), and \(E\) (A = B).
Step 1: Truth table (16 rows for two 2-bit inputs)
| \(A_1\) | \(A_0\) | \(B_1\) | \(B_0\) | A (dec) | B (dec) | G | E | L |
|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 0 | 1 | 0 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 0 | 2 | 0 | 0 | 1 |
| 0 | 0 | 1 | 1 | 0 | 3 | 0 | 0 | 1 |
| 0 | 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 | 2 | 0 | 0 | 1 |
| 0 | 1 | 1 | 1 | 1 | 3 | 0 | 0 | 1 |
| 1 | 0 | 0 | 0 | 2 | 0 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 2 | 1 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 2 | 2 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 | 2 | 3 | 0 | 0 | 1 |
| 1 | 1 | 0 | 0 | 3 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 3 | 1 | 1 | 0 | 0 |
| 1 | 1 | 1 | 0 | 3 | 2 | 1 | 0 | 0 |
| 1 | 1 | 1 | 1 | 3 | 3 | 0 | 1 | 0 |
Step 2: Derive expressions using the MSB-first comparison approach:
Step 3: Count gates — \(G\) requires 2 AND gates (one 2-input, one 3-input), 1 OR gate, 1 XNOR gate, and 1 inverter. The cascading approach used in the 74LS85 generalizes this pattern to 4 bits and adds cascade inputs for wider comparisons, which is more practical than expanding the truth table to 256 rows for an 8-bit comparator.
Diagram: Magnitude Comparator
3.7 Parity Circuits
Parity is a simple error detection technique that adds a check bit to data, allowing detection of single-bit transmission errors.
Even parity sets the parity bit so the total number of 1s (including the parity bit) is even. Odd parity sets the parity bit so the total number of 1s is odd.
| Data Bits | Count of 1s | Even Parity Bit | Odd Parity Bit |
|---|---|---|---|
| 000 | 0 | 0 | 1 |
| 001 | 1 | 1 | 0 |
| 010 | 1 | 1 | 0 |
| 011 | 2 | 0 | 1 |
| 100 | 1 | 1 | 0 |
| 101 | 2 | 0 | 1 |
| 110 | 2 | 0 | 1 |
| 111 | 3 | 1 | 0 |
Parity Generator
A parity generator creates the parity bit for a given data word. For even parity with n data bits:
The parity bit is simply the XOR of all data bits. This produces a 1 when the count of 1s in the data is odd, making the total count even when P is included.
For odd parity, invert the result: \(P = \overline{D_{n-1} \oplus D_{n-2} \oplus \ldots \oplus D_0}\)
Parity Checker
A parity checker verifies that received data (including the parity bit) has correct parity. For even parity:
If the result is 0, parity is correct (even number of 1s). If the result is 1, an error is detected.
Beyond Parity: Hamming Codes
The limitation of parity — detecting but not correcting errors — motivated Richard Hamming to develop Hamming codes in 1950. A Hamming code adds multiple parity bits, each covering a different subset of data bits. By checking which parity bits fail, the receiver can identify and correct the exact bit that flipped.
For a 7-bit Hamming code (4 data bits + 3 parity bits), each parity bit covers specific positions:
| Parity Bit | Covers Positions | Check |
|---|---|---|
| \(P_1\) (pos 1) | 1, 3, 5, 7 | Odd positions |
| \(P_2\) (pos 2) | 2, 3, 6, 7 | Positions with bit 1 set in index |
| \(P_4\) (pos 4) | 4, 5, 6, 7 | Positions with bit 2 set in index |
The syndrome — the binary number formed by the failing parity checks — directly gives the position of the error. For example, if \(P_1\) and \(P_4\) fail but \(P_2\) passes, the syndrome is \(101_2 = 5\), meaning position 5 is corrupt.
Practical Applications of Parity
Parity checking appears in many real systems:
- UART serial communication (Unit 13) optionally includes a parity bit after each 8-bit data byte, allowing the receiver to detect single-bit transmission errors
- Computer memory (ECC RAM) uses extended Hamming codes to detect and correct single-bit errors in real time, which is critical for servers where memory errors could crash operating systems
- Hard drives and SSDs use more powerful error-correcting codes (Reed-Solomon, LDPC) based on the same algebraic principles, enabling reliable storage despite physical media imperfections
The progression from simple parity → Hamming codes → advanced ECC illustrates a common engineering theme: trading redundancy (extra bits) for reliability (error tolerance).
Diagram: Parity Generator/Checker Simulator
3.8 Code Converters
Code converters translate data from one binary representation to another. Different codes offer advantages for specific applications.
BCD Code
BCD (Binary Coded Decimal) represents each decimal digit with its 4-bit binary equivalent. Unlike pure binary, BCD maintains the decimal place value structure.
| Decimal | BCD | Binary |
|---|---|---|
| 0 | 0000 | 0000 |
| 5 | 0101 | 0101 |
| 9 | 1001 | 1001 |
| 10 | 0001 0000 | 1010 |
| 25 | 0010 0101 | 11001 |
| 99 | 1001 1001 | 1100011 |
BCD simplifies decimal I/O but is less efficient than pure binary (wastes 6 codes per digit).
Gray Code
Gray code is an ordering of binary numbers where adjacent values differ in exactly one bit. This property is valuable for position encoders and Karnaugh maps.
| Decimal | Binary | Gray Code |
|---|---|---|
| 0 | 0000 | 0000 |
| 1 | 0001 | 0001 |
| 2 | 0010 | 0011 |
| 3 | 0011 | 0010 |
| 4 | 0100 | 0110 |
| 5 | 0101 | 0111 |
| 6 | 0110 | 0101 |
| 7 | 0111 | 0100 |
Binary to Gray Conversion
The binary to Gray converter uses XOR gates:
For 4 bits:
Gray to Binary Conversion
The reverse conversion:
BCD to Binary Conversion
A BCD to binary converter is more complex, requiring arithmetic operations to combine the weighted digit values. For 2-digit BCD (00-99):
This requires multipliers and adders, making the circuit significantly more complex than Gray code converters.
Diagram: Code Converter Demonstrator
3.9 Seven-Segment Display Decoder
A seven-segment display uses seven LED segments (plus optional decimal point) arranged to display decimal digits and some letters.
a
───
│ │
f│ │b
│ g │
───
│ │
e│ │c
│ │
───
d
Seven-Segment Decoder Design
A seven-segment decoder converts a 4-bit BCD input to the seven segment control signals. Each segment requires its own Boolean function.
| BCD | Digit | a | b | c | d | e | f | g |
|---|---|---|---|---|---|---|---|---|
| 0000 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 0 |
| 0001 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 |
| 0010 | 2 | 1 | 1 | 0 | 1 | 1 | 0 | 1 |
| 0011 | 3 | 1 | 1 | 1 | 1 | 0 | 0 | 1 |
| 0100 | 4 | 0 | 1 | 1 | 0 | 0 | 1 | 1 |
| 0101 | 5 | 1 | 0 | 1 | 1 | 0 | 1 | 1 |
| 0110 | 6 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 0111 | 7 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
| 1000 | 8 | 1 | 1 | 1 | 1 | 1 | 1 | 1 |
| 1001 | 9 | 1 | 1 | 1 | 1 | 0 | 1 | 1 |
For BCD inputs 1010-1111 (invalid BCD), the outputs can be defined as don't cares, enabling simplification.
Deriving Segment Equations
Each segment output is a function of the 4 BCD input bits (\(B_3 B_2 B_1 B_0\)):
This can be simplified using Boolean algebra or K-maps (covered in Unit 5).
Active-Low Decoder Design
Many real seven-segment displays are common-anode, meaning segments illuminate when their control signal is LOW (0). Designing for active-low output simply inverts the truth table — each segment output becomes 0 when the segment should be ON and 1 when OFF.
For the active-high truth table above, the active-low version is obtained by complementing every output. Alternatively, design the active-high decoder first and add inverters at each output. Commercial ICs offer both: the 7448 drives common-cathode (active-high), while the 7447 drives common-anode (active-low).
BCD Input Validation
Since BCD uses only codes 0000–1001, inputs 1010 through 1111 are invalid. A BCD validation circuit detects these invalid codes and can blank the display or signal an error:
Derivation: An input is invalid when the decimal value exceeds 9. The six invalid codes (10–15) all have \(B_3 = 1\) AND either \(B_2 = 1\) or \(B_1 = 1\):
| Invalid BCD | \(B_3\) | \(B_2\) | \(B_1\) | \(B_2 + B_1\) |
|---|---|---|---|---|
| 1010 | 1 | 0 | 1 | 1 |
| 1011 | 1 | 0 | 1 | 1 |
| 1100 | 1 | 1 | 0 | 1 |
| 1101 | 1 | 1 | 0 | 1 |
| 1110 | 1 | 1 | 1 | 1 |
| 1111 | 1 | 1 | 1 | 1 |
This simple 3-gate circuit (one OR, one AND, one AND for the enable) protects the display from showing garbage when invalid data appears on the BCD bus — a practical necessity in any real decoder design.
Diagram: Seven-Segment Decoder Simulator
3.10 Incompletely Specified Functions
An incompletely specified function has some input combinations where the output doesn't matter — either because those inputs can never occur or because the output value for those inputs is irrelevant to the application.
Don't Care Conditions
Don't care conditions (marked as X or d in truth tables) indicate outputs that can be assigned either 0 or 1 during optimization, whichever leads to a simpler circuit.
Example: BCD to Seven-Segment Decoder — BCD only uses input combinations 0000-1001 (0-9). The combinations 1010-1111 (10-15) are invalid BCD and will never occur in a properly designed system. These six input combinations are don't cares.
| BCD Input | Digit | Segment a | Notes |
|---|---|---|---|
| 0000-1001 | 0-9 | specified | Normal operation |
| 1010 | — | X | Invalid BCD |
| 1011 | — | X | Invalid BCD |
| 1100 | — | X | Invalid BCD |
| 1101 | — | X | Invalid BCD |
| 1110 | — | X | Invalid BCD |
| 1111 | — | X | Invalid BCD |
Using Don't Cares for Simplification
When deriving Boolean expressions:
- SOP form: Treat don't cares as 1s if it helps form larger groups
- POS form: Treat don't cares as 0s if it helps form larger groups
The optimizer chooses the assignment (0 or 1) that minimizes the final expression.
Example: Function with don't cares
| A | B | C | F |
|---|---|---|---|
| 0 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | X |
| 1 | 0 | 0 | 0 |
| 1 | 0 | 1 | X |
| 1 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 |
Without don't cares (treating X as 0): \(F = \overline{A}\overline{B}\overline{C} + \overline{A}B\overline{C} + AB\overline{C} + ABC = \overline{A}\overline{C} + AB\) (4 literals)
Using don't cares strategically (treating row 011 as 1):
Result: \(F = \overline{A}\overline{C} + B\) (3 literals — simpler than without don't cares!)
Diagram: Don't Care Optimizer
Summary and Key Takeaways
This unit applied Boolean algebra to practical digital circuit design:
- Combinational logic circuits have outputs determined solely by current inputs, with no memory of past states.
- Circuit synthesis follows a systematic process: specification → truth table → Boolean expression → simplification → circuit implementation.
- Word problem translation requires careful mapping of English statements to Boolean operators using a consistent variable assignment.
- Half adders add two bits producing sum and carry; full adders include a carry-in for multi-bit addition.
- Ripple carry adders chain full adders for multi-bit addition, with carry propagating through stages.
- Adder-subtractor circuits use XOR gates with a control signal to perform either addition or two's complement subtraction using shared hardware.
- Magnitude comparators determine greater-than, less-than, or equal relationships between binary numbers by comparing from MSB to LSB.
- Parity generators create check bits by XORing all data bits; parity checkers detect single-bit errors using the same XOR operation.
- Code converters translate between representations: BCD for decimal I/O, Gray code for position encoding with minimal bit changes.
- Seven-segment decoders convert BCD inputs to segment drive signals, with invalid BCD codes as don't cares.
- Incompletely specified functions have don't care conditions that enable simpler implementations by choosing optimal output values.
Self-Check: What is the Boolean expression for the carry output of a full adder?
\(C_{out} = AB + AC_{in} + BC_{in}\). The carry is produced when at least two of the three inputs are 1.
Self-Check: Why is Gray code useful for position encoders?
In Gray code, adjacent positions differ by only one bit. This prevents ambiguous readings when a sensor is between positions—only one bit can be changing at a time, eliminating glitches.
Self-Check: How do don't cares help circuit simplification?
Don't cares can be assigned either 0 or 1 during optimization. By strategically choosing these values, larger groups can be formed in K-maps, resulting in simpler Boolean expressions with fewer gates.
Self-Check: Design a voting circuit for a 4-person panel that approves when at least 3 members vote yes.
With inputs \(A\), \(B\), \(C\), \(D\), the output is 1 when 3 or 4 inputs are 1. The SOP expression is: \(F = BCD + ACD + ABD + ABC\). This can also be written as \(F = AB(C+D) + CD(A+B)\), requiring fewer gates. Notice that this is a generalization of the 3-input majority function.
Self-Check: What is the borrow output equation for a full subtractor?
\(B_{out} = \overline{A}B + \overline{A}B_{in} + BB_{in}\). A borrow is produced when the subtrahend bits (\(B\) and \(B_{in}\)) "overpower" the minuend bit \(A\). Compare this with the carry-out of a full adder: \(C_{out} = AB + AC_{in} + BC_{in}\) — the borrow equation has the same structure but with \(A\) complemented.
Self-Check: Verify that Gray codes 0110 and 0111 differ by exactly one bit.
Gray code 0110 (decimal 4) and 0111 (decimal 5) differ only in bit position 0 — the rightmost bit changes from 0 to 1. This single-bit-change property holds for all adjacent Gray code values, which is why Gray codes prevent glitch errors in position encoders and are used for labeling K-map cells.
Self-Check: For the seven-segment display, which segments are active to display the digit '7'?
Segments a, b, and c are active (1) while segments d, e, f, and g are inactive (0). This matches the top horizontal bar, upper-right vertical, and lower-right vertical segments forming the numeral 7.
Self-Check: How does the carry-lookahead adder avoid the ripple carry delay?
Instead of waiting for each carry to propagate sequentially through every stage, the CLA computes generate (\(G_i = A_i B_i\)) and propagate (\(P_i = A_i \oplus B_i\)) signals for each bit. These allow every carry to be expressed as a function of the original inputs and \(C_{in}\) only, so all carries are computed in parallel after just two gate delays regardless of adder width.
Interactive Walkthrough
Step through the complete design of a full adder from truth table to gate circuit: