Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views44 pages

Complete Lecture Chapter 2

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 44

Boolean Algebra

Why study Boolean Algebra?

It is highly desirable to find the simplest circuit implementation


(logic) with the smallest number of gates or wires.

We can use Boolean minimization process to reduce a Boolean


function (expression) to its simplest form: The result is an
expression with the fewest literals and thus less wires in the
final gate implementation.

1
Boolean Algebra (continued)

▪ George Boole (1815-1864), a mathematician introduced a


systematic treatment of logic.
▪ He developed a consistent set of postulates (assumptions)
that were sufficient to define a new type of algebra: Boolean
Algebra (similar to Linear Algebra)
▪ Many of the rules are the same as the ones in Linear
Algebra.
▪ Boolean Algebra is defined by a set of elements, B,
together with two binary operators + and .
▪ Boolean Functions can represent electrical circuits.
2
Difference between Postulates & Theorems

Postulate
– A basic assumption that is accepted without proof
– Accepted as true in order to provide a basis for logical
reasoning

Boolean Postulates proposed by George Boole (1815-1864) are


assumptions that serve as basis for the Boolean Algebra

Theorem
– A statement which has been proved or can be proved to be
true using logical (deductive) reasoning
– A proposition deducible from basic postulates 3
Two Valued Boolean Algebra

• Set of two Elements B={0,1}


• Two Binary Operators + and .
• Two Valued Boolean Algebra having a set of two elements
{0,1}, two binary operators has operation rules similar to
AND and OR operations and Complement Operator
equivalent to NOT operator.
• Use Boolean Algebra to represent Binary Logic
• Boolean Function F1 = x + y ' z

4
Two Valued Boolean Algebra

• Closure➔ x + y is in B and x . y=is in B


– Obvious as result either 0 or 1
• Identity➔ (1.x=x) and (0+x=x)
• Commutative ➔x + y = y + x and x . y = y . x
– Can be proved from the Truth Table
• Distributive ➔ x + (y.z) = (x + y)(x + z) and x.(y + z) = (x.y) + (x.z)
– Can be proved from the Truth Table
• Associative ➔(x + y) + z = x + (y + z) = x + y + z and (xy)z = x(yz) = xyz
– Can be proved from the Truth Table
• Complement➔ x + x’ = 1 and x.x’=0
– X+X’=1➔ 0 +0’=0+1=1 and 1+1’=1+0=1
– X.X’=0 ➔ 0.0’ = 0.1 =1 and 1.1’ =1+0=1

5
Postulates & Theorems of Boolean Algebra
▪ Postulate 2 - Identity a) X + 0 = X b) X . 1 = X
▪ Postulate 3 – Commutative a) X + Y = Y + X b) X . Y = Y.X
▪ Postulate 4- Distributive
a) X . (Y + Z) = (X .Y) + (X . Z)
b) X + (Y . Z) = (X+Y) . (X+Z)
▪ Postulate 5 – Associative
a) (x + y) + z = x + (y + z) = x + y + z
b) (xy)z = x(yz) = xyz
▪ Postulate 6 – Complement a) X + X’ = 1 b) X . X’ = 0

▪ Theorem 1 a) X+X = X b) X.X=X


▪ Theorem 2 a)X+1=1 b) X.0=0
▪ Theorem 3 (X’)’=X
▪ Theorem 4 a) X+(Y+Z)=(X+Y)+Z b) X(YZ)= (XY)Z
▪ Theorem 5 a) (X+Y)’ = X’Y’ b) (XY)’=X’+Y’
▪ Theorem 6 a) X+ XY=X b) X(X+Y)=X 6
Duality principal

• Every algebraic expression deducible from


postulates of Boolean Algebra remain valid if
the operators and identity elements are
interchanged
– In postulates part (a) if binary operators are
interchanged then we get postulate part (b)

• If dual of an Algebraic Expression is desired,


we simply interchange OR and AND
7
Laws of Boolean Algebra

• There are 6 fundamental laws, or axioms, used to formulate


various algebraic structures:

1. Closure: Boolean algebra operates over a field of numbers, B = {0,1}

