Boolean Algebra and Digital Logic Circuits
Fundamentals of Boolean Algebra
Boolean algebra deals with arithmetical and logical operations executed on digital signals that take values of and .
Boolean Expression & Logic Function:
- A Boolean expression equates a logical function of variables to a binary output (for example, ).
- Logical functions use operators such as OR () and AND ().
- Variables are denoted by letters such as .
- Complements of variables are represented as or .
- Boolean constants consist exclusively of and .
- Literals refer to any occurrence of a variable or its complement within an expression.
Postulates of Boolean Algebra:
- Let be the set of Boolean constants.
- Closure: For every :
- The OR operation is closed.
- The AND operation is closed.
- Identity Elements: There exist unique identity elements in denoted relative to OR () and AND ():
- OR Identity (): for every
- AND Identity (): for every
- Commutative Law: For all :
- Distributive Law: Each operation () and () is distributive over the other for all :
- Complement: For every element , there exists an element called the complement of such that:
- Distinct Elements: There exist at least two elements such that
Boolean Laws, Theorems, and Proofs
Basic OR Laws:
Basic AND Laws:
- (Idempotence Law)
Involution (Double Inversion) Law:
Key Theorems:
- Commutative Law:
- Associative Law:
- Distributive Law:
- Absorption Law:
Verification and Proofs by Exhaustive Substitution:
- OR Laws:
- Proof of : For ; for .
- Proof of : For ; for .
- Proof of : For ; for .
- Proof of : For ; for .
- AND Laws:
- Proof of : For ; for .
- Proof of : For ; for .
- Proof of : For ; for .
- Proof of : For ; for .
Algebraic Proofs of Complex Simplifications:
- Proof of :
- Proof of :
- Proof of :
Principle of Duality
Definition: The dual of any Boolean expression or identity is obtained by performing the following conversions:
- Change all OR operators () to AND operators ().
- Change all AND operators () to OR operators ().n * Interchange binary constants and (change all 's to 's and 's to 's).
- All variables and their complements remain completely unchanged.
Examples of Dual Pairs:
- Expression: Dual:
- Expression: Dual:
- Expression: Dual:
- Expression: Dual:
- Expression: Dual:
De Morgan's Theorems
Law 1:
- Statement: The complement of a sum of variables is equal to the product of the individual complements of those variables.
- Logic Gate Equivalence: A NOR gate is equivalent to a Bubbled AND gate (also called a negative AND gate).
- Truth Table Verification: | | | | | | | | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | 1 | 1 | 1 | 1 | | 0 | 1 | 1 | 0 | 1 | 0 | 0 | | 1 | 0 | 1 | 0 | 0 | 1 | 0 | | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Law 2:
- Statement: The complement of a product of variables is equal to the sum of the individual complements of those variables.
- Logic Gate Equivalence: A NAND gate is equivalent to a Bubbled OR gate (also called a negative OR gate).
- Truth Table Verification: | | | | | | | | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | 1 | 1 | 1 | 1 | | 0 | 1 | 0 | 1 | 1 | 0 | 1 | | 1 | 0 | 0 | 1 | 0 | 1 | 1 | | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
Simplification Examples using De Morgan's Law:
- Problem 1: Simplify
- Step 1: Apply Law 2
- Step 2: Apply Law 1
- Step 3: Apply double negation rule
- Problem 2: Simplify
- Step 1: Apply Law 1
- Step 2: Cancel double overlines
- Step 3: Apply absorption
Basic and Universal Logic Gates
Logic Gate Definition: A physical digital circuit that performs a specific logical operation on one or more binary inputs to produce a single binary output.
NOT Gate (Inverter):
- Logic Operation: Performs inversion or complementing ().
- Truth Table: | Input () | Output () | | :---: | :---: | | 0 | 1 | | 1 | 0 |
AND Gate:
- Logic Operation: Output is high () if and only if all inputs are high ().
- 2-Input Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 0 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |
- 3-Input Truth Table: | | | | | | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | 0 | | 0 | 0 | 1 | 0 | | 0 | 1 | 0 | 0 | | 0 | 1 | 1 | 0 | | 1 | 0 | 0 | 0 | | 1 | 0 | 1 | 0 | | 1 | 1 | 0 | 0 | | 1 | 1 | 1 | 1 |
OR Gate:
- Logic Operation: Output is high () if at least one input is high ().
- 2-Input Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 1 |
- 3-Input Truth Table: | | | | | | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | 0 | | 0 | 0 | 1 | 1 | | 0 | 1 | 0 | 1 | | 0 | 1 | 1 | 1 | | 1 | 0 | 0 | 1 | | 1 | 0 | 1 | 1 | | 1 | 1 | 0 | 1 | | 1 | 1 | 1 | 1 |
Universal Gates (NAND and NOR):
- A universal gate can implement any Boolean function without requiring any other gate type.
- NAND Gate:
- Expression: (Equivalent to Bubbled OR gate).
- Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 1 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |
- NOR Gate:
- Expression: (Equivalent to Bubbled AND gate).
- Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 0 |
Exclusive Gates:
- XOR Gate (Exclusive-OR):
- Expression:
- Operation: Produces high output () when inputs are different.
- Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 0 | | 0 | 1 | 1 | | 1 | 0 | 1 | | 1 | 1 | 0 |
- XNOR Gate (Exclusive-NOR):
- Expression:
- Derivation: complement… yields .
- Operation: Produces high output () when inputs are identical.
- Truth Table: | | | | | :---: | :---: | :---: | | 0 | 0 | 1 | | 0 | 1 | 0 | | 1 | 0 | 0 | | 1 | 1 | 1 |
Finding Expression from Circuit Diagram:
- For a multi-stage circuit with inputs where enter an AND gate, enter an AND gate, their outputs enter an OR gate, and the result is OR-ed with :
- Output Expression:
Canonical and Standard Forms of Logical Expressions
Standard Representations:
- Sum of Products (SOP): Logic expression formed by OR-ing individual product terms.
- Example:
- Product of Sums (POS): Logic expression formed by AND-ing individual sum terms.
- Example:
Minterms ():
- A product term containing all variables of the function in either complemented or uncomplemented form.
- For a minterm, a variable is represented uncomplemented if its binary value is , and complemented if its binary value is
- A minterm evaluates to for its specific variable combination.
- 3-Variable Minterm Table: | | | | Minterm Expression | Designation | | :---: | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | | | | 0 | 0 | 1 | | | | 0 | 1 | 0 | | | | 0 | 1 | 1 | | | | 1 | 0 | 0 | | | | 1 | 0 | 1 | | | | 1 | 1 | 0 | | | | 1 | 1 | 1 | | |
Maxterms ():
- A sum term containing all variables of the function in either complemented or uncomplemented form.
- For a maxterm, a variable is represented complemented if its binary value is , and uncomplemented if its binary value is
- A maxterm evaluates to for its specific variable combination.
- 3-Variable Maxterm Table: | | | | Maxterm Expression | Designation | | :---: | :---: | :---: | :---: | :---: | | 0 | 0 | 0 | | | | 0 | 0 | 1 | | | | 0 | 1 | 0 | | | | 0 | 1 | 1 | | | | 1 | 0 | 0 | | | | 1 | 0 | 1 | | | | 1 | 1 | 0 | | | | 1 | 1 | 1 | | |
Expansion to Canonical Standard Form:
- Canonical SOP Conversion: Multiply missing variables in a term by
- Example: Convert to standard SOP form:
- Combining unique terms:
- Numeric Notation:
- Canonical POS Conversion: Add missing variable products to incomplete sum terms and apply distributivity.
- Example: Convert to standard POS form:
- Combining unique terms:
- Numeric Notation:
Conversion between SOP and POS:
- The POS representation of a function consists of maxterms whose indices are missing from the SOP minterm list.
- Example: If , the missing indices are .
- Therefore, the POS equivalent is .
Karnaugh Map (K-map) Simplification
Overview:
- The Karnaugh map is a graphical technique used to minimize Boolean functions for 2, 3, 4, 5, and 6 variables.
- Number of cells in K-map equals where is the number of variables:
- 2 variables: cells
- 3 variables: cells
- 4 variables: cells
- 5 variables: cells (two 16-cell maps for and )
- Cell Labeling Rule: Uses Gray Code ordering () where adjacent cells differ by only one bit.
Step-by-Step Rules for SOP Simplification:
- Place 's in cells corresponding to the minterms in the expression.
- Enclose adjacent cells containing 's into groups.
- Group sizes must be powers of 2 ().
- Maximize group size and minimize the total number of groups.
- Every on the map must be included in at least one group.
- Groupings can wrap around boundaries (opposite edges top-bottom and left-right are adjacent).
- Groups must be rectangular or square blocks oriented horizontally or vertically; diagonal groupings are strictly prohibited.
SOP Simplification Example:
- Given
- Map grid layout (4-variable 16 cells):
- Grouping:
- Corner Quad
- Quad
- Pair
- Single/Pair
- Simplified Expression:
Implementation of Simplified Expressions:
- AOI Logic (AND-OR-INVERT): Standard logic diagram built with AND gates feeding into an OR gate.
- Conversion from AOI to Universal NAND Logic:
- Draw the original circuit in AOI logic.
- Place a circle (bubble) at the output of every AND gate and at every input of the final OR gate (since Bubbled OR = NAND).
- Add an inverter on any input line that received a circle to preserve original signal polarity.
- Conversion from AOI to Universal NOR Logic:
- Draw POS circuit with OR gates feeding into an AND gate.
- Place a bubble at the output of every OR gate and at every input of the AND gate (Bubbled AND = NOR).
POS Simplification using K-map:
- Place 's in cells corresponding to maxterm numbers.
- Group adjacent 's in powers of 2 following standard grouping rules.
- Combine terms as sums to write the reduced POS expression.
- Example:
- Grouping 's yields simplified POS expression:
Don't Care Conditions ( or ):
- In certain logic circuits, specific input combinations never occur or their output levels are unassigned.
- These combinations are marked as (or ) on the K-map.
- An can be treated as if it aids in forming a larger group size, or as if it does not help simplify the expression. It is not required to enclose all 's.
- Example:
- Including don't care conditions at allows quad creation and
- Reduced SOP expression:
Quine-McCluskey (Tabulation) Method
Purpose: An algorithmic tabular method used to minimize Boolean functions, ideal when variable count exceeds 4 or 5 variables.
Step-by-Step Procedure:
- Step 1: List all minterms in their binary representation.
- Step 2: Group binary minterms into index groups based on the count of 's present in their representation (Index 0, Index 1, Index 2, etc.).
- Step 3: Compare each minterm in Index group with every minterm in Index group . If two terms differ by exactly one bit position, combine them into a pair, replacing the differing bit position with a dash (
-). - Step 4: Repeat the comparison process between combined pairs to form quads (2 dashes), octets (3 dashes), etc., until no further combinations can be made.
- Step 5: Mark all uncombined terms; these represent the Prime Implicants (PIs).
- Step 6: Construct a Prime Implicant Chart listing Prime Implicants along rows and original minterms along columns.
- Step 7: Place checks (
X) where a PI covers a minterm. Identify Essential Prime Implicants (EPIs) (any column containing only oneXmakes its corresponding row PI essential). - Step 8: Select minimum additional PIs required to cover any remaining minterms.
Solved Tabulation Example:
- Function: f(A, B, C, D) = \sum m(1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 15)$\n * **Column 1 (Binary Index Groups)**:\n * Index 1: m_1(0001), m_2(0010), m_8(1000)\n * Index 2: m_3(0011), m_5(0101), m_6(0110), m_9(1001), m_{12}(1100)\n * Index 3: m_7(0111), m_{13}(1101)\n * Index 4: m_{15}(1111)\n * **Column 2 (Pairs)**:\n * (1,3): 00-1\n * (1,5): 0-01\n * (1,9): -001\n * (2,3): 001-\n * (2,6): 0-10\n * (8,9): 100-\n * (8,12): 1-00\n * (3,7): 0-11\n * (5,7): 01-1\n * (5,13): -101\n * (6,7): 011-\n * (9,13): 1-01\n * (12,13): 110-\n * (7,15): -111\n * (13,15): 11-1\n * **Column 3 (Quads / Combinations)**:\n * P = (1,3,5,7): 0--1 \implies \bar{A}D\n * Q = (1,9,5,13): --01 \implies \bar{C}D\n * R = (2,3,6,7): 0-1- \implies \bar{A}C\n * S = (8,9,12,13): 1-0- \implies A\bar{C}\n * T = (5,7,13,15): -1-1 \implies BD\n * **Prime Implicant Chart Evaluation**:\n * Minterms: 1, 2, 3, 5, 6, 7, 8, 9, 12, 13, 15\n * Essential Prime Implicants: R (\bar{A}C)2,3,6,7S (A\bar{C})8,9,12,13T (BD)5,7,13,15.\n * Remaining uncovered minterm: m_1\n * Minterm m_1P (\bar{A}D)Q (\bar{C}D).\n * Final Minimal Logic Expressions:\n * Y = R + S + T + P = \bar{A}C + A\bar{C} + BD + \bar{A}D\n * OR\n * Y = R + S + T + Q = \bar{A}C + A\bar{C} + BD + \bar{C}D\n\n# Combinational Logic Circuits\n\n* Definition: A logic circuit in which the output at any instant depends strictly on the present combination of inputs, with no reliance on past inputs or past states. Contains zero memory elements.\n\n* Comparison with Sequential Circuits:\n * Combinational Circuits: Memoryless, outputs rely only on present inputs.\n * Sequential Circuits: Contain memory elements (flip-flops/latches), outputs depend on present inputs and stored past state.\n\n* General Design Steps for Combinational Logic:\n 1. Determine the required number of input and output variables from problem specification.\n 2. Construct the truth table defining output values for all input combinations.\n 3. Obtain simplified Boolean functions for each output using K-maps or algebraic reduction.\n 4. Draw the logic circuit diagram implementing the simplified expressions.\n\n* Design Example — Even Parity Generator (4 Inputs):\n * Problem: Design a circuit with 4 input variables (A, B, C, D11's in the input is even.\n * Output Y = 1m_0(0000), m_3(0011), m_5(0101), m_6(0110), m_9(1001), m_{10}(1010), m_{12}(1100), m_{15}(1111).\n * Expression: Y = \sum m(0, 3, 5, 6, 9, 10, 12, 15)\n * Simplified Function using Exclusive-NOR equivalences:\n * Y = \overline{A \oplus B \oplus C \oplus D}\n\n# Arithmetic and Comparison Circuits\n\n* **1-Bit Digital Comparator**:\n * Inputs: A, B (1 bit each)\n * Outputs: A > BA = BA < B\n * Truth Table:\n | ABA > BA = BA < B |\n | :---: | :---: | :---: | :---: | :---: |\n | 0 | 0 | 0 | 1 | 0 |\n | 0 | 1 | 0 | 0 | 1 |\n | 1 | 0 | 1 | 0 | 0 |\n | 1 | 1 | 0 | 1 | 0 |\n * Derived Equations:\n * A > B = A\bar{B}\n * A = B = AB + \bar{A}\bar{B} = \overline{A \oplus B}\n * A < B = \bar{A}B\n\n* **Half Adder**:\n * Adds two single-bit inputs AB\n * Outputs:\n * Sum (S) = A \oplus B = A\bar{B} + \bar{A}B\n * Carry (C_{out}) = AB\n\n* **Full Adder**:\n * Adds three single-bit inputs A, B,C_{in}\n * Derived Equations:\n * Sum = A \oplus B \oplus C_{in}\n * C_{out} = AB + B C_{in} + A C_{in}\n * Implementation using Two Half Adders and One OR Gate:\n * Half Adder 1 outputs: S_1 = A \oplus BC_1 = AB\n * Half Adder 2 takes inputs S_1C_{in}, yielding:\n * Sum = S_1 \oplus C_{in} = (A \oplus B) \oplus C_{in}\n * C_2 = S_1 \cdot C_{in} = (A \oplus B) C_{in}\n * Final Carry Output:\n * C_{out} = C_1 + C_2 = AB + (A \oplus B) C_{in}\n * = AB + (A\bar{B} + \bar{A}B) C_{in} = AB + A\bar{B}C_{in} + \bar{A}BC_{in}\n * = AB(1 + C_{in}) + A\bar{B}C_{in} + \bar{A}BC_{in} = AB + ABC_{in} + A\bar{B}C_{in} + \bar{A}BC_{in}\n * = AB + AC_{in}(B + \bar{B}) + BC_{in} = AB + B C_{in} + A C_{in}\n\n* **Half Subtractor**:\n * Subtracts input bit BA\n * Outputs:\n * Difference (D) = A \oplus B = A\bar{B} + \bar{A}B\n * Borrow (B_{out}) = \bar{A}B\n\n* **Full Subtractor**:\n * Subtracts bits BB_{in}A\n * Outputs:\n * Difference = A \oplus B \oplus B_{in}\n * B_{out} = \bar{A}B + \bar{A}B_{in} + BB_{in}\n * Implementation using Two Half Subtractors and One OR Gate:\n * Half Subtractor 1 outputs: D_1 = A \oplus BB_1 = \bar{A}B\n * Half Subtractor 2 takes inputs D_1B_{in}, yielding:\n * Diff = D_1 \oplus B_{in} = (A \oplus B) \oplus B_{in}\n * B_2 = \overline{D_1} \cdot B_{in} = \overline{(A \oplus B)} B_{in}\n * Final Borrow Output:\n * B_{out} = B_1 + B_2 = \bar{A}B + \overline{(A \oplus B)} B_{in} = \bar{A}B + (AB + \bar{A}\bar{B}) B_{in}\n * = \bar{A}B + \bar{A}B_{in} + BB_{in}\n\n# Data Selection and Decoding Circuits\n\n* **Multiplexer (MUX) / Data Selector**:\n * Function: Routes binary data from one of N = 2^nn select control inputs.\n * Enable Line (EE=1\bar{E}=0 enables device).\n * Common Configurations:\n * **2:1 MUX**: 2 data inputs (I_0, I_1S_0Y = \bar{S}0 I_0 + S_0 I_1\n * **4:1 MUX**: 4 data inputs (I_0, I_1, I_2, I_3S_1, S_0).\n * Output Equation: Y = E [\bar{S}_1 \bar{S}_0 I_0 + \bar{S}_1 S_0 I_1 + S_1 \bar{S}_0 I_2 + S_1 S_0 I_3]\n * **8:1 MUX**: 8 data inputs (I_0I_7S_2, S_1, S_0).\n * **16:1 MUX**: 16 data inputs (I_0I{15}S_3, S_2, S_1, S_0).\n\n* **Demultiplexer (DEMUX)**:\n * Function: Performs reverse operation of MUX; routes a single input line DN = 2^nn select control lines.\n * **1:4 DEMUX**:\n * Inputs: Data DS_1, S_0E\n * Outputs:\n * Y_0 = \bar{S}_1 \bar{S}_0 D E\n * Y_1 = \bar{S}_1 S_0 D E\n * Y_2 = S_1 \bar{S}_0 D E\n * Y_3 = S_1 S_0 D E\n\n* **Decoder**:\n * Function: Converts an n2^n distinct output lines.\n * **3-to-8 Line Decoder (Decimal to Octal Decoder)**:\n * Inputs: X_2, X_1, X_0 (3 bits)\n * Outputs: Y_0Y_7 (8 lines)\n * Logic Equations: Each output corresponds to a unique minterm derived using AND gates (Y_0 = \bar{X}_2\bar{X}_1\bar{X}_0Y_1 = \bar{X}_2\bar{X}_1X_0Y_7 = X_2X_1X_0).\n\n* **Encoder**:\n * Function: Performs reverse operation of decoder; converts an active input signal on one of 2^nn-bit coded output.\n * **8-to-3 Octal to Binary Encoder**:\n * Inputs: 8 lines (X_0X_7)\n * Outputs: 3 binary bits (Y_2, Y_1, Y_0)\n * **10-to-4 Decimal to BCD Encoder**:\n * Inputs: 10 lines (X_0X_9)\n * Outputs: 4 BCD output bits (Y_3, Y_2, Y_1, Y_0)\n * Output Equations:\n * Y_0 = X_1 + X_3 + X_5 + X_7 + X_9\n * Y_1 = X_2 + X_3 + X_6 + X_7\n * Y_2 = X_4 + X_5 + X_6 + X_7\n * Y_3 = X_8 + X_9\n\n# Sequential Logic Circuits Overview\n\n* Definition: A digital logic circuit whose output signal depends on both current input signals and the present state stored in memory elements.\n\n* Block Diagram Structure:\n * Consists of a Combinational Logic Circuit paired with Memory Storage Elements (Latches or Flip-Flops) forming a continuous feedback loop.\n\n* Concept of State:\n * The binary contents retained inside memory elements at any given point in time represent the present state of the sequential circuit.\n\n* Classification:\n * **Synchronous Sequential Circuits**:\n * State updates and operations across all memory elements are governed synchronously by a centralized periodic timing signal called a clock (CLK$$).
- Asynchronous Sequential Circuits:
- Circuit behavior and state changes occur immediately in response to changes in input signals without relying on a clock signal.