8/11/2019 Boolean Algebra (4)
1/54
RAM PRAVESH [email protected]
NIT DELHI
Faculty Of Electronics andCommunication Technology
Boolean Algebra
8/11/2019 Boolean Algebra (4)
2/54
2
Boolean Functions
Boolean algebraprovides the operations and
the rules for working with the set {0, 1}.
Electronic and optical switches can be
studied using this set and the rules ofBoolean algebra.
We are going to focus on three operations:
Boolean complementation,
Boolean sum, and
Boolean product
8/11/2019 Boolean Algebra (4)
3/54
3
Boolean Functions and Logic Gates
The complementisdenoted by a bar.It is defined by
0=1 1=0
The Boolean sum,denoted by +or by OR
(inclusive OR), has thefollowing values:1+1=1 1+0=10+1=1 0+0=0
Not GateInverter
OR Gate
8/11/2019 Boolean Algebra (4)
4/54
4
The Boolean product,
denoted by
or byAND, has thefollowing values:1
1=1 1
0=0
0
1=0 0
0=0
XOR (exclusive OR)1
1=0 1
0=10
1=1 0
0=0xy =xy+xy
Boolean Functions and Logic Gates
AND Gate
XOR Gate
8/11/2019 Boolean Algebra (4)
5/54
5
NANDand NORare two very important gates.
Their symbols and truth tables are shown below
Boolean Functions and Logic Gates
NOR
NAND
x
y = x y
x y= x + y
NAND
NOR
8/11/2019 Boolean Algebra (4)
6/54
6
Boolean Functions
8/11/2019 Boolean Algebra (4)
7/54
7
Boolean Functions
The complement, Boolean sum, and Booleanproductcorrespond the Logical operators
,,andrespectively, where
0 corresponds to F , and 1 corresponds to T.
1
0+ (0+1)=0
Its logical equivalent is
(T
F)
(F
T) F
8/11/2019 Boolean Algebra (4)
8/54
8
Boolean Expressions andBoolean Functions
Definition:Let B = {0, 1}. The variable xis calleda Boolean variableif it assumes values only fromB.
A functionfromBn, the set {(x1, x2, , xn) |xiB,
1 i n}, toB is called a Boolean functionofdegree n.
Boolean functionscan be represented using
expressions made up from the variables andBoolean operations.
8/11/2019 Boolean Algebra (4)
9/54
9
Boolean Expressions and Boolean Functions
Example: the function F(x,y)=xy from the setof ordered pairs of Boolean variable to theset {0, 1} is a Boolean function of degree 2with F(1,1)=0, F(1,0)=1, F(0,1)=0, and
F(0,0)=0.
this functionFrom B2To B
x y F(x,y)
0 0 0
0 1 0
1 0 1
1 1 0
8/11/2019 Boolean Algebra (4)
10/54
10
Boolean Expressions and Boolean Functions
The Boolean expressionsin the variablesx1, x2, , xnare defined recursively as:
0,1,x1,x2,,xnare Boolean expressions.If E1and E2are Boolean expressions, thenE1, E1E2, and E1+E2are Boolean expressions.
Each Boolean expressionrepresents a Boolean
function. The values of this function areobtained by substituting 0 and 1 for thevariables in the expression.
8/11/2019 Boolean Algebra (4)
11/54
11
Boolean Expressions and Boolean Functions
Example: Find the value of the Boolean functionF(x,y,z)=xy+z (this function From B3To B)
Definition: The Boolean functions Fand Gof nvariablesare equalif and only if
F(b1, b2, , bn) = G(b1, b2, , bn)
whenever b1, b2, , bnbelong to B.
Two different Boolean expressions that represent thesame function are called equivalent.
For example, the Boolean expressions xy, xy+0,and xy1 are equivalent
8/11/2019 Boolean Algebra (4)
12/54
12
Example: Find the value of the Boolean functionF(x,y,z)=xy+z (this function From B3To B)
A Boolean functionof degree ncan be represented by an
n-cube(hypercube) with the corresponding function valueat each vertex.
Boolean Expressions and Boolean Functions
001
111110
011
100
010
000
101
8/11/2019 Boolean Algebra (4)
13/54
13
Boolean Expressions and Boolean Functions
The complementof the Boolean function F is the
function F
where F(b1, b2, , bn) = F(b1, b2, , bn)
Let Fand Gbe Boolean functionsof degree n.The Boolean sumF+Gis defined by
(F+G)(b1,b2,,bn) = F(b1,b2, ,bn)+G(b1,b2,,bn)
and Boolean productFGis defined by
(FG)(b1,b2, ,bn) = F(b1,b2, ,bn) G(b1,b2, ,bn)
8/11/2019 Boolean Algebra (4)
14/54
14
Boolean Expressions and Boolean Functions
Question: How many different Boolean functionsof degreenare there?
Solution:
There are 2ndifferent n-tuples of 0s and 1s.
A Boolean function is an assignment of 0 or 1 toeach of these 2ndifferent n-tuples.
Therefore, there are 22ndifferent Boolean
functions.
8/11/2019 Boolean Algebra (4)
15/54
15
Boolean Expressions and Boolean Functions
Question: How many different Boolean functions
of degree4are there? 16
8/11/2019 Boolean Algebra (4)
16/54
16
Boolean Expressions and Boolean Functions
Question: How many different Boolean functionsof degree 1are there?
Solution: There are four of them, F1,F2,F3, andF4
x F1 F2 F3 F4
0 0 0 1 1
1 0 1 0 1
8/11/2019 Boolean Algebra (4)
17/54
17
Identities of Boolean algebra
8/11/2019 Boolean Algebra (4)
18/54
18
Identities of Boolean algebra
8/11/2019 Boolean Algebra (4)
19/54
19
Identities of Boolean algebra
8/11/2019 Boolean Algebra (4)
20/54
20
Identities of Boolean algebra
8/11/2019 Boolean Algebra (4)
21/54
21
Identities of Boolean algebra(Duality)
There are useful identities of Boolean expressions that
can help us to transforman expressionAinto anequivalentexpressionB(see previous table)
We can derive additional identities with the help of thedualof a Boolean expression.
Duality principle
The Boolean equation remains valid if we take the dualof the expression on both sides of the equals sign.
The dualof a Boolean expressionis obtained byinterchangingBoolean sumsand Boolean productsandinterchanging0sand 1s.
8/11/2019 Boolean Algebra (4)
22/54
22
Identities of Boolean algebra(Duality)
Examples:
The dual of x(y + z)is x + yz
The dual of x1 + (y + z) is (x + 0) ( y . z).
The dual of a Boolean function Frepresented by aBoolean expression is the function represented bythe dual of this expression.
This dual function, denoted by Fd, does not dependon the particular Boolean expression used torepresent F.
8/11/2019 Boolean Algebra (4)
23/54
23
Identities of Boolean algebra(Duality)
Therefore, an identity between functions
represented by Boolean expressions remains validwhen the duals of both sides of the identity aretaken.
We can use this fact, called the duality principle,to derive new identities.
For example, consider the absorption lawx(x + y) = x.
By taking the duals of both sides of this identity,we obtain the equation x + xy = x, which is also anidentity (and also called an absorption law).
8/11/2019 Boolean Algebra (4)
24/54
24
Definition of a Boolean Algebra
All the properties of Boolean functions and
expressions that we have discovered also apply toother mathematical structuressuch aspropositionsand setsand the operations defined onthem.
If we can show that a particular structure is aBoolean algebra, then we know that all resultsestablished about Boolean algebras apply to this
structure.For this purpose, we need anabstract definitionofa Boolean algebra.
8/11/2019 Boolean Algebra (4)
25/54
25
Definition of a Boolean Algebra
Definition:A Boolean algebra is a set B with two
binary operationsand , elements0and 1, and aunary operation such that the followingproperties hold for all x, y, and z in B:
x 0 = x and x 1 = x (identity laws)
x (x) = 1 and x (x) = 0 (Complement laws)
(x y) z = x (y z) and(x y) z = x (y z) and (associative laws)
x y = y x and x y = y x (commutative laws)
x (y z) = (x y) (x z) andx (y z) = (x y) (x z) (distributive laws)
8/11/2019 Boolean Algebra (4)
26/54
8/11/2019 Boolean Algebra (4)
27/54
27
Representing Boolean Functions
Two important problems of Boolean algebra will
be studied in the next slides:
Given the value of a Boolean function, how can
a Boolean expression that represents thisfunction be found?
Is there a smaller set of operators that canbe used to represent all Boolean functions?
8/11/2019 Boolean Algebra (4)
28/54
28
Representing Boolean Functions
Any Boolean functioncan be represented as a :
Sum of products (SOP)of variables and theircomplements. Disjunctive normal form (DNF)
Sum-of-products Expansions
Or
Product of sums (POS)of variables and their
complements. Conjunctive normal form (CNF)Product-of-sums Expansions
8/11/2019 Boolean Algebra (4)
29/54
8/11/2019 Boolean Algebra (4)
30/54
30
Representing Boolean Functions
Minterms andmaxterms
The table below illustrates the minterms andmaxterms forthree inputBoolean variables
8/11/2019 Boolean Algebra (4)
31/54
31
Representing Boolean Functions
FindBoolean expressions that represent thefunction F(A,B,C) which is given in the followingtable.
8/11/2019 Boolean Algebra (4)
32/54
32
Representing Boolean Functions
Sum-of-products Expansions (DNF)
Product -of- sums Expansions (CNF)
8/11/2019 Boolean Algebra (4)
33/54
33
Representing Boolean Functions
8/11/2019 Boolean Algebra (4)
34/54
34
Representing Boolean Functions
8/11/2019 Boolean Algebra (4)
35/54
35
Representing Boolean Functions
8/11/2019 Boolean Algebra (4)
36/54
36
Representing Boolean Functions
For example
8/11/2019 Boolean Algebra (4)
37/54
37
Representing Boolean Functions
Example Find a minterm that equal 1 ifx1= x3=0
andx2= x4=x5=1 and equals 0 otherwise.The minterm is x1x2x3 x4 x5
Example Find the sum-of-products expansion forthe function F(x,y,z)=(x+y)z (truth table)F(x,y,z)=(x+y)z
=xz+yz Distributive law
=x1z+1yz Identity law=x(y+y)z+(x+x)yz Unity law=xy z+xyz+xyz+xyz Distributive law=xy z+xyz+xyz Idempotent law
8/11/2019 Boolean Algebra (4)
38/54
38
Representing Boolean Functions
Is there a smaller set of operators that can be used
to represent all Boolean functions?Every Boolean function can be represented using theBoolean operators +, . , and . So, we say that theset{+, ., } is functionally complete.
We can eliminate all the +using this entityThen set{ ., } is functionally complete.
We can eliminate all the .using this entityThen set{ +, } is functionally complete.
8/11/2019 Boolean Algebra (4)
39/54
39
Representing Boolean Functions
Is there a smaller set of operators that can be used
to represent all Boolean functions?Both of the sets { } and {} arefunctionally complete.
x+y using NAND how?xy using NOR
x
y = x y
x y= x + y
NAND
NOR
x = x
x
xy = (x
y)
(x
y)
x = x x
x+y = (x y) (x y)
8/11/2019 Boolean Algebra (4)
40/54
8/11/2019 Boolean Algebra (4)
41/54
41
Combinations of Gates
Logic gates can have one or more inputs
Constructthe circuitthat producesthe following output:
f
8/11/2019 Boolean Algebra (4)
42/54
42
Combinations of Gates
Constructthe circuitthat producesthe following output:
b f G
8/11/2019 Boolean Algebra (4)
43/54
43
Combinations of Gates
A committee of three individuals decides issues for
an organization. Each individualvotes either yesor nofor each proposal that arises. A proposal is passedifitreceives at leasttwo yesvotes. Designa circuit thatdetermines whether a proposal passes.
Sometimes light fixtures are controlled by more thanswitch. Circuits needed to be designed so that flippingany one of the switches for the fixture turns the light
on when it is off and turns the light off when it is on.Design circuits that accomplish this when there are twoswitches and when there are three switches.
C b f G ( )
8/11/2019 Boolean Algebra (4)
44/54
44
Combinations of Gates (half adder)
Combinational logic circuits give us many useful
devices.One of the simplest is the half adder, which findsthe sum of two bits.
We can gain some insight as to the construction of a
half adder by looking at its truth table
C bi i f G ( )
8/11/2019 Boolean Algebra (4)
45/54
45
Combinations of Gates (half adder)
xy
SumCarry
C bi i f G ( )
8/11/2019 Boolean Algebra (4)
46/54
46
Combinations of Gates (full adder)
We can change our half adder into to a full adder by
including gates for processing the carry bit.The truth table for a full adderis shown below.
C bi ti f G t (f ll dd )
8/11/2019 Boolean Algebra (4)
47/54
47
Combinations of Gates (full adder)
E i
8/11/2019 Boolean Algebra (4)
48/54
48
pp. (765-766)
1-6
10-11
13-19
Exercises
Mi i i ti f Ci it
8/11/2019 Boolean Algebra (4)
49/54
49
Minimization of Circuits
Karnaugh Maps
It is a graphical approach used to simplify a Booleanfunction (sum of products expansion).
Let F(A,B)be a sum-of-products Boolean expression.To minimize F, we use a rectangular array of two rows
and two columnsin which rows and columns are labeled asfollows:
Two variables
22possible
Minterms.
Each squareis called a cellcorresponds to a minterm.Cellsare called adjacentif the mintermsthat theyrepresent differin exactly one literal.
Mi i i ti f Ci it
8/11/2019 Boolean Algebra (4)
50/54
50
A two-variablesKarnaugh Map
If a mintermis presentin F(A,B), then we place a 1inthe cell corresponding to the minterm, otherwise thecell is left emptyor place a O.
The resulting array is called K-map corresponding tothe expression
Minimization of Circuits
Mi i i ti f Ci it
8/11/2019 Boolean Algebra (4)
51/54
51
A two-variablesKarnaugh Map
FindBoolean expressions that represent the functionF(A,B) which is given in the following table.
Minimization of Circuits
Dont care condition ? x
Mi i i ti f Ci it
8/11/2019 Boolean Algebra (4)
52/54
52
A Three-variablesKarnaugh Map
Minimization of Circuits
Use K-Map to find a minimal expansion of thefunction, and draw the circuit diagram.
Mi i i ti f Ci it
8/11/2019 Boolean Algebra (4)
53/54
53
A four-variablesKarnaugh Map
Minimization of Circuits
Use K-Map to find a minimalexpansion of the function, anddraw the circuit diagram.
Exercises
8/11/2019 Boolean Algebra (4)
54/54
pp. (779-780)
1-2
6-7
12
Exercises