For every x, y in B:
▪ Closure with respect to +
x + y is in B
(1,0)
(1,0) (1,0)
▪ Closure with respect to .
x . y is in B
(1,0)
(1,0) (1,0)
8
Laws of Boolean Algebra (continued)
2. Identity laws:
▪ A set B is said to have an identity element with
respect to a binary operation {.} on B if there exists an
element designated by 1 in B with the property: 1 . x = x
Example: AND operation

▪ A set B is said to have an identity element with respect


to a binary operation {+} on B if there exists an element
designated by 0 in B with the property: 0 + x = x
Example: OR operation

» Similar to Linear Algebra 9


Laws of Boolean Algebra (continued)

3. Commutative laws: For every x, y in B,


▪ Commutative with respect to +
x+y=y+x
» Similar to Linear Algebra
▪ Commutative with respect to .
x.y=y.x

x x
F=x+y F = x.y
y y
y y F = y.x
F=y+x
x x

10
Laws of Boolean Algebra (continued)

4. Distributive laws: For every x, y, z in B,


• x + (y.z) = (x + y)(x + z) [+ is distributive over .]
» NOT Similar to Linear Algebra

• x.(y + z) = (x.y) + (x.z) [. is distributive over +]


» Similar to Linear Algebra

11
Laws of Boolean Algebra (continued)

5. Associative laws: For every x, y, z in B,


▪ (x + y) + z = x + (y + z) = x + y + z
▪ (xy)z = x(yz) = xyz
» Similar to Linear Algebra

x
F = xyz
y
z

z
F = xyz
y
x
12
Laws of Boolean Algebra (continued)

6. Complement
For each x in B, there exists an element x’ in B (the
complement of x) such that:
• x + x’ = 1
• x . x’ = 0

We can also use x to represent complement.

13
Laws of Boolean Algebra (continued)

14
Implementation of Boolean Functions

Draw the logic diagram for the following function: F = (a.b)+(b.c)

a
b
F

15
Implementation of Boolean Functions

F1 = x + y ' z
Boolean Function expresses logical relationship between binary variables
F1 is 1 if X=1 or if Y=0 and Z=1
Boolean Function can be represented by Truth Table (2n rows)

x F1

y 16
z
Implementation of Boolean Functions

Example 2: F2 = x' y ' z + x' yz + xy '

F2
z

17
Implementation of Boolean Functions
▪ Try another implementation using a simplified F2:
F2 = x' y ' z + x ' yz + xy'
= x' z ( y '+ y ) + xy' Distributive Pos

= x' z (1) + xy' Complement Pos

= x ' z + xy'
x
y
F2

•This implementation has fewer gates and fewer inputs


to the gates (or wires) than the previous one. 18
Simplifying Boolean Functions
▪ Simplify the following Boolean function to a minimum
number of terms:
F3 = xy + x' z + yz
= xy + x' z + yz( x + x' ) Identity .1 is same & Complement Pos (x.x’)=1

= xy + x' z + xyz + x' yz Distributed Pos

= xy + xyz + x' z + x' yz Rearrange order

= xy(1 + z ) + x' z (1 + y ) Distributed Pos

= xy + x' z Theorem 2 (X+1 =1)

x
y
F3

z 19
20
Complement of a Function
▪Theorem 5 (X+Y)’ = X’Y’ (XY)’=X’+Y’

(A+B+C+D+…+F)’= A’B’C’D’…. F’
(ABCD…F)’ = A’+B’+C’+D’+… + F’

The complement of a Function F is F’ is obtained by taking dual of


the function and complement each literal
F1=X’YZ’ +X’Y’Z
Dual of F1 is = (X’+Y+Z’)(X’+Y’+Z) - Interchange AND and OR in function
Complement each literal (X+Y’+Z)(X+Y+Z’) = F1’

21
More on complements (DeMorgan)
Theorem 5, DeMorgan (X+Y)’ = X’Y’ and (XY)’=X’+Y’

▪ Find the complement of: ▪ Show that the complement of x( x + y ) = x'


