π Lecture 12 β COMPARATOR
π Overview: This lecture introduces comparator circuits that compare two binary numbers and produce three outputs indicating whether one is greater than, equal to, or less than the other. It then transitions to the Quine-McCluskey simplification method, a program-based approach that overcomes the limitations of Karnaugh maps when dealing with more than four variables, making it essential for handling larger digital logic problems.
ποΈ Topics Covered
The lecture covers the design and function table of a 2-bit comparator circuit with its three outputs (A>B, A=B, A<B) and corresponding Karnaugh map simplifications. It then introduces the Quine-McCluskey simplification method as a systematic alternative to K-maps, explaining the problem of redundant terms in K-map grouping. Two detailed examples demonstrate the full Quine-McCluskey process of finding Prime Implicants through exhaustive search and selecting minimal Prime Implicants. The lecture concludes with applications to larger comparator circuits (3-bit and 6-bit) and an Odd-Prime Number Detector circuit for 5-bit numbers.
π Lecture Summary
COMPARATOR
A comparator circuit compares two numbers and sets one of its three outputs to 1, indicating the result of the comparison operation. A comparator circuit has multiple inputs and three outputs. A 2-bit Comparator circuit compares two 2-bit numbers A and B. The comparator circuit has three outputs: it sets the A>B output to 1 if A>B, sets the A=B output to 1 if A=B, and sets the A<B output to 1 if A<B.
The output A>B is set to 1 when the input combinations are 01 00, 10 00, 10 01, 11 00, 11 01 and 11 10. The output A=B is set to 1 when the input combinations are 00 00, 01 01, 10 10 and 11 11. The output A<B is set to 1 when the input combinations are 00 01, 00 10, 00 11, 01 10, 01 11 and 10 11.
The circuit has 4-bit input (2-bits represent A and 2-bits represent B) and a 3-bit output representing A>B, A=B and A<B. To represent the function of a Comparator circuit, three function tables are required for each of the three outputs. A single function table is drawn with three outputs (Table 12.1).
Each of the three outputs, A>B, A=B and A<B are mapped separately using three 4-variable Karnaugh maps. The Karnaugh Maps and the simplified expressions for the three outputs are:
(A > B) = AβBΜβ + AβBΜβBΜβ + AβAβBΜβ
(A = B) = AΜβAΜβBΜβBΜβ + AΜβAβBΜβBβ + AβAβBβBβ + AβAΜβBβBΜβ
(A < B) = AΜβBβ + AΜβAΜβBβ + AΜβBβBβ
Quine-McCluskey Simplification Method
The Karnaugh map method becomes difficult to manage when numbers of variables exceed 4. Even with a 4-variable K-map, grouping of 1s or 0s depends on the ability of the user to detect optimum groups. Sometimes some redundant groups are included which adds a product term or a sum term which is not required, and thus the expression is not the simplified version.
In a 4-variable K-map, 6 groups of 4 cells each can be formed, producing six terms AB, AC, AD, BC, CD and BD. Out of these six terms, three terms are redundant, and the essential terms required are AC, BC and BD. Finding redundant terms is not very obvious.
The Quine-McCluskey approach of simplifying Boolean expression is based on an exhaustive search where each minterm is compared with every other minterm in order to remove single variables. The exhaustive search is continued until only a few terms remain which do not share any common variable that can be eliminated. From these remaining terms, the minimal product terms are selected that represent the simplified form of Boolean expression.
Quine-McCluskey is a program-based method that is able to carry out the exhaustive search for removing shared variables. The Quine-McCluskey method is a two-step method which comprises of:
- Find Prime Implicants: Find by an exhaustive search all the terms that are candidates for inclusion in the simplified function. These terms are known as Prime Implicants.
- Selecting Minimal Set of Prime Implicants: Choose from amongst the Prime Implicants those that give expression with the least number of literals.
Example 1
A function is defined in Canonical Sum form as Ξ£A,B,C,D(1,3,6,7,8,9,11,12,13,14,15). As the first step to find the Prime Implicants through an exhaustive search, all the Minterms are listed in a tabular form (Table 12.2). The Table of Minterms is reorganized and the Minterms are arranged in groups of minterms having 0, 1, 2, 3 and 4 1s (Table 12.3). Four groups of Minterms are formed:
- Minterms 1 and 8 have only single 1s
- Minterms 3, 6, 9 and 12 have two 1s each
- Minterms 7, 11, 13 and 14 have three 1s each
- Minterm 15 has 4 1s.
When comparing minterms, the rule is to compare each minterm in one group with each minterm in the other group. Minterms 1 and 8 are compared with each of the 4 minterms 3, 6, 9 and 12. Each of the 4 minterms 3, 6, 9 and 12 are compared with minterms 7, 11, 13 and 14. Finally, each of the minterms 7, 11, 13 and 14 are compared with minterm 15.
The results of the comparisons between two minterms are represented in a separate table (Table 12.4). Terms 1 and 3 form a single term eliminating variable C, forming the product term AΜBΜD. Terms 1 and 9 form a single term eliminating variable A, forming the product term BΜCΜD. Terms 8,9 eliminate variable D, terms 8,12 eliminate variable B, terms 3,7 eliminate variable B, and so on. A total of 16, three-variable product terms are formed.
The three-variable terms in table 12.4 are compared to eliminate another single variable (Table 12.5). Terms 1,3 and terms 9,11 form the product term BΜD eliminating variable A. Terms 1,3 and 9,11 are different in a single variable A only. In table 12.5, there are 6 product terms of two variables each: BD, AC, CD, BC, AD and AB. If the terms in table 12.5 are compared, none form pairs to eliminate a variable, so all 6 terms are Prime Implicants.
In the second step, the essential and minimal Prime Implicants are found (Table 12.6). The Prime Implicants are listed in the left column and all original minterms in the top row. In each cell, an x is marked indicating that the Prime Implicant covers the minterm. Circles are marked in cells having x which represent minterms covered by only a single Prime Implicant. Minterms 1, 6 and 8 are covered by only the Prime Implicants BΜD, AC and BC respectively. These three Prime Implicants are the three essential Prime Implicants that cover all the minterms. The simplified expression is:
BΜD + AC + BC
Example 2
A function is defined as Ξ£A,B,C,D(1,5,6,7,11,12,13,15). The minterms are written in tabular form (Table 12.7) and reorganized in terms of groups of 1s (Table 12.8):
- Minterm 1 has a single 1
- Minterms 5, 6 and 12 have two 1s each
- Minterms 7, 11 and 13 have three 1s each
- Minterm 15 has 4 1s.
Minterm 1 is compared with minterms 5, 6 and 12. Each of minterms 5, 6 and 12 are compared with minterms 7, 11 and 13. Finally, each of minterms 7, 11 and 13 are compared with minterm 15 (Table 12.9). Terms 1 and 5 form a single term eliminating variable B, forming the product term AΜCΜD. Terms 5 and 7 form a term eliminating variable C, forming product term AΜBΜD. Terms 5,13 eliminate variable A, terms 6,7 eliminate variable D, terms 12,13 eliminate variable D, and so on. A total of 8, three-variable product terms are formed.
Terms 5,7 and 13,15 compare to form product term BD eliminating variable A (Table 12.10). No more comparisons take place. The five Prime Implicants are: AΜCΜD, AΜBΜC, ABΜC, ACD and BD.
In the second step (Table 12.11), the Prime Implicant AΜCΜD covers minterms 1 and 5. Circles are marked for minterms covered by only a single Prime Implicant. Minterms 1, 6, 11 and 12 are covered by only AΜCΜD, AΜBΜC, ABΜC and ACD respectively. The simplified expression is:
AΜCΜD + AΜBΜC + ABΜC + ACD
Comparator Circuit
A 2-bit Comparator circuit that compares two 2-bit numbers A and B has been discussed earlier. A comparator circuit that compares two 3-bit numbers A and B instead of 2-bit numbers has an input of 6-bits, representing an input combination of 64. Writing a truth table and simplifying the three expressions using 6-variable Karnaugh maps becomes unmanageable. A program-based Quine-McCluskey method can easily handle expressions of 6 variables represented in the Canonical form Ξ£A,B,C,D,E,F(8,16,17,24,...).
Odd-Prime Number Detector
A circuit that detects Odd Prime numbers between 0 and 9 has been considered earlier. The circuit is to be improved to detect Odd Prime numbers for a decimal number range represented by 5-bit binary numbers (decimal numbers 0 to 31). Writing out a function table for 32 input combinations and simplifying using a 5-variable K-map takes considerable time.
The Quine-McCluskey method can be used to easily simplify the 5-variable Boolean expression represented in Canonical Sum form as Ξ£A,B,C,D,E(1,3,5,7,11,13,17,19,23,29,31). The minterms 1, 3, 5, 7, 11, 13, 17, 19, 23, 29 and 31 represent the 5-bit input combinations which are Odd and Prime numbers.
β Key Takeaways
The comparator circuit is a fundamental building block that compares two binary numbers and activates exactly one of three outputs (A>B, A=B, A<B). For 2-bit comparators, 4-variable Karnaugh maps provide manageable simplification, yielding the Boolean expressions for all three outputs. However, the Quine-McCluskey method becomes essential when dealing with more than four variables, as K-map grouping becomes impractical and prone to redundant terms. The Quine-McCluskey process involves two critical steps: first, an exhaustive search to find all Prime Implicants by systematically eliminating variables through pairwise comparison of minterms, and second, selecting the minimal set of essential Prime Implicants that cover all original minterms. This method is program-based and scales effectively to handle 5-variable and 6-variable problems like the Odd-Prime Number Detector and larger comparator circuits.
π§ Quick Revision Questions
- What are the three outputs of a comparator circuit, and what does each output indicate?
- How does the Quine-McCluskey method differ from the Karnaugh map method when simplifying Boolean expressions?
- In Example 1, what was the final simplified Boolean expression, and which Prime Implicants were identified as redundant?
- When comparing minterms in the exhaustive search phase, what is the rule for determining which groups of minterms should be compared against each other?
- In Example 2, why were the Prime Implicants AΜCΜD, AΜBΜC, ABΜC and ACD considered essential, while BD was not?
π Lecture 13 β ODD-PRIME NUMBER DETECTOR
π Overview: This lecture completes the Quine-McCluskey method for simplifying Boolean expressions with five variables using the Odd-Prime Number Detector example. It then introduces Combinational Logic circuits, explaining how to implement and simplify circuits using SOP and POS forms, and covers active-high/active-low inputs and outputs through the Adjacent 1s Detector and Odd-Parity Generator examples.
ποΈ Topics Covered
The Quine-McCluskey method is applied step-by-step to minimize the Odd-Prime Number Detector function with five variables, finding Prime Implicants and essential Prime Implicants. Combinational Logic is introduced, explaining how individual gates combine to form useful circuits. The SOP and POS implementation architectures are explained with three-level gate diagrams. The Adjacent 1s Detector is designed and implemented from its function table using both SOP and POS forms, simplified via Karnaugh maps, and then converted to NAND-only and NOR-only implementations. Active-low and active-high inputs and outputs are discussed, and the Odd-Parity Generator circuit is introduced as a design example.
π Lecture Summary
ODD-PRIME NUMBER DETECTOR
The lecture begins with the Odd-Prime Number Detector which has five input variables (A, B, C, D, E). The function is defined by 11 minterms: 1, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31 (Table 13.1). These minterms are reorganized into groups based on the number of 1s in each minterm (Table 13.2): minterm 1 has one 1; minterms 3, 5, and 17 have two 1s each; minterms 7, 11, 13, and 19 have three 1s each; minterms 23 and 29 have four 1s; minterm 31 has five 1s.
In the first step of the Quine-McCluskey method, minterms are compared to eliminate single variables. Minterm 1 is compared with minterms 3, 5, and 17 in the next group. Minterms 3, 5, and 17 are compared with minterms 7, 11, 13, and 19. Minterms 7, 11, 13, and 19 are compared with minterms 23 and 29. Minterms 23 and 29 are compared with minterm 31.
π Definition β Quine-McCluskey method: A systematic tabular method for minimizing Boolean expressions, particularly useful when the number of variables exceeds 4, where Karnaugh maps become impractical.
π Definition β Prime Implicant: A product term that cannot be further combined with any other term to eliminate a variable.
The results of comparisons produce 14 four-variable product terms (Table 13.3). For example, terms 1 and 3 eliminate variable D, forming product term ΔBΜCEΜ. Terms 1 and 5 eliminate variable C, forming ΔBΜDΜEΜ. The comparison continues, and in Table 13.4, terms 1, 3, 5, and 7 form a single term eliminating variables C and D, forming ΔBΜEΜ. Terms 1, 3, 17, and 19 eliminate variables A and D, forming BΜCΜEΜ.
Eight Prime Implicants are found: three from Table 13.4 and five from Table 13.3. These are represented by product terms: ΔCΜDΜE, ΔCDEΜ, BCΜDEΜ, ACΜDΜE, ABΜCΜEΜ, ΔBΜEΜ, BΜCΜEΜ, and BΜDEΜ.
In the second step, essential and minimal Prime Implicants are found using a Prime Implicant table (Table 13.5). Each Prime Implicant is listed in the left column, and all original minterms are listed in the top row. An "x" in a cell indicates that the Prime Implicant covers that minterm. Circles are marked in cells having "x" that represent minterms covered by only a single Prime Implicant. Minterms 11 and 17 are covered by only ΔCDEΜ and BΜCΜEΜ respectively. The other essential implicants with minimum variables covering all remaining minterms are BCΜDEΜ, ACΜDΜE, and ΔBΜEΜ.
π Example: The simplified expression is F = ΔCDΔ + BCΜDΔ + ACΜDΜE + ΔBΜΔ + BΜCΜΔ
The function can also be represented as: F = ΔCΜDΜE + ΔCDΔ + ABΜCΜΔ + BΜCΜΔ + BΜDΔ
In both cases, the number of product terms is the same with the same number of variables.
π‘ Why this matters: The Quine-McCluskey method provides a systematic, algorithm-friendly approach to Boolean minimization that works for any number of variables, unlike Karnaugh maps which become unwieldy beyond 4-5 variables.
Combinational Logic
Individual gates (AND, OR, NOT, NAND, NOR, XOR, XNOR) in their individual capacity cannot perform any useful function. Logic gates must be connected together in different combinations to form Logic Circuits that perform useful operations like addition, comparison, etc. These combinations of gates that result in a circuit used to perform some function are known as Combinational Logic.
The function of any Digital Logic circuit is represented by Boolean expressions. Two forms of representing functions through Boolean expressions are the SOP (Sum of Products) and POS (Product of Sums) expressions. These two types of Boolean expressions are implemented using a combination of gates to form Combinational Logic Circuits.
Combinational Circuit Implementation based on SOP form
A standard way to express a Boolean expression is the SOP form. The expression has several product terms which are summed together through a single OR gate. The product terms can have variables and their complemented form. A SOP expression is implemented using a combinational circuit made up of many AND gates and a single OR gate (AND-OR gate combination). The inputs to the AND gates can be in the complemented form or the un-complemented form, requiring the use of NOT gates.
The implementation is based on three levels of gates (Figure 13.1):
- NOT gate level: Produces complemented literals
- AND gate level: Produces the product terms
- OR gate level: Sums all product terms through a single multiple-input OR gate
Combinational Circuit Implementation based on POS form
A standard way to express a Boolean expression is the POS form. The expression has several sum terms which are multiplied together through a single AND gate. The sum terms can have variables and their complemented form. A POS expression is implemented using a combinational circuit made up of many OR gates and a single AND gate (OR-AND gate combination).
The implementation is based on three levels of gates (Figure 13.2):
- NOT gate level: Produces complemented literals
- OR gate level: Produces the sum terms
- AND gate level: Multiplies all sum terms through a single multiple-input AND gate
Design and Implementation of Combinational Circuits
The design and implementation of a combinational circuit starts by defining the function of the Combinational circuit using a truth table or function table. Once the function table is defined, the combinational circuit can be directly implemented from the function table.
Direct implementation from the function table results in a circuit using maximum number of gates organized at three levels. This increases cost, size, power requirement, and propagation delay (order of three gates). Therefore, before implementing the circuit, the expression is simplified using Boolean Algebra rules, Karnaugh map method, or the Quine-McCluskey method if the number of variables exceeds 4.
Implementation of an Adjacent 1s Detector Circuit
A circuit that checks an input number and determines if it has two adjacent 1s is used as an example. The Adjacent 1s Detector accepts 4-bit inputs. If two adjacent 1s are detected in the input, the output is set to high. From the function table (Table 13.6), for input combinations 0011, 0110, 0111, 1011, 1100, 1101, 1110, and 1111, the output function F is 1.
1. SOP based Implementation of the Adjacent 1s Detector Circuit
Direct implementation from the function table based on the SOP form requires 8 AND gates for the 8 product terms with an 8-input OR gate (Figure 13.3). Total gate count: one 8-input OR gate, eight 4-input AND gates, and ten NOT gates.
The expression is simplified using a Karnaugh map (Figure 13.4). The simplified expression is: π Formula: F = AB + CD + BC β Plain English: The output is 1 when A and B are both 1, OR when C and D are both 1, OR when B and C are both 1.
The simplified circuit (Figure 13.5) uses only four gates: one 3-input OR gate and three 2-input AND gates. This reduces cost, size, power requirement, and propagation delay to the order of two gates.
The simplified SOP circuit can be implemented using only NAND Gates (Figure 13.6). Bubbles (NOT gates) are placed at the outputs of the three AND gates, converting them to NAND gates. Three bubbles are also placed at the three inputs of the OR gate, resulting in an alternate symbol for a three-input NAND gate. Implementing using only NAND gates helps reduce circuit size and cost as Integrated Circuit packages multiple gates in a single package.
2. POS based Implementation of the Adjacent 1s Detector Circuit
The POS based circuit has 8 sum terms requiring 8 OR gates and a single 8-input AND gate (Figure 13.7). Total gate count: one 8-input AND gate, eight 4-input OR gates, and ten NOT gates.
Both SOP and POS based circuits give identical outputs for identical input combinations. In this example, both implementations use exactly the same number of gates (19) as there are equal numbers of minterms (8) and maxterms (8).
The POS expression is simplified using a Karnaugh map (Figure 13.8): π Formula: F = (A + C)(B + C)(B + D) β Plain English: The output is 1 when (A OR C is 1) AND (B OR C is 1) AND (B OR D is 1).
The simplified POS circuit (Figure 13.9) uses only four gates: three 2-input OR gates and one 3-input AND gate. This can be implemented using only NOR Gates (Figure 13.10) by placing bubbles at the outputs of the three OR gates to convert them to NOR gates, and three bubbles at the three inputs of the AND gate to create an alternate symbol for a three-input NOR gate.
Operation of Adjacent 1s Detector Circuit
The operation can be verified by applying varying sets of input signals and comparing outputs with the function table. The timing diagram (Figure 13.11) shows inputs A, B, C, D changing over time intervals t0 to t8. At interval t0 with input 0000, all three OR gate outputs are 0 and output F is 0. At interval t3 with input 0011, OR gate outputs are 1, 1, 1 and output F is 1 (indicating adjacent 1s). At interval t6 with input 0110, OR gate outputs are 1, 1, 1 and output F is again 1.
Active low/high Inputs and Outputs
All circuits discussed so far have active-high outputs β normally at logic 0, set to 1 to indicate an active state. Combinational circuits can have active-high or active-low outputs. Converting from active-high to active-low requires inverting the output by connecting a NOT gate (adding a bubble). Circuits with bubbles at outputs are considered to have active-low outputs.
Circuits can also have active-high or active-low inputs. Active-low input circuits are activated on a logic 0 input and have bubbles connected to circuit inputs.
The four logic gates can be described in terms of input and output logic levels:
- AND gate: No bubbles at inputs or output; performs AND on two active-high inputs for active-high output
- OR gate: No bubbles at inputs or output; performs OR on two active-high inputs for active-high output
- NAND gate: Bubble at output; performs AND on two active-high inputs for active-low output
- NOR gate: Bubble at output; performs OR on two active-high inputs for active-low output
Figure 13.12 shows the SOP-based active-high circuit converted to active-low input and output by connecting NOT gates. The timing diagram (Figure 13.13) verifies operation. At interval t0, active-low input ABCD is 0000 (representing 1111), and active-low output F is 0 (indicating adjacent 1s detected). At intervals t1 to t4, active-low inputs represent 1110, 1101, 1100, and 1011 respectively, with output 0 indicating adjacent 1s.
Implementation of an Odd-Parity Generator Circuit
The Odd-Parity Generator circuit checks an 8-bit number and generates a parity bit to fulfill the Odd-Parity condition. The 8-bit data and parity bit are communicated to the receiver circuit, which checks both to determine if an error occurred. For simplicity, a 4-bit data with odd parity is assumed.
π‘ Why this matters: Parity generation and checking is fundamental for error detection in digital communication systems, ensuring data integrity during transmission.
β Key Takeaways
The Quine-McCluskey method provides a systematic algorithm for minimizing Boolean expressions with more than four variables by finding all Prime Implicants and then selecting essential ones using a Prime Implicant table. Combinational Logic circuits are built from gate combinations and their implementation depends on choosing between SOP and POS forms β the form with fewer minterms or maxterms yields a simpler circuit. The Adjacent 1s Detector demonstrates that Boolean expressions must be simplified (using K-maps or Quine-McCluskey) before implementation to reduce gate count, cost, power, and propagation delay. Any SOP circuit (AND-OR) can be converted to NAND-only implementation, and any POS circuit (OR-AND) can be converted to NOR-only implementation, which reduces IC package count. Active-low and active-high inputs/outputs don't change circuit logic but affect how signals are interpreted, requiring inversion through NOT gates when converting between them.
π§ Quick Revision Questions
- What are the essential Prime Implicants found for the Odd-Prime Number Detector function with five variables, and which minterms do they cover?
- How does the Quine-McCluskey method differ from Karnaugh maps in terms of applicability and procedure?
- What is the simplified SOP expression for the Adjacent 1s Detector, and how many gates does the simplified circuit use compared to the direct implementation?
- How do you convert an AND-OR (SOP) combinational circuit into a NAND-only implementation, and what is the advantage of doing so?
- What is the difference between active-high and active-low inputs/outputs, and how does the timing diagram change when converting a circuit from active-high to active-low?
π Lecture 14 β Implementation of an Odd-Parity Generator Circuit
π Overview: This lecture covers the implementation of an odd-parity generator circuit for error detection in digital data transmission, starting from a truth table and Karnaugh map simplification to the final logic circuit using XOR/XNOR gates. It also introduces combinational functional devices like half-adders and full-adders, and explores the critical issue of carry propagation in parallel binary adders and the use of look-ahead carry circuits to speed up addition.
ποΈ Topics Covered
This lecture begins with the design of an odd-parity generator for a 4-bit data system, including the function table and Karnaugh map simplification leading to a Boolean expression using XOR and XNOR gates. It then covers the operation and timing of the parity generator and an error detection circuit at the receiver end. The discussion then shifts to combinational functional devices, especially half-adders and full-adders, their logic circuits, and Boolean expressions. Finally, it explores parallel binary adders, the problem of carry propagation (ripple), and the solution provided by look-ahead carry generator circuits, concluding with MSI adder ICs like 74LS283.
π Lecture Summary
Implementation of an Odd-Parity Generator Circuit
The first step in implementing an odd-parity generator for an 8-bit data system (256 combinations) is too complex, so a simpler 4-bit data system is used. The function table for the odd-parity generator lists all 16 combinations of the 4-bit data (D3, D2, D1, D0) and the required parity bit (P). Since odd parity is used, the total number of 1s in the 4-bit data plus the parity bit must be odd. Therefore, the parity bit P is set to 1 when the data has an even number of 1s (including zero), making the total odd.
π Definition β Odd-Parity: A parity scheme where the total number of 1s in a data word including the parity bit is odd. π Example: For 4-bit data 0000 (even number of 1s), the odd-parity bit P is set to 1, making the total number of 1s (one) odd.
Karnaugh map of the Odd-Parity Generator Function
The information from the function table is mapped directly onto a four-variable K-map. None of the 1s in the K-map are adjacent to each other, which indicates that the function cannot be simplified using a K-map alone. However, using Demorgan's theorems and the rules of Boolean algebra, the expression can be simplified by recognizing the pattern of XOR and XNOR functions.
π Formula: The simplified Boolean expression for the odd-parity generator is P = (A β B) β (C β D). This means the parity bit is the XOR of all data bits. π Example: For inputs A=0, B=0, C=0, D=0: (0β0) β (0β0) = 0 β 0 = 0. But the function table shows P=1 for 0000. This expression is for even parity. Wait, the lecture shows that for odd parity, the function is an XNOR of the XOR results, or equivalently, the XOR of all bits has to be inverted. The lecture's final circuit uses an XNOR gate. The lecture text states the final expression as (A β B) β (C β D) but the circuit uses an XNOR. Let's check the circuit description. The output P is the output of an XNOR gate whose inputs are the outputs of two XOR gates. So the function is P = (A β B) βͺ (C β D). This is the XNOR function. Therefore, the odd parity bit is the XNOR of all data bits. If the data bits are 0000, P = (0β0) βͺ (0β0) = 0 βͺ 0 = 1. This matches the function table. π‘ Why this matters: The XOR/XNOR structure allows the parity generator to be built using just two XOR gates and one XNOR gate instead of many AND/OR gates.
Operation of Odd-Parity Generator Circuit
The timing diagram shows the operation of the parity generator circuit. During different time intervals (t0 to t8), the 4-bit data values change (e.g., 0000, 0001, 0010, 0011, 0100, 1000). The circuit's output P changes accordingly to ensure odd parity. For example, during interval t0 (data=0000), the outputs of the two XOR gates are 0 and 0, so the output of the XNOR gate (P) is 1.
π Example: During interval t1 (data=0001), the outputs of the two XOR gates are 1 and 0, so the output of the XNOR gate (P) is 0. The 4-bit data 0001 has one 1 (odd), so the parity bit is 0, keeping the total number of 1s odd.
XOR and XNOR Gates
XOR and XNOR gates are used to implement the odd-parity generator circuit because they perform simple comparison functions. The XOR gate detects dissimilar inputs (outputs 1 when inputs are different), while the XNOR gate detects similar inputs (outputs 1 when inputs are the same). These gates are considered functional devices and are available as integrated circuits. The function table for the parity error detector at the receiver is identical to the XOR gate's truth table.
π Formula: The Boolean expression for an XOR gate is A'B + AB' (often written as AβB). The Boolean expression for an XNOR gate is AB + A'B' (often written as AβͺB). π‘ Why this matters: XOR and XNOR gates are building blocks for many digital circuits, including comparators and arithmetic circuits.
Combinational Function Devices
Digital circuits are formed by combining logic gates. Most combinational circuits perform standard functions like addition, comparison, decoding, encoding, multiplexing, and de-multiplexing. Since implementing these functions from basic gates takes significant space, they are often implemented as MSI (Medium Scale Integration) chips. The simplest functional devices are NAND, NOR, XOR, and XNOR gates.
Half Adder and Full Adder
A single-bit binary adder circuit adds two bits and a carry bit from a previous addition. It has three inputs (bit A, bit B, and carry-in) and two outputs (sum and carry-out). A full adder has three inputs (including carry-in), while a half adder has only two inputs (A and B, no carry-in).
Half-Adder Function Table
The half-adder has a 2-bit input (A, B) and a 2-bit output (Sum, Carry Out).
| Input A | Input B | Sum | Carry Out |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 1 |
π Definition β Half-Adder: A combinational circuit that adds two single-bit binary numbers and produces a sum and a carry output. It has no provision for a carry input from a lower-order bit.
Half-Adder Sum & Carry Out Boolean Expressions
From the function table, the Boolean expressions for the half-adder are derived.
π Formula: Sum = A'B + AB' = A β B CarryOut = AB
Half-Adder Logic Circuit
The half-adder logic circuit can be directly implemented from its Boolean expressions: an XOR gate for the Sum and an AND gate for the Carry Out.
Full-Adder Function Table
The full adder has a 3-bit input (A, B, Carry In) and a 2-bit output (Sum, Carry Out).
| Input A | Input B | Carry In | Sum | Carry 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 |
π Definition β Full-Adder: A combinational circuit that adds three single-bit binary numbers (A, B, and a carry-in) and produces a sum and a carry output.
Full-Adder Sum & Carry Out Boolean Expressions
From the function table, the Boolean expressions for the full-adder are derived and simplified.
π Formula: Sum = A β B β C (where C is the carry-in) CarryOut = AB + C(A β B) = AB + BC + AC π Example: For inputs A=1, B=1, C=1: Sum = 1β1β1 = 0β1 = 1. CarryOut = (11) + 1(1β1) = 1 + 1*0 = 1. (1+1+1 = 11 in binary, correct).
Full-Adder Logic Circuit
The full-adder can be implemented directly from its Boolean expressions using XOR gates, AND gates, and OR gates.
Forming a Full-Adder using Half-Adders
A 1-bit full-adder can also be implemented by combining two half-adders and an OR gate. The first half-adder computes AβB and AB. The second half-adder computes (AβB) β Cin and (AβB)Cin. The final Carry Out is AB + (AβB)Cin.
Parallel Binary Adders
To add two 4-bit numbers, four single-bit full-adders are connected in series to form a 4-bit Parallel Adder. The two 4-bit numbers (A0-A3 and B0-B3) are applied to the circuit inputs, and the 4-bit sum (S0-S3) and a final carry-out (Cout) are produced. The carry-in (Cin) to the least significant adder is set to 0.
π Definition β Parallel Binary Adder: A circuit that adds two binary numbers of multiple bits simultaneously by connecting full-adders in parallel, where the carry-out of one stage feeds the carry-in of the next.
Carry Propagation
While parallel adders are straightforward to implement, they suffer from a practical limitation called carry propagation or carry ripple. The most significant bit (MSB) adder cannot proceed until it receives the carry from the next lower bit adder, which in turn depends on the carry from the one below it, and so on. The carry must propagate through each full-adder before reaching the most significant stage.
π Formula: If each gate has a propagation delay of 10 nsec, a 1-bit full adder generates a carry out after 30 nsec. For a 4-bit parallel adder, the carry out from the most significant adder would be after 4 Γ 30 nsec = 120 nsec. π Example: For an 8-bit, 16-bit, or 64-bit parallel adder, this delay becomes prohibitive (e.g., 64 Γ 30 nsec = 1920 nsec or 1.92 Β΅sec for 64-bit), which is too slow for modern computers.
Look-Ahead Carry Circuits
To overcome the problem of carry propagation, look-ahead carry generator circuits are used. These circuits examine the bits to be added (A and B) and determine if a higher-order carry is to be generated, without waiting for the ripple. In a full-adder, the output P (from the XOR gate) is called Carry Propagate (P), and the output G (from the AND gate) is called Carry Generate (G).
π Definition β Carry Propagate (P): P = AβB. If P=1, a carry from a lower stage will propagate through this stage. π Definition β Carry Generate (G): G = AΒ·B. If G=1, this stage will generate a carry-out regardless of the carry-in.
π Formula: Sum = P β C CarryOut = CP + G
The carry outputs for a 4-bit adder can be written in terms of P and G: C1 = C0P0 + G0 C2 = G1 + P1G0 + P0P1C0 C3 = G2 + P2G1 + P1P2G0 + P0P1P2C0 C4 = G3 + P3G2 + P2P3G1 + P1P2P3G0 + P0P1P2P3C0
Where Pn = An β Bn and Gn = AnBn.
The look-ahead carry generator circuit produces all carry outputs (C1, C2, C3, C4) after only two gate delays once the P and G terms are available, significantly reducing the overall delay. For example, C1 is available after just two gate delays (one AND gate and one OR gate), and C2, C3, and C4 are also available after two gate delays. π‘ Why this matters: This drastically speeds up addition, making it feasible for 16-bit, 32-bit, and 64-bit adders used in modern processors.
MSI Adders
4-bit parallel adders with look-ahead carry circuitry are available as MSI (Medium Scale Integrated Circuit) chips. Two common ICs are 74LS83A and 74LS283 (functionally identical but not pin-compatible). The 16-pin package includes 4 pins for input A, 4 for input B, 4 for output Sum, 1 for Carry In, 1 for Carry Out, plus power and ground. These ICs can be cascaded to form 8-bit, 12-bit, or 16-bit parallel adders by connecting the Carry Out of one IC to the Carry In of the next.
β Key Takeaways
The most critical concepts from this lecture include: (1) the odd-parity generator circuit can be efficiently implemented using XOR and XNOR gates, with the expression P = (AβB) βͺ (CβD) for 4-bit data; (2) a half-adder adds two bits (Sum = AβB, Cout = AΒ·B), while a full-adder adds three bits (Sum = AβBβCin, Cout = AB + Cin(AβB)); (3) parallel binary adders suffer from carry propagation delay, which increases linearly with the number of bits; (4) look-ahead carry generators solve this by producing carry outputs in parallel, after only two gate delays, using Carry Propagate (P = AβB) and Carry Generate (G = AΒ·B) signals; and (5) MSI adder ICs like 74LS283 integrate this technology and can be cascaded for larger word sizes.
π§ Quick Revision Questions
- What is the simplified Boolean expression for a 4-bit odd-parity generator circuit, and which gates are used to implement it?
- Explain the difference between a half-adder and a full-adder. What are their respective Boolean expressions for Sum and Carry Out?
- What is the main problem with a ripple-carry parallel adder, and how does it affect performance for a 64-bit system?
- Define the terms "Carry Propagate (P)" and "Carry Generate (G)" in the context of a full-adder. How are they used in a look-ahead carry generator?
- How can MSI adder ICs like the 74LS283 be used to create a 12-bit binary adder?