Switching theory-M2-Ktunotes.in
Switching theory-M2-Ktunotes.in
AND
LOGIC SIMPLIFICATION
Boolean Addition
Recall from part 3 that Boolean addition is equivalent to the OR
operation. In Boolean algebra, a sum term is a sum of literals. In logic
circuits, a sum term is produced by an OR operation with no AND
operations involved. Some examples of sum terms are A + B, A + B, A +
B + C, and A + B + C + D.
A sum term is equal to 1 when one or more of the literals in the term are 1. A
sum term is equal to 0 only if each of the literals is 0.
Example
Determine the values of A, B, C, and D that make the sum term
A+B+C+D equal to 0.
Commutative Laws
►The commutative law of addition for two variables is written as
A+B = B+A
This law states that the order in which the variables are ORed makes no
difference. Remember, in Boolean algebra as applied to logic circuits,
addition and the OR operation are the same. Fig.(4-1) illustrates the
commutative law as applied to the OR gate and shows that it doesn't matter
to which input each variable is applied. (The symbol ≡ means "equivalent
to.").
Associative Laws :
►The associative law of addition is written as follows for three variables:
A + (B + C) = (A + B) + C
This law states that when ORing more than two variables, the result is the
same regardless of the grouping of the variables. Fig.(4-3), illustrates this
law as applied to 2-input OR gates.
Distributive Law:
►The distributive law is written for three variables as follows:
A(B + C) = AB + AC
This law states that ORing two or more variables and then ANDing the result
with a single variable is equivalent to ANDing the single variable with each
of the two or more variables and then ORing the products. The distributive
law also expresses the process of factoring in which the common variable A
is factored out of the product terms, for example,
AB + AC = A(B + C).
Fig.(4-5) illustrates the distributive law in terms of gate
implementation.
Rule 1. A+0=A
A variable ORed with 0 is always equal to the variable. If the input variable
A is 1, the output variable X is 1, which is equal to A. If A is 0, the output is
0, which is also equal to A. This rule is illustrated in Fig.(4-6), where the
lower input is fixed at 0.
Fig.(4-6)
Fig.(4-7)
Rule 3. A.0=0
A variable ANDed with 0 is always equal to 0. Any time one input to an
AND gate is 0, the output is 0, regardless of the value of the variable on the
other input. This rule is illustrated in Fig.(4-8), where the lower input is fixed
at 0.
Fig.(4-8)
Rule 4. A.1=A
A variable ANDed with 1 is always equal to the variable. If A is 0 the output
of the AND gate is 0. If A is 1, the output of the AND gate is 1 because both
inputs are now 1s. This rule is shown in Fig.(4-9), where the lower input is
fixed at 1.
Fig.(4-9)
Fig.(4-10)
Rule 6. A+A=1
A variable ORed with its complement is always equal to 1. If A is 0, then 0 +
0 = 0 + 1 = 1. If A is l, then 1 + 1 = 1+ 0 = 1. See Fig.(4-11), where one
input is the complement of the other.
Fig.(4-11)
Rule 7. A.A=A
A variable ANDed with itself is always equal to the variable. If A = 0,
then 0.0 = 0; and if A = 1. then 1.1 = 1. Fig.(4-12) illustrates this rule.
Fig.(4-12)
Fig.(4-13)
Rule 9 A=A
The double complement of a variable is always equal to the variable. If you
start with the variable A and complement (invert) it once, you get A. If you
then take A and complement (invert) it, you get A, which is the original
variable. This rule is shown in Fig.(4-14) using inverters.
Fig.(4-14)
Rule 10. A + AB = A
This rule can be proved by applying the distributive law, rule 2, and rule 4 as
follows:
A + AB = A( 1 + B) Factoring (distributive law)
=A.l Rule 2: (1 + B) = 1
=A Rule 4: A . 1 = A
The proof is shown in Table 4-2, which shows the truth table and the
resulting logic circuit simplification.
Rule 11. A + AB = A + B
This rule can be proved as follows:
A + AB = (A + AB) + AB Rule 10: A = A + AB
= (AA + AB) + AB Rule 7: A = AA
=AA +AB +AA +AB Rule 8: adding AA = 0
= (A + A)(A + B) Factoring
= 1. (A + B) Rule 6: A + A = 1
=A + B Rule 4: drop the 1
The proof is shown in Table 4-3, which shows the truth table and the
resulting logic circuit simplification.
Table 4-3
The proof is shown in Table 4-4, which shows the truth table and the
resulting logic circuit
simplification.
Table 4-4
Example
Apply DeMorgan's theorems to the expressions XYZ and X + Y + z.
XYZ = X + Y + Z
X+y+Z=XYZ
Example
Apply DeMorgan's theorems to the expressions WXYZ and W + X + y + z.
WXYZ = W + X + y + Z
W+X+y+Z=WXYZ
Step l. Identify the terms to which you can apply DeMorgan's theorems, and
think of each term as a single variable. Let A + BC = X and D(E + F) = Y.
Step 2. Since X + Y = X Y,
Step 5. Use rule 9 (A = A) to cancel the double bars over the E + F part of
the term.
(A + BC)(D + E + F) = (A + BC)(D + E + F)
Example
Apply DeMorgan's theorems to each of the following expressions:
Example
Using Boolean algebra techniques, simplify this expression:
AB + A(B + C) + B(B + C)
Solution
Step 1: Apply the distributive law to the second and third terms in the
expression, as follows:
AB + AB + AC + BB + BC
Step 2: Apply rule 7 (BB = B) to the fourth term.
AB + AB + AC + B + BC
Step 3: Apply rule 5 (AB + AB = AB) to the first two terms.
AB + AC + B + BC
Step 4: Apply rule 10 (B + BC = B) to the last two terms.
Example
Simplify the Boolean expressions:
1- AB + A(B + C) + B(B + C).
2- [AB( C + BD) + A B]C
3- ABC + ABC + A B C + ABC + ABC
Example
Convert each of the following Boolean expressions to SOP form:
(a) AB + B(CD + EF)
(b) (A + B)(B + C + D)
(c) (A + B) + C
Example
Convert the following Boolean expression into standard SOP form:
ABC + AB + ABCD
Solution
The domain of this SOP expression A, B, C, D. Take one term at a time.
The first term, ABC, is missing variable D or D, so multiply the first term by
(D + D) as follows:
ABC = ABC(D + D) = ABCD + ABCD
In this case, two standard product terms are the result.
The second term, AB, is missing variables C or C and D or D, so first
multiply the second term by C + C as follows:
AB = AB(C + C) = ABC + ABC
Fig.(4-20)
Example
Convert the following Boolean expression into standard POS form:
(A + B + C)(B + C + D)(A + B + C + D)
Solution
The domain of this POS expression is A, B, C, D. Take one term at a time.
The first term, A + B + C, is missing variable D or D, so add DD and apply
rule 12 as follows:
A + B + C = A + B + C + DD = (A + B + C + D)(A + B + C + D)
The second term, B + C + D, is missing variable A or A, so add AA and
apply rule 12 as follows:
B + C + D = B + C + D + AA = (A + B + C + D)(A + B + C + D)
The third term, A + B + C + D, is already in standard form. The standard
POS form of the original expression is as follows:
F=xyz+xyz+xyz
F = m1 + m4 + m7
The complement of F = F = F
F = (x + y + z) (x + y + z) (x + y + z) (x + y + z) (x + y + z)
F = M0 M2 M3 M5 M6
Example
Express the Boolean function F = A + BC in a sum of minterms (SOP).
Solution
The term A is missing two variables because the domain of F is (A, B, C)
A = A(B + B) = AB + AB because B + B = 1
In short notation
F(A, B, C) = ∑(1, 4, 5, 6, 7)
F(A, B, C) = ∑(0, 2, 3)
A B C B BC F
0 0 0 0 1 0 0
1 0 0 1 1 1 1
2 0 1 0 0 0 0
3 0 1 1 0 0 0
4 1 0 0 1 0 1
5 1 0 1 1 1 1
6 1 1 0 0 0 1
7 1 1 1 0 0 1
Example
Determine the truth table for the following standard POS expression:
(a) (b)
Fig.(5-1) A 3-variable Karnaugh map showing product terms.
(a) (b)
Fig.(5-2) A 4-variable Karnaugh map.
Cell Adjacency
The cells in a Karnaugh map are arranged so that there is only a single-
variable change between adjacent cells. Adjacency is defined by a single-
variable change. In the 3-variable map the 010 cell is adjacent to the 000
cell, the 011 cell, and the 110 cell. The 010 cell is not adjacent to the 001
cell, the 111 cell, the 100 cell, or the 101 cell.
Example
Map the following standard SOP expression on a Karnaugh map:
see Fig.(5-4).
Example
Map the following standard SOP expression on a Karnaugh map:
See Fig.(5-5).
Fig.(5-5)
Example
Example
Map the following SOP expression on a Karnaugh map:
Solution
The SOP expression is obviously not in standard form because each product
term does not have four variables.
Map each of the resulting binary values by placing a 1 in the appropriate cell
of the 4- variable Karnaugh map.
Fig.(5-6)
Solution:
The groupings are shown in Fig.(5-7). In some cases, there may be more
than one way to group the 1s to form maximum groupings.
Fig.(5-7)
Determine the minimum product term for each group.
a. For a 3-variable map:
(1) A l-cell group yields a 3-variable product term
(2) A 2-cell group yields a 2-variable product term
(3) A 4-cell group yields a 1-variable term
(4) An 8-cell group yields a value of 1 for the expression
Example:
Determine the product terms for each of the Karnaugh maps in Fig.(5-7) and
write the resulting minimum SOP expression.
Fig.(5-8)
Solution:
The resulting minimum product term for each group is shown in Fig.(5-8).
The minimum SOP expressions for each of the Karnaugh maps in the figure
are:
(a)AB+BC+ABC (C) AB + AC + ABD
(b) B + A C + AC (d) D + ABC + BC
Fig.(5-9)
In this section, we will focus on POS expressions. The approaches are much
the same except that with POS expressions, 0s representing the standard sum
terms are placed on the Karnaugh map instead of 1s.
Step 1. Determine the binary value of each sum term in the standard POS
expression. This is the binary value that makes the term equal to 0.
Step 2. As each sum term is evaluated, place a 0 on the Karnaugh map in the
corresponding cell.
Example:
Map the following standard POS expression on a Karnaugh map:
Solution:
The process for minimizing a POS expression is basically the same as for an
SOP expression except that you group 0s to produce minimum sum terms
instead of grouping 1s to produce minimum product terms. The rules for
grouping the 0s are the same as those for grouping the 1s that you learned
before.
Example:
Use a Karnaugh map to minimize the following standard POS expression:
Also, derive the equivalent SOP expression.
Solution:
Fig.(5-12)
The simplified SOP expression yields
x = DE + BCE + ABD + BC DE
1- AND-OR Logic
Fig.(6-1)(a) shows an AND-OR circuit consisting of two 2-input AND gates
and one 2-input OR gate; Fig.(6-1)(b) is the ANSI standard rectangular outline
symbol. The Boolean expressions for the AND gate outputs and the resulting
SOP expression for the output X are shown in the diagram. In general, all
AND-OR circuit can have any number of AND gates each with any number of
inputs.
The truth table for a 4-input AND-OR logic circuit is shown in Table 6-1. The
intermediate AND gate outputs ( AB and CD columns) are also shown in the
table.
Fig.(6-1)
For a 4-input AND-OR logic circuit, the output X is HIGH (1) if both input
A and input B are HIGH (1) or both input C and input D are HIGH (1).
Fig.(6-2)
3-Exclusive-OR logic
The exclusive-OR gate was introduced before. Although, because of its
importance, this circuit is considered a type of logic gate with its own unique
symbol it is actually a combination of two AND gates, one OR gate, and two
inverters, as shown in Fig.(6-3)(a). The two standard logic symbols are shown
in parts (b) and (c).
Fig.(6-3)
Can be written as
Table 6-2 Truth table for an exclusive-OR.
Notice that the output X is HIGH only when the two inputs, A and B, are at the
same level.
Fig.(6-4)
Example
Develop a logic circuit with four input variables that will only produce a 1
output when exactly three input variables are 1s. Fig.(6-5) shows the circuit.
Fig.(6-5)
Fig.(6-6)
Solution
Fig.(6-7)
Fig.(6-9)
X=A+B=AB
Fig.(6-10)(d) shows how NOR gates are used t0 form a NAND function.
Fig.(6-10)
Example
1- Write the output expression for each circuit as it appears in Fig.(6-
11) and then change each circuit to an equivalent AND-OR
configuration.
2- Develop the truth table for circuit in Fig.(6-11)(a-b).
3- Show that an exclusive-NOR circuit produces a POS output.
A half-adder adds two bits and produces a sum and a carry output. Adders are
important in computers and also in other types of digital systems in which
numerical data are processed.
The Half-Adder
0+ 0= 0
0+ 1= 1
1+ 0= 1
1 + 1 = 10
The half-adder accepts two binary digits on its inputs and produces two binary
Half-Adder Logic: From the operation of the half-adder as stated in Table 7-1,
expressions can be derived for the sum and the output carry as functions of the
inputs. Notice that the output Carry (Cout) is a 1 only when both A and B are 1s:
therefore. Cout can be expressed
Cout = AB
Now observe that the sum output ( ∑ ) is a 1 only if the input variables A and B,
are not equal. The sum can therefore be expressed as the exclusive-OR of the input
variables.
∑=AB
Table 7-1
The Full-Adder
The second category of adder is the full-adder. The full-adder accepts two input
bits and an input carry and generates a sum output and an output carry.
The basic difference between a full-adder and a half-adder is that the full-adder
accepts an input carry. A logic symbol for a full-adder is shown in Fig.(7-3), and
the truth table in Table 7-2 shows the operation of a full-adder.
Cout = AB + (AB)Cin
Notice in Fig.(7-4) there are two half-adders, connected as shown in the block
diagram of Fig.(7-5), with their output carries ORed.
Example: For each of the three full-adders in Fig.(7-6), determine the outputs for
the inputs shown.
Fig.(7-6)
As you saw in Section 7-1, a single full-adder is capable of adding two 1-bit
numbers and an input carry. To add binary numbers with more than one bit, you
must use additional full-adders. When one binary number is added to another, each
column generates a sum bit and a 1 or 0 carry bit to the next column to the left, as
illustrated here with 2-bit numbers.
To add two binary numbers, a full-adder is required for each bit in the numbers. So
for 2-bit numbers, two adders are needed; for 4-bit numbers, four adders are used;
and so on. The carry output of each adder is connected to the carry input of the
next higher-order adder, as shown in Fig.(7-7) for a 2-bit adder. Notice that either a
half-adder can be used for the least significant position or the carry input of a full-
adder can be made 0 (grounded) because there is no carry input to the least
significant bit position.
Fig.(7-8)
A group of four bits is called a nibble. A basic 4-bit parallel adder is implemented
with four full-adder stages as shown in Fig.(7-9). Again, the LSBs (A1 and B1) in
each number being added go into the right-most full-adder: the higher-order bits
are applied as shown to the successively higher-order added, with the MSBs (A
and B) in each number being applied to the left-most full-adder. The Carry output
of each adder is connected to the carry input of the next higher-order adder as
indicated. These are called internal carries.
Fig.(7-9)(a)
Amethod for adding three or more numbers at a time is called carry-save addition.
This process is illustrated in Example below:
Example: 00011 A
00001 B
+ 01001 C
A B C A B C A B C A B C
Co S Co S Co S Co S
A B C A B C A B C A B C
Co S Co S Co S Co S
7-3 COMPARATORS
Equality
The exclusive-OR gate can be used as a basic comparator because its output is a 1
if the two input bits are not equal and a 0 if the input bits are equal. Fig.(7-11)
shows the exclusive-OR gate as a 2-bit comparator.
Inequality
3. If A3 = B3, then you must examine the next lower bit position for an inequality.