F = ( AB '+C ) D '+ E [ x ( x + y )]' = x'+ ( x + y )'
F ' = [( AB '+C ) D '+ E ]' = x'+ x ' y '
= [( AB '+C ) D ' ]' E '
= x ' (1 + y ' ) Distributed Pos
= [( AB '+C )'+ D ' ' ]E '
= x ' (1) = x' Theorem 2 (X+1 =1)
= [( AB ' )' C '+ D ]E '
= ( A'+ B )C ' E '+ DE '

22
23
Minterms and Maxterms

n binary variables can be combined to form 2n terms (AND terms),


called Minterms or standard products.
x’y’(00),x’y(01),xy’(10),xy(11)

In a similar fashion, n binary variables can be combined to form


2n terms (OR terms), called Maxterms or standard sums.

Boolean Functions expressed in Sum of MinTerms or Product of


MaxTerms are said to be in Canonical Form

* Note that each maxterm is the complement of its corresponding minterm and vice versa.

24
Minterms and Maxterms (continued)

Each Minterm is obtained from an AND term. Variable primed if corresponding bit 0, vice versa
Each Maxterm is obtained from an OR term. Variable primed if corresponding bit 1, vice versa

x y z Minterms Maxterms
0 0 0 x’y’z’ mo x+y+z Mo
0 0 1 x’y’z m1 x+y+z’ M1
0 1 0 x’yz’ m2 x+y’+z M2
0 1 1 x’yz m3 x+y’+z’ M3
1 0 0 xy’z’ m4 x’+y+z M4
1 0 1 xy’z m5 x’+y+z’ M5
1 1 0 xyz’ m6 x’+y’+z M6
1 1 1 xyz m7 x’+y’+z’ M7

25
Sum of Minterms 
▪ Given the truth table, express F1 in sum of minterms
x y z F1 F2
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 0
1 1 0 0 0
1 1 1 1 0

F1 ( x, y, z ) = (1,4,7) = m1 + m4 + m7
= ( x' y ' z ) + ( xy ' z ' ) + ( xyz )
▪ Find F2 26
Product of Maxterms 
▪ Given the truth table, express F1 in Product of Maxterms

x y z F1 F2
0 0 0 0 1
0 0 1 1 0
0 1 0 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1 1 0
1 1 0 1 0
1 1 1 1 0
F1 ( x, y, z ) = (0,2,3) = M 0  M 2  M 3
= ( x + y + z )( x + y '+ z )( x + y '+ z ' )
27
▪ Find F2
Sum of Min Terms
Express the Boolean function F = x + y ' z in a sum of
minterms.
AIM: Convert it to 3 variable AND Terms and take their SUM
x = x( y + y ' ) = xy + xy'
xy = xy( z + z ' ) = xyz + xyz'
xy' = xy' ( z + z ' ) = xy' z + xy' z '
y ' z = y ' z ( x + x' ) = xy' z + x' y ' z
Adding all terms and excluding recurring terms:
F ( x, y, z ) = x' y ' z + xy' z '+ xy' z + xyz'+ xyz
F ( x, y, z ) = m1 + m4 + m5 + m6 + m7 = (1,4,5,6,7)
28
Sum of Min Terms
Express the Boolean function F = x + y ' z in a sum of

29
Product of Max Terms
Express the Boolean function F = xy + x ' z in a Product of
Maxterms.
AIM: Convert it to 3 variable OR Terms and take their Product
Tip: Postulate 4b (Distributed)
F = xy + x' z = ( xy + x' )( xy + z )
( xy + x' ) = ( x + x' )( y + x' )
( xy + z ) = ( x + z )( y + z )
F = 1.( y + x' )( x + z )( y + z ) All Term missing one variable X+X’=1

x'+ y + zz ' = ( x'+ y + z )( x'+ y + z ' )


x + z + yy' = ( x + z + y )( x + z + y ' )
y + z + xx' = ( y + z + x)( y + z + x' )
Remove any recurring terms
F = ( x + y + z )( x + y '+ z )( x'+ y + z )( x'+ y + z ' )
30
M0M2M4M5 = F(x,y,z)=Π(0,2,4,5)
Using Truth Table

• Find Sum of Minterms and Product of MaxTerms of F=


xy+x’z (Same as before)
– Truth Table

Find Sum of Minterms & Product of Maxterms from truth table


– F(x,y,z)= ∑(1,3,6,7)
– F(x,y,z)= П (0,2,4,5) 31
Conversion between Canonical Forms

• Complement of a function expressed as sum of


minterms equals sum of minterms missing from
the original function
• F(A,B,C,D) = ∑(1,4,5,6,7)= m1+m4+m5+ m6+m7
• Complement is F’(A,B,C,D)= ∑(0,2,3) =
m0+m2+m3
• Complement of F’ is F that is different
F = (m0+m2+m3)’ = = m’0. m’2 . m’3 = = M0.M2.M3=
П(0,2,3)
32
Standard Form to represent Boolean Function

• Sum of Minterms and Product of Maxterm may


not be most efficient way to draw a circuit as all
variables must be used.
• Standard Functions have one two or three terms
and Two Levels. (AIM: Minimum Gates)
• SUM OF PRODUCT
– F= y’ + xy+ x’yz’
– Sum denotes OR of these terms
– Two Levels
• PRODUCT OF SUM
– F= x(y’+z)(x+’y+z’)
– Product denotes AND of these terms
– Two Levels
33
SUM OF PRODUCT

SUM OF PRODUCT
F= y’ + xy+ x’yz’
Sum denotes OR of these terms
Draw the circuit (2 Level)
x’
y
z’
y’ F
x
y

34
PRODUCT of SUM
PRODUCT OF SUM
F= x(y’+z)(x’+y+z’)
Product denotes AND of these terms
Draw the circuit (2 Level)

x’
y
z’
x F
y’
z

35
Non Standard Boolean Function

• Boolean Expression in non standard form


F=AB+C(D+E) .
– Neither SOP or POS
– Implemented in 3 levels

A
B
C F
D
E
– Convert to Standard Form by distributive law
– F=AB+C(D+E) = AB+CD+CE
– Draw 2 Level Standard Sum of Product Circuit 36
Truth Table and Boolean Expression for
16 functions of two variables
• F0=0 Constant 0 or Null
• F1= x.y➔ AND (x and y)
• F2 = xy’➔ x but not y
• F3 = x
• F4 = x’y➔ y but not x
• F5 = y
• F6 = xy’ + x’y ➔Exclusive OR ( x or y but not both
• F7= x+y ➔OR (x or y)
• F8 = (x+y)’ ➔ NOR (Not OR)
• F9 = xy + x’y’➔ Equivalence (x equals y)
• F10 = y’ ➔Not y
• F11 = x+y’➔ If y then x
• F12 = x’ (Not x)
• F13 = x’ + y If x then y
• F14 = (xy)’ ➔ NAND
• F15 = 1 Binary constant 1
37
NOR Logic gate

2-input NOR logic gate:


F = ( X + Y )' X Y F
0 0 1
x 0 1 0
F
y 1 0 0
1 1 0

38
NAND Logic gate

2-input NAND logic gate:


F = ( X .Y )' X Y F
0 0 1
x 0 1 1
F
y 1 0 1
1 1 0

39
Exclusive OR Logic gate

2-input exclusive-OR (XOR) logic gate:


F = X Y X Y F
0 0 0
x 0 1 1
F
y 1 0 1
1 1 0

40
Exclusive NOR Logic gate

2-input exclusive-NOR logic gate:


F = ( X  Y )' X Y F
0 0 1
x 0 1 0
F
y 1 0 0
1 1 1

41
More Digital Logic Gates

• AND F=xy
• OR F=x+y
• Inverter F=x’
• Buffer F=x
• NAND F=(xy)’
• NOR F=(x+y)’
• Exclusive OR- XOR
• Exclusive NOR
42
Multiple Input GATES

3-input exclusive-OR (XOR) logic gate:


F = X Y  Z X Y Z F
0 0 0 0
x 0 0 1 1
y F
z 0 1 0 1
Implemented by 3 Input Gates
0 1 1 0
1 0 0 1
1 0 1 0
1 1 0 0
x
y F 1 1 1 1
z
Implemented by 2 Input Gates
43
Implementation of Boolean Functions
▪ Using only OR and NOT gates, draw a schematic for the
following function: F = xy + x' y '+ y ' z
( F ' )' = (( xy + x' y '+ y ' z )' )'
= [( xy)'.( x' y ' )'.( y ' z )' ]'
= [( x'+ y ' ).( x + y ).( y + z ' )]'
= ( x'+ y ' )'+ ( x + y )'+ ( y + z ' )'

x
y

z 44

You might also like