SCLD M3 SwitchingAlgebra
SCLD M3 SwitchingAlgebra
Module 3
Switching Algebra and Properties
• Switching Algebra:
• An algebraic system defined on the set {0, 1}, with two binary operations AND and
OR, and one unary operation NOT.
• AND operation, also called logical product, is denoted by ‘.’ or ‘∧’
• OR operation, also called logical sum, is denoted by ‘+’ or ‘∨’
• NOT operation, also called complement, is denoted by single-quote or ‘~’
• Switching Variables:
• Two-valued variables that can take on two distinct values 0 and 1.
• Switching Expressions:
• An expression consisting of switching variables, constants and operators.
x y (x + y)’ x’ . y’ (x.y)’ x’ + y’
0 0 1 1 1 1
0 1 0 0 1 1
1 0 0 0 1 1
1 1 0 0 0 0
Switching Circuits and Logic Design (CS20202) 14
Using De Morgan’s Theorem: Example 1
• F = (A . B’ + A’ . B)’
• F = (A B C’ + D)’ + (A B’ + B C’)’
• F = (A B C)’ (A + C) (A + C’)
• f (w, x, y) = w x’ y + w x + w y’ + w x y’
A safe has five locks v, w, x, y and z, all of which must be unlocked for the safe to be
open. The keys to the locks are distributed among five security officers as follows:
• Officer A has keys for locks v and x
• Officer B has keys for locks v and y
• Officer C has keys for locks w and y
• Officer D has keys for locks x and z
• Officer E has keys for locks v and z
Find all combinations of security officers that can open the safe.
• Example:
f (x, y, z) = x’.y + x.y.z → True minterms are: x’.y.z’, x’.y.z, x.y.z
f (x, y, z) = (x + y) . (y +z) → True maxterms are: x+y+z, x+y+z’, x’+y+z
0 0 0 0 0
Canonical Product-of-Sums Form 0 0 1 1 0
0 1 0 1 0
0 1 1 0 1
• For each false maxterm, form a sum term where a variable will appear in 1 1 0 0 1
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
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
• In switching algebra, the basic operations are NOT, AND and OR.
• Any switching expression can be realized using these three operators.
• We say that the set {NOT, AND, OR} is functionally complete or Universal.
• Example: Consider the switching function f = A’.B + B.C’.D
• There are only NOT, AND and OR operations.
• We can implement the circuit using NOT, AND and OR gates only.
• Other set of gates can also be shown to be functionally complete.
• Some examples will follow.
44
{NAND} is Functionally Complete
• It can be shown that NAND is a universal gate, i.e. it is functionally complete.
• How to prove that?
• We can show that we can realize NOT, AND and OR functions using NAND only.
• The NAND function is:
• NAND (A, B) = (A . B)’
• How to realize basic gates?
• NOT :: A’ = (A . A)’
• AND :: A.B = ((A.B)’)’ = ((A.B)’ . (A.B)’)’
• OR :: A + B = (A’ . B’)’ = ( (A . A)’ . (B . B)’ )’
45
{NOR} is Functionally Complete
• It can be shown that NOR is a universal gate, i.e. it is functionally complete.
• How to prove that?
• We can show that we can realize NOT, AND and OR functions using NOR only.
• The NOR function is:
• NOR (A, B) = (A + B)’
• How to realize basic gates?
• NOT :: A’ = (A + A)’
• AND :: A.B = (A’ + B’)’ = ((A + A)’ + (B + B)’)’
• OR :: A + B = ((A + B)’)’ = ( (A + B)’ + (A + B)’ )’
46
{AND, NOT} is Functionally Complete
• We have already shown that NAND is functionally complete.
• NAND can be realized as an AND followed by NOT.
• Hence {AND, NOT} is also functionally complete.
47
{OR, NOT} is Functionally Complete
• We have already shown that NOR is functionally complete.
• NOR can be realized as an OR followed by NOT.
• Hence {OR, NOT} is also functionally complete.
48
{AND, EXOR, 1} is Functionally Complete
• AND and EXOR gates are also functionally complete, but we also need the
constant value 1.
• Recall that EXOR (A, B) = A’.B + A.B’
• How to realize basic bates?
• NOT :: A’ = EXOR (A, 1) = A’.1 + A.0 = A’ + 0 = A’
• And we already know that {NOT, AND} is a functionally complete set.
49
{OR, EXOR, 1} is Functionally Complete
• OR and EXOR gates are also functionally complete, but we also need the
constant value 1.
• Recall that EXOR (A, B) = A’.B + A.B’
• How to realize basic bates?
• NOT :: A’ = EXOR (A, 1) = A’.1 + A.0 = A’ + 0 = A’
• And we already know that {NOT, OR} is a functionally complete set.
50
{2x1 MUX, 0, 1} is Functionally Complete
• A 2-to-1 multiplexer has two inputs A and B, a select input S, and one
output F.
• It realizes the function: F = MUX21 (A, B, S) = A.S’ + B.S
• If S = 0, we have F = A; and if S = 1, we have F = B.
• How to realize other gates?
• NOT :: A’ = MUX21 (1, 0, A) = 1.A’ + 0.A = A’ + 0 = A’
• AND :: A.B = MUX21 (A, 0, B’) = A.B + 0.B’ = A.B
• Since NOT and AND can be realized, it is functionally complete.
51
Two-level AND-OR is Equivalent to NAND-NAND
52
Two-level OR-AND is Equivalent to NOR-NOR
53
Realize AND-OR-NOT Circuits using NAND
• We have seen earlier how two-level AND-OR circuits can be transformed
to circuits using NAND gates only.
• By repeated use of De Morgan’s law and the basic laws of switching
algebra, we can transform any multilevel AND-OR-NOT circuit using
NAND gates only.
• Similar approach can be used for realizing circuits using NOR gates.
• Some examples.
54