逻辑代数基础 Chapter 1
逻辑代数基础 Chapter 1
Symbols 1: + 1: · 1: ’
3: -
2: 2: ^ 2: ~
3: absence of an operator
Examples 1: a + b 1: a · b 1: a’
2: a b 2: a ^ b 2: ~a
3: ab 3:
Logic Gate
Symbol
NAND
“ b
Operation NOR XOR XNOR
a b (ab)’ (a + b)’ a b
0 0 1 1 0 1
0 1 1 0 1 0
1 0 1 0 1 0
1 1 0 0 0 1
Logic Gate
Symbol
3
1.2 Boolean Algebra
4
Basic Postulates
If x,y S,
x +y =y +x
x. y = y. x commutative
If x,y,z S,
x + (y + z) = (x + y) + z
x . (y . z) = (x . y) . z
associative
If x,y,z S,
x . (y+ z) = (x . y) + (x . z)
x + (y . z) = (x + y) . (x + z)
distributive 5
Distributive Law
• Proof
x + y.z = (x + y) . (x + z)
6
Duality
• Principle of duality:
0. x= 1 +x = 1
0
0 +x =
1. x=
xx +x =
xx . x
x x + x’ =
=xx.
1
x’ = 0
The expressions are interchangeable by replacing “0” by “1” and “+”
by “ . ” .
7
Theore
m
Idempotent
x+x=x x. x=
Involution x
(x’ )’= x
Absorption
x + xy = x x (x+ y) =
x
Logical adjacency
xy + xy’ = x
DeMorgan (x + y) = x y xy = x
+ y
• The complement of sum is equal to the product of the
complement
• The complement of product is equal to the sum of the 8
complement
DeMorg
an X Y X + X Y
0 0 Y 1 1
0 1 0 0
1 0 0 0
1 1 0 0
X Y - -
X Y X Y+
0 0 1 1
0 1 1 1
1 0 1 1
1 1 0 0
Input(s) Output
x y z xy’ x’z’ xy’ + x’z’
0 0 0 0 1 1
0 0 1 0 0 0
0 1 0 0 1 1
0 1 1 0 0 0
1 0 0 1 0 1
1 0 1 1 0 1
1 1 0 0 0 0
1 1 1 0 0 0
1
2
Truth Table Boolean function
Inputs Output
a b c f
0 0 0 0 f is 1 if {(a = 0) AND (b = 0) AND (c = 1)}
OR
0 0 1 1
{(a = 1) AND (b = 0) AND (c = 0)} OR
0 1 0 0
0 1 1 0 {(a = 1) AND (b = 0) AND (c = 1)}
1 0 0 1
1 0 1 1 f(a,b,c) = a’b’c + ab’c’ + ab’c
1 1 0 0
Is it the simplest form?
1 1 1 0
1
3
1.4 Logic Function - SOP and POS
1
4
1.4.1 Minterm and Maxterm
Minterm :- For a function of n variables, if a product term contains
all n
variables exactly one time in its complemented or
uncomplemented form, the product term is called minterm.
Complement = 0 and
Uncomplement =1.
Function Minterm Not Not
minterm minterm
f( A, B, C) A’ B’ C (A B)’ C A’B’ or AABC
f (A, B, C) = m2 + m3 + m6 + m7
f (a, b, c) = a + bc
= a(b + b) + bc(a + a)
f (a, b, c) = Σ m(1,4,5,6,7)
1
9
Canonical POS representation:
f (x, y, z) = xy + xz
= (xy + x)(xy + z) = (x + x)(y + x)(x + z)(y + z)
f (x,y,z) = M 0 M 2 M 4 M 5 = ⅡM(0,2,4,5)
2
0
Conversion between canonical
forms
Relationship
How to obtain f4 ?
f4(a,b,c) = a’b + ab’ +bc 25
Example:
f(A,B,C,D) = AB + AC + ABC
DeMorgan
= (AB) (AC ) + ABC
= (A + B) (A + C)+ ABC
= A A + AC + AB + B C +
ABC
= A + AC + AB +
BC
= A + AB +
BC
= A+ B
C 26
Example:
f (A, B, C, D) = AB + BC + CD +BD
= AB + CD + B(C +D)
= AB + CD + BCD
Basic: a + ab = (a + a)(a + b) = a +
b
We can have the following general form:
a + a[…] = a + [ …]
• In
1953, Maurice Karnaugh introduced a map
method known as Karnaugh map (K-map)
> A straightforward procedure for minimizing Boolean
functions in a table form
> Graphical representation of a truth table
>Minterm is used in the cell of the K-map
> It isn-variable function (defined by 2 n ):
>Two-variable K-map has 4 cells
> Three-variable K-map has 8 cells
>Four-variable K-map has 16 cells
29
Two-variable K-map
a 0 1 a 0 1
b b
0 a'b ’ ab’ 0 m0 m2
1 a'b ab 1 m1 m3
Minterm representations 30
Plotting functions in K-map
32
Minterm representations
33
Simplification of Production Terms
Example: Simplify f(a,b,c) =Σm(6,7) Only one-
variable
difference
Form a cylinder!
35
More examples
36
Format of three-variable
37
Four-variable K-map
39
Image the map as 1-bit change only for
every adjacent cells!
….
40
Examples of 4-variable K-map
Across 4 Group of
corners: 8 cells:
f(a,b,c,d) = f(a,b,c,d) = 42
Are They Adjacent Cells?
• Goal
>Reduce the number of products (terms) to minimum
>Save the cost
45
Example: Two-variable K-map
(i) (ii)
3 groups 2 groups
f = a’b’ + a’b + ab f = a’b’ +
b
(i) 2 groups
f(a,b,c) = a’ + ab’
(ii) 2 groups
f(a,b,c) = a’ + b’
47
Example: Four-variable K-map
48
Two Solutions
49
Logic function in POS with K-map
50
Example: Find POS
Simplify f(a,b,c,d) =Σm(0,1,2,5,8,9,10) in
POS form
52
Truth Table with Don’t Care
0 0 0 f is 0 if (a = 0 AND b = 0)
f is 1 if (a = 0 AND b = 1), or
0 1 1 (a = 1 AND b = 0)
1 0 1
fcan be 0 or 1 if (a = 1 AND b = 1)
1 1 X
f 1 implementation
2 groups
f = a’b + ab’
f 2 implementation
2 groups
f=a +b
54
Procedure for K-map in don’t-care cases
f(a,b,c,d) = a’b’d +
cd
Is it a good solution? 55
Other solutions
56