Lecture3 Updated
Lecture3 Updated
SECTION 1:
LOGICAL GATES
Logic Gates
The building blocks of any digital circuit
Have one input or more, with only one
output
Output is active for certain input
combinations
Truth table: list out the output for each
possible input combination
Boolean function: function of one or more
variables
3
Inversion bubble
F=X or
X
logic equation/function
Output
F
1
0
X
F
Binary number
1s complement
AND Gate
X
Y
F= X .Y or F = XY.
Inputs
Output
X Y
0
0
1
1
0
0
0
1
0
1
0
1
Example waveforms:
X
Y
F
OR Gate
X
Y
Inputs
Example waveforms:
Output
0
0
1
1
0
1
0
1
0
1
1
1
F=X+Y
X
Y
NAND Gate
X
Y
Inputs
Output
0
0
1
1
0
1
0
1
1
1
1
0
F = (X .Y)
(or F = X+Y)
Example waveforms:
X
Y
F
X
Y
Inputs
Output
0
0
1
1
0
1
0
1
1
0
0
0
F X Y or F X Y X Y
Example waveforms:
X
Y
F
X
Y
Inputs
Output
0
0
1
1
0
1
0
1
0
1
1
0
F XY XY or F X Y
or F X Y XY
Example waveforms:
X
Y
F
Notice that the XOR gate will produce a HIGH only when exactly one
input is HIGH.
9
Inputs
Output
0
0
1
1
0
1
0
1
1
0
0
1
F A B AB
or F = X
or F X 'Y ' XY
Example waveforms:
X
Y
F
The XNOR gate will produce a HIGH when both inputs are the same.
This makes it useful for comparison functions.
10
Exercise
Given two inputs A = 11010112 and B =
00110012, compute
XOR(A, B)
NAND(A,B)
OR(A,B)
11
SECTION 2:
BOOLEAN ALGEBRA AND
MINIMIZATION
12
Boolean Expression
A large number of logical gates are used to implement
the Boolean expression.
Boolean Expression
14
Boolean Addition
Addition is equivalent to the OR operation.
15
Boolean Multiplication
In Boolean algebra, multiplication is equivalent to the
AND operation.
Commutative Laws
The commutative laws are applied to addition and
multiplication. (i.e., we can swap the literals and still get
the same answer/output)
A+B=B+A
AB = BA
Associative Laws
A(BC) = (AB)C
17
Distributive Law
The distributive law is the factoring law. A common
variable can be factored from an expression just as in
ordinary algebra. (Inverse: A can be distributed to B+C)
AB + AC = A(B+ C)
The distributive law can be illustrated with equivalent
A
circuits:
AB
B
C
B+ C
X
X
A(B+ C)
A
C
AC
AB + AC
18
3. A . 0 = 0
7. A . A = A
8. A . A = 0
=
9. A = A
4. A . 1 = A
10. A + AB = A
5. A + A = A
11. A + AB = A + B
6. A + A = 1
12. (A + B)(A + C) = A + BC
1. A + 0 = A
2. A + 1 = 1
19
(A + B)(A + C) = A + BC
(A + B)(A + C) = AA + AC + AB + BC
= A + AC + AB + BC
= A(1 + C + B) + BC
= A . 1 + BC
= A + BC
Example: Prove the rule:
A+ AB
A + AB = A + B
= (A+A)(A+B)
= 1 (A+B)
= A+B
20
DeMorgans Theorem
DeMorgans 1st Theorem
The complement of a product of variables is
equal to the sum of the complemented variables.
AB = A + B
Applying DeMorgans first theorem to gates:
A
AB
B
NAND
Inputs
A+B
B
Negative-OR
A
0
0
1
1
B
0
1
0
1
Output
AB A + B
1
1
1
1
1
1
0
0
21
DeMorgans Theorem
DeMorgans 2nd Theorem
The complement of a sum of variables is equal to
the product of the complemented variables.
A+B=A.B
Applying DeMorgans second theorem to gates:
A
A+B
B
NOR
A
B
Negative-AND
Inputs
AB
A
0
0
1
1
B
0
1
0
1
Output
A + B AB
1
1
0
0
0
0
0
0
22
(A1A2 An) = A1 + A2 + + An
23
Example
(a) Find the complement of (A+B)C
[(A+B)C] = (A+B) + C
= AB + C = AB + C
(b)
Note:
Q2
A BC D( E F )
25
(A + B )
C (A + B )
X = C (A + B )+ D
X = C (A B) + D = A B C + D
26
Duality
Principle of duality: If an expression is valid in Boolean algebra,
the dual of the expression is also valid.
The dual of an expression is found by replacing
- all (+) operators with (),
- all () operators with (+),
- all ones with zeroes,
- all zeros with ones.
Note: Do not alter the location of parentheses when obtaining a
dual. Variables and complements are left unchanged.
Example:
Find the dual of the expression a + (bc) = (a + b)(a + c).
Dual of the above expression is
27
Consensus Theorem
Given a pair of sum-of-product term (product-of-sum term) for
which a variable appears in one term and its complement in
the other, then the consensus term is formed by ANDing
(ORing) the original terms together, leaving out the selected
variable and its complements.
Example
redundant
The consensus of abc and ad is bcd.
The consensus of abd and abcd does not exist.
Why? abd+abcd+ bbcd= abd+abcd
The consensus of abc and bcd does not exist.
28
ab + ac + bc
= ab + ac + bc(a+a)
= ab + ac + abc + abc
= ab (1 + c) + ac (1 + b)
= ab + ac
29
ab + ac + bc = ab + ac
Duality:
(a+b)(a+c)(b+c) = (a+b)(ac)
30
= ac (b + b) + abc + abc
= ac + abc +abc
= a(c+bc) + abc
= a ((c+b)(c+c)) + abc
= ac + ab + abc
= c(a+ab) + ab
= c ((a+a)(a+b)) + ab
= ac + bc + ab
= bc + ab
b + b =1
X+YZ=(X+Y)(X+Z)
Consensus term
31
32
Example
f = (a+b+c)(b+c+d)
33
Exercise:
- Simplify F = xyz + xyz + xyz + xyz
- Simplify F = xy + xz + yz + xz
34
Exercise:
F = xyz + xyz + xyz + xyz
= xy(z + z) + xz(y + y)
= xy + xz
F = xy + xz + yz + xz
= xy + xz + xz
= xy + x(z+z)
= xy + x
= (x + x)(x + y)
= (x + y)
35
Exercise:
- Simplify (A+B)(B+C)(A+D+C)(D+B+A)(B+C+D)(C+A)
36
Answer
DUALITY:
AB + BC + ACD + ABD + BCD + AC
= AB + BC + ACD + ABD + BCD + AC
= AB (1+D) + BC + AC (1+D)
= AB + BC + AC
= AB + AC
Then,
(A+B)(B+C)(A+D+C)(D+B+A)(B+C+D)(C+A) =
(A+B)(A+C)
37
Answer
A
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
B
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
C
0
0
1
1
0
0
1
1
0
0
1
1
0
0
1
1
D
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
(A'+B)
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
(B+C)
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
(A+D+C)
FALSE
TRUE
TRUE
TRUE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
(D+B+A')
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
TRUE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
(B+C+D)
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
(A+B)(B+C)(A+D+C)(D+B+A)(B+C+D)(C+A) = (A+B)(A+C)
(C+A)
LHS
RHS
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
FALSE
FALSE
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
FALSE
FALSE
TRUE
FALSE
FALSE
TRUE
FALSE
FALSE
TRUE
FALSE
FALSE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
TRUE
38
SOP form
An expression is said to be in sum of products
form if all products are products of only single
variables. Functions in SOP form are formed by
summing (ORing) product (ANDed) terms.
Examples:
AB + CDE + ACE
A + B + CD + EFG
Attention: (A+B)CD +E +FGH
(SOP form)
40
41
POS form
An expression is said to be in a product of sums form if
all sums are sums of single variables. Functions in POS
form are formed by taking product (ANDing) of sum (ORed)
terms.
Examples:
(A+B)(C+D+E)(A+C+F)
(A+B)(C+D+E)F
Attention: (A+B)(C+DE) POS form.
42
AB+CD
AB + CD = (AB+C)(AB+D)
= (A+C)(B+C)(A+D)(B+D)
(b) X + YZ = (X+Y)(X+Z)
(c) (X + Y)(X+Z) = XZ + XY
43
Example:
Convert AC+ABD+ABE+ACDE to product of sums form.
XZ+XY = (X+Y)(X +Z)
AC+ABD+ABE+ACDE
= AC+A (BD+BE+CDE)
= [A + (BD+BE+CDE)][A+C]
X + YZ = (X+Y)(X+Z)
= [ (A+CDE) +B(D+E)] (A+C)
= (A+CDE+B) (A+CDE+D+E) (A+C)
E(1+ C D)=E
= (A+CDE+B) (A+D+E) (A+C)
= (A+C+B) (A+D+B) (A+E+B) (A+D+E) (A+C)
X + YZ = (X+Y)(X+Z)
X + YZ = (X+Y)(X+Z)
44
45
46
(canonical SOP)
49
Minterm
Every term in a canonical SOP expression is called
a minterm.
minterm
Maxterm
Every term in a canonical POS expression is called a maxterm.
A maxterm is a sum term.
Eg: X = (A+B+C) (A+B+C)( A+B+C)
maxterm
maxterm
maxterm
51
ABC
Minterm
Minterm
numbers
0
1
2
3
4
5
6
7
000
001
010
011
100
101
110
111
ABC
ABC
ABC
ABC
ABC
ABC
ABC
ABC
m0
m1
m2
m3
m4
m5
m6
m7
C=0
A=1
52
f1(A, B, C) = m(2, 3, 6)
f2(B, C, A) = m(2, 3, 6)
53
Inputs
ABC
Outputs
f1(A, B, C)
000
Complemented
Outputs
f1(A, B, C)
1
1
2
3
4
5
6
7
001
010
011
100
101
110
111
0
1
1
0
0
1
0
1
0
0
1
1
0
1
f1(A, B, C) = m(2, 3, 6)
f1(A, B, C) = m(0, 1, 4, 5, 7)
A minterm
54
ABC
Maxterm
Maxterm
numbers
0
1
2
3
4
5
6
7
000
001
010
011
100
101
110
111
A+B+C
A+B+C
A+B+C
A+B+C
A+B+C
A+B+C
A+B+C
A+B+C
M0
M1
M2
M3
M4
M5
M6
M7
A=1
C=0
55
56
Inputs
ABC
Outputs
fx(A, B, C)
Complemented
Output
fx(A, B, C)
000
001
010
011
100
101
110
111
fx(A, B, C) = M(4, 1, 0)
fx(A, B, C) = M(2, 3, 5, 6, 7)
A maxterm
57
58
Example: If
f(a, b, c) = m(2, 4, 6) = M(0,1,3,5,7) then
f (a, b, c) = m(0,1,3,5,7) = M(2, 4, 6)
Notes:
If mi is not present in a minterm expansion of f,
then Mi is present in the maxterm expansion.
Similarly, it applicable on f.
59
Example
Determine the canonical SOP and POS expressions from the
following truth table.
Inputs
ABC
Output
f(A, B, C)
000
001
010
011
100
101
110
111
f(A, B, C)
= m(3, 4, 6, 7)
= A'BC+AB'C'+ABC'+ABC
= (A+B+C)(A+B+C')(A+B'+C)(A'+B+C')
60
ABC
SOP (Minterm)
POS (Maxterm)
000
ABC = m0
A + B + C = M0
001
ABC = m1
A + B + C = M1
010
ABC = m2
A + B + C = M2
011
ABC = m3
A + B + C = M3
100
ABC = m4
A + B + C = M4
101
ABC = m5
A + B + C = M5
110
ABC = m6
A + B + C = M6
111
ABC = m7
A + B + C = M7
Minterm Expansion
Maxterm Expansion
61
62
Example
Convert the following function to canonical SOP form:
f(A,B,C) = AB + AC' + A'C
f(A,B,C)
= AB + AC' + A'C
= AB(C + C') + AC'(B + B') + A'C(B + B')
= ABC + ABC' + AB'C' + A'BC + A'B'C
= m7 + m6 + m4 + m3 + m1
= m(1, 3, 4, 6, 7)
63
Example
Convert the following function to canonical POS form:
f(A, B, C) = A(A + C')
A= A+BB'
64
= ab' + ac + bc'
[write as SOP]
65
1 1
Assign 0 to both X:
F = A'B'C' + A'BC + ABC
= A'B'C' + BC
Minterm expansion:
F = m(0,3,7) + d(1,6) Assign 1 to both X:
F = A'B' + BC +AB
Maxterm expansion:
F = M(2,4,5) D(1,6)
minterm form
maxterm form
0
0
0
0
0
1
1
0
0
0
1
1
1
0
0
1
0
0
1
X
1
1
1
0
1
1
1
0
1
X
0
1
69
Exercise
Express (A+B)(A+C) using canonical POS
and canonical SOP forms. Notice that
there exists 4 variables, A, B, C and D.
Given f(a,b,c) = ab + ac + bc
Write f as a minterm expansion and maxterm
expansion
Write f as a minterm expansion and maxterm
expansion
70
Exercise
(A+B)(A+C)
= (A+B+CC+DD)(A+BB+C+DD)
= (A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D)
(A+B+C+D) (A+B+C+D) (A+B+C+D) (A+B+C+D)
(A+B)(A+C)
= AC + AB + BC
= AC(D+D)(B+B) + AB(C+C)(D+D)
= ABCD + ABCD + ABCD + ABCD +
ABCD + ABCD + ABCD + ABCD
71
Exercise
f(a,b,c)
= ab + ac + bc
= ab + ac
= abc + abc + abc + abc
= m 3 + m2 + m 6 + m4
= m(2,3,4,6) = M(0,1, 5, 7)
f(a,b,c)
= m(0,1, 5, 7) = (2,3,4,6)
72
Exercise
A
Exercise
f(A,B,C)
= ABC + ABC + ABC + d(ABC + ABC)
= ABC + ABC + ABC + BC + d(ABC + ABC)
= ABC + BC + d(ABC + ABC)
Assign 1 to ABC and 0 to ABC
f(A,B,C)
= ABC + BC + ABC
= BC + BC(A + A)
= BC + BC
= C(B+B) = C
74