Anda di halaman 1dari 49

Boolean Algebra

LEARNING OBJECTIVE
Understand about Boolean Algebra and its
functions
Understand and apply the Logic gates
Use the Karnaugh Maps for simplification of
sum-of-product expansions
TOPICS
Introduction
Boolean Expressions and Boolean Functions
Minterm and Maxterm
Logic Gates
Karnaugh Map
Invented by and named after George Boole.
Commonly, and especially in computer science and digital electronics,
this term is used to mean two-value logic.
Provide the operations and rules for working with the set {0,1}.
Map logical propositions to symbols.
Permit manipulation of logic statements using Mathematics.
A Boolean algebra B consists of a set S containing distinct
elements 0 and 1, binary operators + and . on S, and a unary
operator on S, we write B = (S, +, . , , 0, 1).

Note:
0 and 1 in the foregoing definition are merely symbolic names.
In general, they have nothing to do with the numbers 0 and 1.
+ and are merely binary operators. In general, they have nothing to do with
the ordinary addition and multiplication.
Introduction
Boolean algebra deals with

- set of 2 elements {0, 1}
- binary operators: OR ( / +), AND( / .)
- unary operator NOT { / }

Rules:


/ +
0 0 0
0 1 1
1 0 1
1 1 1
OR
/ .
0 0 0
0 1 0
1 0 0
1 1 1
AND
/
0 0
1 1
NOT
Boolean Algebra
BOOLEAN EXPRESSIONS AND BOOLEAN
FUNCTIONS
Boolean functions can be represented using
expressions made up from variables and Boolean
operations.

Example:

