Sunteți pe pagina 1din 8

4.

Switching Algebra
o Objectives o Reading Assignment
The great advantage of using logical expressions to n Boolean algebra was introduced in Elec 220, and a similar
represent the behavior of gate networks is that there approach is presented in section 2.5 (pages 27-35) in
are mathematical tools available to manipulate these Brown & Vranesic. Both of these approaches restrict the
presentation to the 2-valued Boolean algebra and start with
expressions. These tools are based on the theory of axioms and theorems involving the operations AND, OR
Boolean algebra, so this section will: and NOT. These notes take a different approach. First they
n Define Boolean algebras and derive those properties most do not assume that the Boolean algebra has only two
useful for the design of gate networks. elements. Second they start from a set of axioms using only
n Illustrate the use of the theorems of Boolean algebra to the operations AND and XOR.
simplify logical expressions.
n Establish the connection between the two main behavior
models for gate networks, namely logical expressions and
truth tables, using the two standard canonical forms of
logical expressions.

Elec 326 4.1 Switching Algebra Elec 326 4.2 Switching Algebra

4.1. Boolean Algebras n Example: BA2, the two-element Boolean algebra


B = {0, 1}, • and ⊕ defined by the truth tables for
o DEFINITION. A Boolean algebra is a non-empty set B and AND and EXCLUSIVE OR.
two binary operations • and ⊕ which satisfy the following X Y X•Y X Y X⊕Y
axioms, for all X, Y, and Z in B. 0 0 0 0 0 0
0 1 0 0 1 1
A1. (X ⊕ Y) ⊕ Z = X ⊕ (Y ⊕ Z) Associative 1 0 0 1 0 1
A2. X ⊕ Y = Y ⊕ X Commutative 1 1 1 1 1 0
A3. There is an element 0 in B, Identity
such that X ⊕ 0 = X o Truth Tables of Expressions in BA2:
A4. X ⊕ X = 0 Self Inverse
n We can use truth tables of expressions to prove theorems
A5. (X•Y)•Z = X•(Y•Z) Associative
and verify axioms, a technique called proof by perfect
A6. X•Y = Y•X Commutative induction. Z Y X X•Y X•Z Y⊕Z X• (Y ⊕ Z) (X•Y) ⊕ (X•Z)
A7. There is an element 1 in B, Identity 0 0 0 0 0 0 0 0
such that X•1 = X 0 0 1 0 0 0 0 0
A8. X•X = X Idempotent 0 1 0 0 0 1 0 0
0 1 1 1 0 1 1 1
A9. X•(Y ⊕ Z) = (X•Y) ⊕ (X•Z) Distributive 1 0 0 0 0 1 0 0
1 0 1 0 1 1 1 1
1 1 0 0 0 0 0 0
1 1 1 1 1 0 0 0

Elec 326 4.3 Switching Algebra Elec 326 4.4 Switching Algebra

