Académique Documents
Professionnel Documents
Culture Documents
U.U.Samantha Rajapaksha
BSc. Eng. (Moratuwa), MSc in IT
Senior Lecturer
Sri Lanka Institute of Information Technology
New Kandy Road,
Malabe, Sri Lanka
Tel:0112-301904
email: samantha.r@sliit.lk
Web: www.sliit.lk
Logical Operations
The three basic logical operations are:
AND
OR
NOT
Operator Definitions
Operations are defined on
the values "0" and "1" for each
operator:
OR
NOT
AND
0
0
1
1
0
1
0
1
=
=
=
=
0
0
0
1
0+
=
0
0+
=
1
1+
=
1
1+
=1
0
1
0
1
0 1
1 0
Truth Tables
Truth table a tabular listing of the
values of a function for all possible
combinations of values on its arguments
Example: Truth tables for the basic logic
operations:
OR
NOT
AND
X Y Z = X+Y X
X YZ =
Z X
0 0
0
0
1
0 0XY
0
0 1
1
1
0
0 10
1 0
1
1 00
1 1
1
1 11
Boolean Algebra
The truth table for the Boolean
function:
Z 5 X Y
Z5 X1 Y
OR gate
AND gate
(AND) X Y
(OR)
X1 Y
(NOT)
Z5 X
Logic Gates
Another very useful gate is the exclusive OR (XOR) gate.
The output of the XOR operation is true only when the values
of the inputs differ.
Logic Gates
NAND and NOR
are two very
important gates.
Their symbols and
truth tables are
shown at the right.
F X Y Z
000
001
010
011
100
101
110
111
F X Y Z
Logic Diagram
X
Exercise
Show that A+BC =(A+B)(A+C)
is true using a truth table.
Boolean Algebra
1.
X + 0= X
2.
X . 1= X
3.
X + 1= 1
4.
5.
X + X= X
6.
X . X=X
7.
X + X= 1
8.
X . X =0
9.
X=X
0=0
10. X + Y=Y + X
11.
XY =YX
Commutative
Associative
Distributive
16. X + Y =X . Y
17. X . Y =X + Y
DeMorgan
s
Minterms
Minterms are AND terms with every
variable present in either true or
complemented form.
Given that each binary variable may appear
normal (e.g., x) or complemented (e.g.,
),
x
there are 2n minterms for n variables.
Example: Two variables (X and Y)produce
2 x 2 = 4 combinations:
(both normal)
normal, Y complemented)
XY (X
(X complemented, Y normal)
XY (both complemented)
XY
XY there are four minterms of two
Thus
variables.
Maxterms
Maxterms are OR terms with every
variable in true or complemented form.
Given that each binary variable may
appear normal (e.g., x) or
complemented (e.g., x), there are 2n
maxterms for n variables.
Example: Two variables (X and Y)
produce
= 4 combinations:
2X
x2Y
X Y (both normal)
(x normal, y complemented)
X Y (x complemented, y normal)
X Y (both complemented)
giving:
Mi mi
and
Thus Mi is the complement of mi.
x y x y
x y x y
M2 x y
m2 xy
mi Mi
Sum-of-Products (SOP)
AB ABC
ABC CDE B CD
A B A BC AC
Also:
A A B C BCD
In an SOP form, a
single overbar
cannot extend
over more than
one variable;
however, more
than one variable
in a termAcan
B C have
an overbar:
ABC
example:
is OK!
Implementation of an
SOP
X=AB+BCD+AC
AND/OR
implementation
NAND/NAND
implementation
A
B
A
B
B
C
D
B
C
D
A
C
A
C
A B CD ABC D
Exercise
Convert the following Boolean expression into standard
SOP form:
F ( A, B, C ) A B C
Binary Representation of a
Standard Product Term
A standard product term is equal to 1 for
only one combination of variable values.
Example: AB CD
is equal to 1 when A=1,
B=0, C=1, and D=0 as shown below
AB CD 1 0 1 0 1 1 1 1 1
And this term is 0 for all other combinations
of values for the variables.
Product-of-Sums (POS)
Also:
A ( A B C )( B C D )
In a POS form, a
single overbar
cannot extend
over more than
one variable;
however, more
than one variable
in a termA can
B C have
an overbar:
example:A B C
is OK!
Implementation of a POS
X=(A+B)(B+C+D)(A+C)
OR/AND implementation
A
B
B
C
D
A
C
Exercise
Convert the following Boolean expression into standard
POS form:
F ( X , Y , Z ) XY X Z
Binary Representation of a
Standard Sum Term
A standard sum term is equal to 0 for
only one combination of variable values.
Example:A B C D
is equal to 0 when A=0,
B=1, C=0, and D=1 as shown below
A B C D 0 1 0 1 0000 0
SOP/POS
How?
Step 1: Evaluate each product term in the SOP
expression. That is, determine the binary numbers that
represent the product terms.
Step 2: Determine all of the binary numbers not
included in the evaluation in Step 1.
Step 3: Write the equivalent sum term for each binary
number from Step 2 and express in POS form.
Exercises
y = 0y = 1
m0 = m1 =
x=0
xy
xy
x = 1m2 = mx3 y=
truth table.
Example Two variable function:
We choose a,b,c and d from the set {0,1}
toFunction
implement
K-Map F(x,y).
Tablea particular function,
Input Function
Values Value
(x,y)
F(x,y)
0
0
1
1
0
1
0
1
a
b
c
d
y = 0y = 1
x=0 a
b
d
x=1c
K-Map Function
Representation
Example: F(x,y) = x
y=1
F = xy = 0
x=0 0
x=1 1
x=0 m0
m1
m3
m2
x=1 m4
m5
m7
m6
x=0
xyz
xyz
xyz
xyz
x=1
xyz
xyz
xyz
xyz
y
y
z
labelings
x 00 01 are
11 10
x
00
14
Example Functions
By convention, we represent the minterms of
F by a "1" in the map and leave Fthe minterms
of
blank
y
Example:
F(x, y, z) m(2,3,4,5)
x 41
Example:
G(a, b, c) m(3,4,6,7)
0
y
3
1
7
1
2
6
Combining Squares
By combining squares, we reduce number
of literals in a product term, reducing the
literal cost, thereby reducing the other
two cost criteria
On a 3-variable K-Map:
One square represents a minterm with three
variables
Two adjacent squares represent a product
term with two variables
Four adjacent terms represent a product
term with one variable
Eight adjacent terms is the function of all
ones (no variables) = 1.
Example: Combining
Squares F m(2,3,6,7)
y
Example: Let
1
7
1
1
6
1
z
Applying the Minimization Theorem
three times:
Three-Variable Maps
Reduced literal product terms for SOP
standard forms correspond to
rectangles on K-maps containing cell
counts that are powers of 2.
Rectangles of 2 cells represent 2
adjacent minterms; of 4 cells represent
4 minterms that form a pairwise
adjacent ring.
Rectangles can contain non-adjacent
cells as illustrated by the pairwise
adjacent ring above.
Three-Variable Maps
Example Shapes of 2-cell Rectangles:
Three-Variable Maps
Example Shapes of 4-cell Rectangles:
z
Read off the product terms for the rectangles
shown
Example: Simplify
1 1 1
x
1 1
z
F(x, y, z)
z x y
Three-Variable Map
Simplification
Use a K-map to find an optimum SOP
equation for
F(X, Y, Z) m(0,1,2,4,6,7)
corresponding to:
A single 1 = 4 variables, (i.e. Minterm)
Two 1s = 3 variables,
Four 1s = 2 variables
Eight 1s = 1 variable,
Sixteen 1s = zero variables (i.e.
Constant "1")
Four-Variable Maps
Example Shapes of Rectangles:
12
13
15
14
11
10
Four-Variable Maps
Example Shapes of Rectangles:
12
13
15
14
11
10
Four-Variable Map
Simplification
F(W,X,Y, Z) m(0,2,4,5,6,7,
8,10,13,15
)
Four-Variable Map
Simplification
F(W,X,Y, Z) m(3,4,5,7,9,1
3,14,15
)
Exercise