r p r q p r q p F ) , , (
z x yz x z y x F ) , , (
EXAMPLE
Example
F(x, y, z) = xy + z is a Boolean function where xy + z is a Boolean
expression.
The truth table for F(x, y, z) = xy + z is
x y z y xy xy+z
0 0 0 1 0 0
0 0 1 1 0 1
0 1 0 0 0 0
0 1 1 0 0 1
1 0 0 1 1 1
1 0 1 1 1 1
1 1 0 0 0 0
1 1 1 0 0 1
MINTERMS AND MAXTERMS
Any boolean expression may be expressed in terms of
either minterms or maxterms.
To do this we must first define the concept of a literal.
A literal is a single variable within a term which may or may
not be complemented. For an expression with N variables,
minterms and maxterms are defined as follows :
A minterm is the product of N distinct literals where each literal
occurs exactly once.
A maxterm is the sum of N distinct literals where each literal occurs
exactly once.

EXAMPLE
For a two-variable expression, the minterms
and maxterms are as follows
EXAMPLE
For a three-variable expression, the
minterms and maxterms are as follows
DISJUNCTIVE NORMAL FORM (DNF)
Also known as sum-of-products expansion.
The Sum of Products form represents an
expression as a sum of minterms.
Sum of minterms corresponding to input
combinations for which the function produces
a 1 as output.

EXAMPLE
To derive the Sum of Products form from a
truth table, OR together all of the minterms
which give a value of 1.
Consider the truth table;
F(X,Y) = X.Y + X.Y
CONJUNCTIVE NORMAL FORM (CNF)
Also known as product-of-sums expansion.
The Product of Sums form represents an expression
as a product of maxterms.
Product of maxterms corresponding to input
combinations for which the function produces a 0 as
output.
Any Boolean Expression has a DNF and a CNF.
Given a Boolean function, we can obtain the DNF and
CNF either by Truth table or Boolean identity laws.
CONJUNCTIVE NORMAL FORM (CNF)
To derive the Product of Sums form from a truth table,
AND together all of the maxterms which give a value of 0.
Consider the truth table;

F(X,Y) = X + Y
TRUTH TABLES (AGAIN)
Recall that a boolean equation can be represented by a Truth
Table
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
A truth table for a boolean
function of N variables has 2
N

entries.
The 1s represent F(A,B,C).
The 0s represent F(A,B,C)
TRUTH TABLE TO SOP FORM
Can write SOP form of equation directly from truth table.
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
ABC
ABC
ABC
ABC
ABC
F(A,B,C) = ABC + ABC + ABC
+ ABC + ABC
Note that each term in has
ALL variables present. If a
product term has ALL
variables present, it is a
MINTERM.
TRUTH TABLE TO POS FORM
To get POS form of F, write SOP form of F, then use
DeMorgans Law.
A B C F
0 0 0 0
0 0 1 0
0 1 0 0
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
ABC
ABC
ABC
F(A,B,C) = ABC + ABC + ABC
Take complement of both sides:

(F(A,B,C)) = (ABC + ABC + ABC)
Apply DeMorgans Law to right side.
Left side is (F) = F.

F(A,B,C) = (ABC) (ABC) (ABC)
apply DeMorgans Law to each term

F(A,B,C) = (A+B+C) (A+B+C)(A+B+C)
POS Form!!
MINTERMS, MAXTERMS
We saw that:
F(A,B,C) = (A+B+C) (A+B+C)(A+B+C)
F(A,B,C) = ABC + ABC + ABC + ABC + ABC + ABC
SOP form. If a product term has all variables present, it is a
MINTERM.
POS form. If a sum term has all variables present, it is a
MAXTERM.
All Boolean functions can be written in terms of either Minterms
or Maxterms.
QUESTIONS
Give the expression represented by the following truth
table in both Sum of Products and Product of Sums
forms.
The basic element in a digital electronic system
Performs a logical operation on one or more logic inputs and
produces a single logic output
Because the output is also a logic-level value, an output of
one logic gate can connect to the input of one or more other
logic gates.
The logic normally performed is Boolean logic and is most
commonly found in digital circuits.
Logic gates are primarily implemented electronically using
diodes or transistors,
Logic Gates
BASIC TYPES OF GATES
OR
AND
NOT
NOR
NAND
XOR
LOGIC GATES
Not Gate
Input
x
Output
x
Two inputs AND Gate
Output
xy
x
0 1
1 0
x
x y
0 0 0
0 1 0
1 0 0
1 1 1
xy
LOGIC GATES
Output
x + y
x y x + y
0 0 0
0 1 1
1 0 1
1 1 1
Two Inputs OR Gate
LOGIC GATES
NOR gate
NAND gate
LOGIC GATES
) ( B A
INPUT XOR
A B X=
0 0 0
0 1 1
1 0 1
1 1 0
XOR Gate
Output = ) ( B A
Input
A
B
B) (A
COMBINATION OF GATES
QUESTION
Construct circuits that produce the following outputs:

QUESTION
Find the output of the given circuit
shown below and write the logic table:
x
y
x
z
x y z
0 0 0
0 0 1
0 1 0
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
29
(xy)+(xz)
Karnaugh Maps (K-Maps) are a graphical method
of visualizing the 0s and 1s of a boolean function
K-Maps are very useful for performing Boolean
minimization.
Will work on 2, 3, and 4 variable K-Maps in this
class.
Karnaugh maps can be easier to use than boolean
equation minimization once you get used to it.

Karnaugh Map
A K-map has a square for each 1 or 0 of a
boolean function.

Two variable K-map has 2
2
=4 squares
Three variable K-map has 2
3
= 8 squares
Four variable K-map has 2
4
= 16 squares
2 variable
3 variable 4 variable
MINIMIZATION OF CIRCUITS
In order to use a Karnaugh map, it is best if the
Boolean expression is in Disjunctive Normal Form
(DNF).

1. This means that every variable should be represented in
every term (for a variable X, either X or ~X should be in every
term)
Ex: ABC v ~ABC v ~A~B~C is in DNF, but AC v ~ABC v
~A~B~C is not [no B in the first term]

2. The variables within a term are ANDed together, and the
terms are ORed together.
Ex: (AvBvC)(~AvBvC)(~Av~Bv~C)
[variables ORed and terms ANDed instead of vice-versa]

3. There should be no parentheses
Ex: ABC v ~A(BCv~B~C) [use of parenthesis] are not in DNF.

PLOTTING FUNCTIONS ON K-MAPS
Two-variable map
Ex: AB v AB v AB
PLOTTING FUNCTIONS ON K-MAPS
Two-variable map
Ex: AB v AB v AB
A A
B
B
1
1 1
0
PLOTTING FUNCTIONS ON K-MAPS
Two-variable map
Ex: ~A~B v ~AB v AB
A A
B
B
1
1 1
0
On a two-variable map, look
for a pair of 1's that are
either in the same row or
column. If we find such a
pair, we record the common
variable.
= B + A
PLOTTING FUNCTIONS ON K-MAPS
Three-variable map
Ex:
XY
XY
XY XY
Z
Z
XYZ v XYZ v XYZ v XYZ v XYZ v XYZ
PLOTTING FUNCTIONS ON K-MAPS
Three-variable map
Ex:
XY XY XY XY
Z
Z
1
XYZ v XYZ v XYZ v XYZ v XYZ v XYZ
1
1
1 1
1
TRICKS TO REMEMBER!!!
On a three-variable map we begin by looking for groups of
four 1's.
The four squares must form a rectangle (i.e. four in a row or
a 2x2 square) - 'L' shapes and zigzags aren't a valid group
of 4.
TRICKS TO REMEMBER!!!
A group of four will have one common variable. A pair
must have two common variables.
In the examples below, the common variable for the left map
is ~C and the common variable for the right group is B.
TRICKS TO REMEMBER!!!
In the examples below, the left pair has the common
variables BC, while the right pair has the common variables
A~B.
Note that the common variables within a group of 1's are
ANDed. A solo 1 must have all 3 variables.
TRICKS TO REMEMBER!!!
The map "wraps around" from the left edge to the right, like
the center of a paper towel roll.
The common variables for the pair on the left are ~B~C,
while the group of four on the right has the common variable
~B.
PLOTTING FUNCTIONS ON K-MAPS
Three-variable map
Ex:
XY XY XY XY
Z
Z
1
XYZ v XYZ v XYZ v XYZ v XYZ v XYZ
1
1
1 1
1
= Y + XZ + XZ
PLOTTING FUNCTIONS ON K-MAPS
Four-variable map
Ex: abcd v abcd v abcd v abcd v abdc
v abdc v abdc v abcd v abcd v
abcd v abdc
PLOTTING FUNCTIONS ON K-MAPS
Four-variable map
Ex: abcd v abcd v abcd v abcd v abdc v
abdc v abdc v abcd v abcd v abdc
AB AB AB AB
CD
CD
CD
CD 1
1
1
1
1
1
1 1
1
1
TRICKS TO REMEMBER!!!
On a four-variable map, begin by looking for groups of
eight 1's. The eight squares must form a rectangle -
odd shapes aren't a valid group of eight.
Next look for groups of four, then pairs, then solos.
A group of eight will have one common variable, a
group of four will have two common variables, a pair
will have three common variables, and a solo will have
all four variables.
TRICKS TO REMEMBER!!!
The map "wraps around" from the left edge to the right,
AND from top to bottom, kind of like a map of the
world. This means groups can overlap the left and
right, or top and bottom edges.
The four corners form a "double wraparound" group of
four, with the common variables ~B~D:
PLOTTING FUNCTIONS ON K-MAPS
Four-variable map
Ex: abcd v abcd v abcd v abcd v abdc v
abdc v abdc v abcd v abcd v abdc
AB AB AB AB
CD
CD
CD
CD 1
1
1
1
1
1
1 1
1
1
= AD + C
QUESTIONS
Write the minimize expression for

cda v cda v dac v cda v adc v adc

QUESTIONS
Construct a circuit to produce the following
output:

( ) ( ' ) ' ab c b d

Anda mungkin juga menyukai