1
o DEFINITION. Two logical expressions in BA2 are o PRINCIPLE OF DUALITY. Given an identity involving
only variables, the operations +, •, and ', and the constants 0
equivalent if they have the same truth table. and 1, another identity can be obtained by interchanging +'s
o DEFINITION. The binary operation OR (+) and the with •'s and 0's with 1's. These two identities are said to be
duals of one another.
unary operation NEGATION (') are defined as
follows. o The following three theorems develop properties of the OR
D1. X + Y = X ⊕ Y ⊕ (X•Y) operation that are similar to the AND and the Exclusive OR
D2. X' = 1 ⊕ X operations.
n Example: In BA2 we see that + is the familiar OR THEOREM T1. (Dual of A6) X + Y = Y + X
operation. Proof: X + Y = X ⊕ Y ⊕ (X•Y) (by D1)
= Y ⊕ X ⊕ (Y•X) (by A2 and A6)
= Y +X (by D1)
X Y X•Y X⊕Y X ⊕Y ⊕(X•Y)
0 0 0 0 0 THEOREM T2. (Dual of A8) X + X = X
0 1 0 1 1 Proof: X + X = X ⊕ X ⊕ X•X (by D1)
1 0 0 1 1 = 0 ⊕ (X•X) (by A4)
= (X•X) (by A3)
1 1 0 0 1
= X (by A8)

Elec 326 4.5 Switching Algebra Elec 326 4.6 Switching Algebra

THEOREM T3. (Dual of A5) (X + Y) + Z = X + (Y + Z)


Proof: (X + Y) + Z = (X ⊕ Y ⊕ X•Y) + Z
THEOREM T6. X + 0 = X
= (X ⊕ Y ⊕ X•Y) ⊕ Z ⊕ (X ⊕ Y ⊕ X•Y)•Z
Proof:
= (X ⊕ Y ⊕ Z ⊕ X•Y ) ⊕ (X•Z) ⊕ (Y•Z) ⊕ (X•Y •Z)
X + (Y + Z) = X + (Y ⊕ Z ⊕ Y•Z)
= X ⊕ (Y ⊕ Z ⊕ Y•Z) ⊕ X•(Y ⊕ Z ⊕ Y•Z)
= X ⊕ Y ⊕ Z ⊕ (X•Y) ⊕ (X•Z) ⊕ (Y•Z) ⊕ (X•Y •Z)
o The following five theorems show how the special elements 0
and 1 combine with other elements.
THEOREM T7. 1' = 0
THEOREM T4. X•0 = 0
Proof: 1' = 1 ⊕ 1 (by D2)
Proof: = 0 (by A4)

THEOREM T8. 0' = 1


THEOREM T5. X + 1 = 1
Proof: This theorem is the dual of T7.
Proof: This theorem is the dual of Theorem T4.

Elec 326 4.7 Switching Algebra Elec 326 4.8 Switching Algebra

2
o The following theorems give three properties of the negation
operation that are very useful in simplifying complex
o Theorems T9 and T10 are distributive laws for the expressions.
operations • and +. Not only does • distributive over
THEOREM T11. X•X' = 0
+, but + distributes over •.
Proof:

THEOREM T9. X•(Y + Z) = (X•Y) + (X•Z)


Proof: X•(Y + Z) = X•(Y ⊕ Z ⊕ Y•Z) (by D1)
THEOREM T12. X + X' = 1
= (X•Y) ⊕ (X•Z) ⊕ (X•Y•Z) (by A9)
Proof: This is the dual of T11.
(X•Y) + (X•Z) = (X•Y) ⊕ (X•Z) ⊕ (X•Y) • (X•Z) (by D1)
= (X•Y) ⊕ (X•Z) ⊕ (X•Y•Z) (by A6 and A8) THEOREM T13. (X')' = X
Proof: (X')' = (1 ⊕ X)' (by D2)
THEOREM T10. X + (Y•Z) = (X + Y)•(X + Z) = 1 ⊕ (1 ⊕ X) (by D2)
Proof: This theorem is the dual of T9. = (1 ⊕ 1) ⊕ X (by A1)
= 0⊕X (by A4)
= X (by A3)

Elec 326 4.9 Switching Algebra Elec 326 4.10 Switching Algebra

o The next two theorems establish another relationship


between the operations ⊕, +, •, and '. o Theorem T16 and its dual, Theorem T17, are known
as DeMorgan's Law.
THEOREM T14. X ⊕ Y = X•Y' + X'•Y THEOREM T16. (X•Y)' = X' + Y'

Proof: X•Y'+ X'•Y = (X•Y') ⊕ (X'•Y) ⊕ (X•Y')•(X'•Y) (by D1) Proof: (X') + (Y') = X' ⊕ Y' ⊕ X'•Y' (by D1)

= (X•Y') ⊕ (X'•Y) ⊕ (X•X')•(Y•Y') (by A6) = (1 ⊕ X) ⊕ (1 ⊕ Y) ⊕ (1 ⊕ X)•(1 ⊕ Y) (by D2)


= (X•Y') ⊕ (X'•Y) ⊕ 0 (by T11 and A8) = (1 ⊕ 1) ⊕ X ⊕ Y ⊕ 1 ⊕ X ⊕ Y ⊕ X•Y (by A2 and A9)
= (X•Y') ⊕ (X'•Y) (by A3)
= 1 ⊕ X•Y (by A4)
= X•(1 ⊕ Y) ⊕ (1 ⊕ X)•Y (by D2)
= X ⊕ (X•Y) ⊕ Y ⊕ (X•Y) (by A9) = (X•Y)' (by D2)
= (X ⊕ Y) ⊕ (X•Y ⊕ X•Y) (by A2)
= (X ⊕ Y) ⊕ 0 (by A4)
THEOREM T17. (X + Y)' = X'•Y'
= (X ⊕ Y) (by A3)
Proof: This theorem is the dual of T16.
THEOREM T15. X ⊕ Y = (X + Y)•(X' + Y')
Proof: Exercise. Don’t use definitions D1 or D2.

Elec 326 4.11 Switching Algebra Elec 326 4.12 Switching Algebra

3
o The following theorems are useful for simplifying
complex expressions since they show how an THEOREM T20. X•(X' + Y) = X•Y
expression can be replaced by an equivalent Proof: X•(X' + Y) = X•(X'⊕ Y ⊕ X'•Y) (by D1)
expression with fewer symbols. = (X•X') ⊕ (X•Y) ⊕ (X•X'•Y) (by A9)
= 0 ⊕ X•Y ⊕ 0 (by T11)
THEOREM T18. X•(X + Y) = X = X•Y (by A3)
Proof: X•(X + Y) = X•(X ⊕ Y ⊕ X•Y) (by D1)
= (X•X) ⊕ (X•Y) ⊕ (X•X•Y) (by A9) THEOREM T21. X + X'•Y = X + Y
= X ⊕ (X•Y) ⊕ (X•Y) (by A8) Proof: This theorem is the dual of T20.
= X⊕0 (by A4)
= X (by A3) DEFINITION. The binary operation ≡ is defined as
follows.
THEOREM T19. X + (X•Y) = X D3. (X ≡ Y) = (X ⊕ Y)'
Proof: This theorem is the dual of T18.

Elec 326 4.13 Switching Algebra Elec 326 4.14 Switching Algebra

o The last two theorems can be viewed as alternative o Exercises:


definitions of the operation ≡ in terms of the
operations +, •, and '. n Let X be a set and P(X) be the set of all subsets of X.
Describe how you would prove that P(X) with the
THEOREM T22. (X ≡ Y) = X'•Y'+ X•Y operations of set intersection, union, and complementation
is a Boolean algebra.
Proof: Exercise.

n Prove that NAND and NOR are universal primitives .


THEOREM T23. (X ≡ Y) = (X' + Y)•(X + Y')

Proof: Exercise.

Elec 326 4.15 Switching Algebra Elec 326 4.16 Switching Algebra

4
4.2. Algebraic Simplification
o Example 1 o Example 2

( (A ⊕ B)•(A•C) )•( (A•B)' + (A ⊕ B) ) (X•Y' + Y•Z)•(Y•Z'+ X•Z)

Elec 326 4.17 Switching Algebra Elec 326 4.18 Switching Algebra

4.3. Canonical Forms


o Example 3 o Definitions (SOP)
n Literal: Variable or complement of a variable.
( ( (X•Y')' + Z•X')' • (X•Y'•Z') )' n Product Term: A single literal or a product (AND) of 2 or
more literals.
n Sum of Products: Logical sum (OR) of product terms.
n Normal Product Term: Product term with no repeated
variables.
n Minterm over N Variables: Normal product term with N
variables.
n Canonical Sum Of Products: Sum of unique minterms.

Elec 326 4.19 Switching Algebra Elec 326 4.20 Switching Algebra

5
o Truth tables of Minterms
o Definitions (POS) n The truth table of a minterm has exactly one 1.
n Sum Term: A single literal or a sum (OR) of 2 or more
literals. m0 = m1 = m2 = m3 = m4 = m5 = m6 = m7 =
X Y Z X'•Y'•Z' X'•Y'•Z X'•Y•Z' X'•Y•Z X•Y'•Z' X•Y'•Z X•Y •Z' X•Y •Z
n Product of Sums: Logical product of sum terms. 0 0 0 1 0 0 0 0 0 0 0
n Normal Sum Term: Sum term with no repeated variables. 0 0 1 0 1 0 0 0 0 0 0
0 1 0 0 0 1 0 0 0 0 0
n Maxterm over N variables: Normal sum term with N
0 1 1 0 0 0 1 0 0 0 0
variables. 1 0 0 0 0 0 0 1 0 0 0
n Canonical Product of Sums: Product of unique maxterms. 1 0 1 0 0 0 0 0 1 0 0
1 1 0 0 0 0 0 0 0 1 0
1 1 1 0 0 0 0 0 0 0 1

n Note that order is important:


m4(Z, Y, X) = Z•Y'•X'
m4(X, Y, Z) = X•Y'•Z'

Elec 326 4.21 Switching Algebra Elec 326 4.22 Switching Algebra

o Truth Tables and Canonical Sum of Products Forms. o Truth Tables of Maxterms
ABC m4 m2 m4+m 2 m0+m 1+m 3+m4 n The truth table of a maxterm has exactly one 0.
0 0 0 0 0 0 1
M0 = M1 = M2 = M3 = M4 = M5 = M6 = M7 =
0 0 1 0 0 0 1
X Y Z X+Y+Z X+Y+Z' X+Y'+Z X+Y'+Z' X'+Y+Z X'+Y+Z' X'+Y'+Z' X'+Y'+Z'
0 1 0 0 1 1 0
0 0 0 0 1 1 1 1 1 1 1
0 1 1 0 0 0 1
0 0 1 1 0 1 1 1 1 1 1
1 0 0 1 0 1 1
0 1 0 1 1 0 1 1 1 1 1
1 0 1 0 0 0 0
0 1 1 1 1 1 0 1 1 1 1
1 1 0 0 0 0 0 1 0 0 1 1 1 1 0 1 1 1
1 1 1 0 0 0 0 1 0 1 1 1 1 1 1 0 1 1
1 1 0 1 1 1 1 1 1 0 1
o Listing the order of variables and the minterm 1 1 1 1 1 1 1 1 1 1 0
subscripts is enough to completely specify a logical
function of those variables.
SA,B,C (0, 1, 3, 4) = m0+m1+m3+m4
= A'•B'•C' + A'•B'•C + A'•B•C + A•B'•C'

Elec 326 4.23 Switching Algebra Elec 326 4.24 Switching Algebra

6
o Truth tables and canonical product of sums forms
o Exercise:
ABC M4 M2 M4•M2 M2 • M4 • M5 • M7
0 0 0 1 1 1 1
0 0 1 1 1 1 1 n Determine the relationship between minterm mi and
0 1 0 1 0 0 0 maxterm Mi
0 1 1 1 1 1 1
1 0 0 0 1 0 0 n Determine an easy way to convert a canonical sum of
1 0 1 1 1 1 0 products to an equivalent canonical product of sums, and
1 1 0 1 1 1 1 vice versa.
1 1 1 1 1 1 0

PA,B,C(2, 4, 5, 7) = M2•M4 • M5 • M
= (A+B'+C)•(A'+B+C)•(A'+B+C')•(A'+B'+C')

Elec 326 4.25 Switching Algebra Elec 326 4.26 Switching Algebra

4.4. Tips and Tricks 4.5. Pitfalls

o Use T14 and T15 to eliminate XOR operations. o Forgetting about T18, T19, T20 and T21.
T18. X•(X + Y) = X
o Use deMorgan's law to push negation symbols into
T19. X + (X•Y) = X
an expression.
T20. X•(X' + Y) = X•Y
o A good way to start simplifying an expression is to T21. X + X'•Y = X + Y
multiply it out and look (hope) for terms to drop
out.
o Getting the complements reversed on the maxterm
expressions.

Elec 326 4.27 Switching Algebra Elec 326 4.28 Switching Algebra

7
4.6. Review
o The definitions and axioms that define Boolean
algebras.
n The equivalence of different sets of definitions and axioms.
o Algebraic proof technique.
o Canonical Forms
n Minterms and Maxterms

Elec 326 4.29 Switching Algebra

S-ar putea să vă placă și