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

Chapter 2

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1/ 45

Chapter-2

Boolean Algebra and Logic gates

1
Outline
• Introduction
• Digital Logic Gates
• Other Logic Operators
• Logic levels and Digital signals
• Positive and Negative Logic
• Introduction to Boolean algebra
– Variables, literals and terms in Boolean expressions
– Dual of a Boolean expressions
• Postulates and Theorems of Boolean Algebra
• Venn Diagram
• Boolean Functions
• Simplification of Boolean Expressions
• Canonical and Standard forms of logic functions 2
Introduction
• Logic gates are electronic circuits that can be used to implement the most
elementary logic expressions, also known as Boolean expressions.
• The logic gate is the most basic building block of combinational logic. There
are three basic logic gates, namely the OR gate, the AND gate and the NOT
gate. Other logic gates that are derived from these basic gates are the NAND
gate, the NOR gate, the EXCLUSIVE-OR gate and the EXCLUSIVE-NOR gate.
• Boolean algebra is mathematics of logic. It is one of the most basic tools
available to the logic designer and thus can be effectively used for
simplification of complex logic expressions. Other useful and widely used
techniques based on Boolean theorems include the use of Karnaugh maps
what is known as the mapping method of logic simplification and the tabular
method given by Quine–McCluskey.
• The relation between the inputs and outputs of a gate can be expressed
mathematically by means of Boolean expression

3
Basic Logic Operations

AND

OR

NOT (Complement)

Order of Precedence
1. NOT
2. AND
3. OR
 can be modified using parenthesis
4
Basic Logic Operations

Standard Logic Symbol for basic operators 5


Additional Logic Operations

NAND
 F = (A . B)'

NOR
 F = (A + B)'

XOR
 Output is 1 iff either input is 1, but not both.

XNOR (aka. Equivalence)
 Output is 1 iff both inputs are 1 or both inputs are 0.

6
Additional Logic Operations
NAND XOR

NOR denotes inversion XNOR

7
Truth Tables

Used to describe the functional behavior of a Boolean
expression and/or Logic circuit.

Each row in the truth table represents a unique
combination of the input variables.
 For n input variables, there are 2n rows.

The output of the logic function is defined for each row.

Each row is assigned a numerical value, with the rows
listed in ascending order.

The order of the input variables defined in the logic
function is important.

8
Signal Levels and Logic Levels

9
Introduction to Boolean algebra
• Boolean algebra, quite interestingly, is simpler than ordinary algebra. It is
also composed of a set of symbols and a set of rules to manipulate these
symbols.
1. In ordinary algebra, the letter symbols can take on any number of values
including infinity. In Boolean algebra, they can take on either of two
values, that is, 0 and 1.
2. The values assigned to a variable have a numerical significance in ordinary
algebra, whereas in its Boolean counterpart they have a logical
significance.
3. While ‘.’ and ‘+’ are respectively the signs of multiplication and addition in
ordinary algebra, in Boolean algebra ‘.’ means an AND operation and ‘+’
means an OR operation.

10
Boolean Expressions

Boolean expressions are composed of

Literals – variables and their complements

Logical operations

A term is the expression formed by literals and
operations at one level.

Examples

F = A.B'.C + A'.B.C' + A.B.C + A'.B'.C'
literals logic operations


F = (A+B+C').(A'+B'+C).(A+B+C)

F = A.B'.C' + A.(B.C' + B'.C)
11
Dual of a Boolean Expression
• The dual of a Boolean expression is obtained by replacing all ‘.’ operations
with ‘+’ operations, all ‘+’ operations with ‘.’ operations, all 0s with 1s and
all 1s with 0s and leaving all literals unchanged. The examples below give
some Boolean expressions and the corresponding dual expressions:
• Given Boolean expression

• Corresponding dual

• Given Boolean expression

• Given Boolean expression

12
Cont’d
• Duals of Boolean expressions are mainly of interest in the study of Boolean
postulates and theorems.
• Otherwise, there is no general relationship between the values of dual
expressions. That is, both of them may equal ‘1’ or ‘0’. One may even equal ‘1’
while the other equals ‘0’.
• The fact that the dual of a given logic equation is also a valid logic equation
leads to many more useful laws of Boolean algebra. The principle of duality
has been put to ample use during the discussion on postulates and theorems
of Boolean algebra.
• Example

13
Boolean Expressions

Boolean expressions are realized using a
network (or combination) of logic gates.
 Each logic gate implements one of the logic
operations in the Boolean expression
 Each input to a logic gate represents one of
the literals in the Boolean expression
A
B
literals logic operations
f

14
Boolean Expressions
Example 1:

Evaluate the following Boolean expression, for all


combination of inputs, using a Truth table.

F(A,B,C) = A'.B'.C + A.B'.C' + A.C

Example 2:
Using a Truth table, prove that the following two Boolean
expressions are equivalent.

F1 = (A + B)'
F2 = A'.B' 15
Boolean Algebra

George Boole developed an algebraic description for
processes involving logical thought and reasoning.
 Became known as Boolean Algebra


Boolean Algebra is a powerful tool for analyzing and
designing logic circuits.

16
Basic Laws and Theorems
Commutative Law A+B=B+A A.B = B.A
Associative Law A + (B + C) = (A + B) + C A . (B . C) = (A . B) . C
Distributive Law A.(B + C) = AB + AC A + (B . C) = (A + B) . (A + C)
Null Elements A+1=1 A.0=0
Identity A+0=A A.1=A
Idempotence A+A=A A.A=A
Complement A + A' = 1 A . A' = 0
Involution A'' = A
Absorption (Covering) A + AB = A A . (A + B) = A
Simplification A + A'B = A + B A . (A' + B) = A . B
DeMorgan's Rule (A + B)' = A'.B' (A . B)' = A' + B'
Logic Adjacency (Combining) AB + AB' = A (A + B) . (A + B') = A
Consensus AB + BC + A'C = AB + A'C (A + B) . (B + C) . (A' + C) = (A + B) . (A' + C)

17
Idempotence
A+A=A
F = ABC + ABC' + ABC
F = ABC + ABC'
Note: terms can also be added using this theorem

A.A=A
G = (A' + B + C').(A + B' + C).(A + B' + C)
G = (A' + B + C') + (A + B' + C)
Note: terms can also be added using this theorem

18
Complement
A + A' = 1
F = ABC'D + ABCD
F = ABD.(C' + C)
F = ABD

A . A' = 0
G = (A + B + C + D).(A + B' + C + D)
G = (A + C + D) + (B . B')
G=A+C+D

19
Distributive Law
A.(B + C) = AB + AC A + (B.C) = (A + B).(A + C)

F = WX.(Y + Z) F = WX + (Y.Z)
F = WXY + WXZ F = (WX + Y).(WX + Z)
G = B'.(AC + AD) G = B' + (A.C.D)
G = AB'C + AB'D
G = (B' + A).(B' + C).(B' + D)
H = A.(W'X + WX' + YZ)
H = A + ( (W'X).(WX') )
H = AW'X + AWX' + AYZ
H = (A + W'X).(A + WX')

20
Absorption (Covering)
A + AB = A A.(A + B) = A

F = A'BC + A' F = A'.(A' + BC)


F = A' F = A'
G = XYZ + XY'Z + X'Y'Z' + XZ G = XZ.(XZ + Y + Y')
G = XYZ + XZ + X'Y'Z'
G = XZ.(XZ + Y)
G = XZ + X'Y'Z'
G = XZ
H = D + DE + DEF
H=D H = D.(D + E + EF)
H=D

21
Simplification
A + A'B = A + B
F = (XY + Z).(Y'W + Z'V') + (XY + Z)'
F = Y'W + Z'V' + (XY + Z)'

A.(A' + B) = A . B

G = (X + Y).( (X + Y)' + (WZ) )


G = (X + Y) . WZ

22
Logic Adjacency (Combining)
A.B + A.B' = A
F = (X + Y).(W'X'Z) + (X + Y).(W'X'Z)'
F = (X + Y)

(A + B).(A + B') = A

G = (XY + X'Z').(XY + (X'Z')' )


G = XY

23
Boolean Algebra
Example:

Using Boolean Algebra, simplify the


following Boolean expressions.

F(A,B,C) = A'.B.C + A.B'.C + A.B.C


F(A,B,C) = (A'+B'+C').(A'+B+C').(A+B'+C')

24
Importance of Boolean Algebra

Boolean Algebra is used to simplify Boolean expressions.
– Through application of the Laws and Theorems discussed

Simpler expressions lead to simpler circuit realization, which,
generally, reduces cost, area requirements, and power
consumption.

The objective of the digital circuit designer is to design and
realize optimal digital circuits.

25
Algebraic Simplification

Boolean expressions can be simplified using the
following methods:
1. Multiplying out the expression
2. Factoring the expression
3. Combining terms of the expression
4. Eliminating terms in the expression
5. Eliminating literals in the expression
6. Adding redundant terms to the expression
As we shall see, there are other tools that can be used to simplify Boolean Expressions.
Namely, Karnaugh Maps.
26
Venn diagram
• A Venn diagram is a representation of a Boolean operation using shaded
overlapping regions. There is one region for each variable, all circular in
the examples here. The interior and exterior of region x corresponds
respectively to the values 1 (true) and 0 (false) for variable x. The shading
indicates the value of the operation for each combination of regions, with
dark denoting 1 and light 0.
• The three Venn diagrams in the figure below represent respectively
conjunction x∧y, disjunction x∨y, and complement ¬x.

27
Cont’d
• For conjunction, the region inside both circles is shaded to
indicate that x∧y is 1 when both variables are 1. The other
regions are left unshaded to indicate that x∧y is 0 for the
other three combinations.
• The second diagram represents disjunction x∨y by shading
those regions that lie inside either or both circles. The third
diagram represents complement ¬x by shading the region
not inside the circle.
• Venn diagrams are helpful in visualizing laws.

28
Standard Forms for
Boolean Expressions

Sum-of-Products (SOP)
 Derived from the Truth table for a function by
considering those rows for which F = 1.
 The logical sum (OR) of product (AND) terms.
 Realized using an AND-OR circuit.

Product-of-Sums (POS)
 Derived from the Truth table for a function by
considering those rows for which F = 0.
 The logical product (AND) of sum (OR) terms.
 Realized using an OR-AND circuit.

29
Sum-of-Products (SOP)
Minterms

A minterm, for a function of n variables, is a
product term in which each of the n variables
appears once.

Each variable in the minterm may appear in its
complemented or uncomplemented form.

For a given row in the Truth table, the
corresponding minterm is formed by
 Including variable xi, if xi = 1
 Including the complement of xi, if xi = 0
30
Minterms

31
Sum-of-Products

Any function F can be represented by a sum of
minterms, where each minterm is ANDed with
the corresponding value of the output for F.
 F =  (mi . fi)
 where mi is a minterm
 and fi is the corresponding functional output
Denotes the logical

sum operation Only
the minterms for which fi = 1 appear in the
expression for function F.
 F =  (mi) =  m(i)
shorthand notation
32
Sum-of-Products

The Canonical Sum-of-Products for function F is the Sum-of-
Products expression in which each product term is a minterm.
 The expression is unique
 However, it is not necessarily the lowest-cost

SOP can be converted into canonical SOP by ANDing the logical
ORing of the missed variable & its complement to the term in
the expression.

Synthesis process
 Determine the Canonical Sum-of-Products
 Use Boolean Algebra (and K-maps) to find an optimal,
functionally equivalent, expression.

33
Sum-of-Products
AND Sum term

Y' + X'YZ' + XY

X.Y
OR

AND product term

Product Term = Logical ANDing of literals


Sum = Logical ORing of product terms

34
Sum-of-Products

Use the Distributive Laws to multiply out a
Boolean expression.

Results in the Sum-of-Products (SOP) form.
F = (A + B).(C + D).(E)
F = (A.C + A.D + B.C + B.D).(E)
Product terms are
F = A.C.E + A.D.E + B.C.E + B.D.E of single variables

not in SOP form H = A.B.(C + D) + ABE

35
Product-of-Sums (POS)
Maxterms

A Maxterm, for a function of n variables, is a sum
term in which each of the n variables appears
once.

Each variable in the Maxterm may appear in its
complemented or uncomplemented form.

For a given row in the Truth table, the
corresponding Maxterm is formed by
 Including the variable xi, if xi = 0
 Including the complement of xi, if xi = 1
36
Maxterms

37
Product-of-Sums

Any function F can be represented by a product
of Maxterms, where each Maxterm is ANDed
with the complement of the corresponding value
of the output for F.
 F =  (Mi . f 'i)

Denotes the logical
where Mi is a Maxterm
product operation  and f 'i is the complement of the corresponding
functional output
 Only the Maxterms for which fi = 0 appear in the
expression for function F.
 F =  (Mi) =  M(i) shorthand notation
38
Product-of-Sums

The Canonical Product-of-Sums for function F is
the Product-of-Sums expression in which each
sum term is a Maxterm.
 The expression is unique
 However, it is not necessarily the lowest-cost

Synthesis process
 Determine the Canonical Product-of-Sums
 Use Boolean Algebra (and K-maps) to find an
optimal, functionally equivalent, expression.
39
Product-of-Sums
OR product term

X.(Y' + Z).(X' + Y + Z)

X' + Y + Z
AND

sum term
OR
Sum Term = Logical ORing of variables
Product = Logical ANDing of sum terms

40
Product-of-Sums

Use the Distributive Laws to factor a Boolean
expression.

Results in the Product-of-Sums (POS) form.

F = V.W.Y + V.W.Z + V.X.Y + V.X.Z


F = (V).(W.Y + W.Z + X.Y + X.Z)
Sum terms are
F = (V).(W + X).(Y + Z) of single variables

not in POS form H = (A+B).(C+D+E) + CE

41
SOP and POS

Any function F may be implemented as either a Sum-of-
Products (SOP) expression or a Product-of-Sums (POS)
expression.

Both forms of the function F can be realized using logic
gates that implement the basic logic operations.

However, the two logic circuits realized for the function F
do not necessarily have the same cost.

Objective: minimize the cost of the designed circuit
 Compare the cost of the SOP realization with
that of the POS realization

42
Converting between SOP and POS

The sum-of-products (SOP) form of a Boolean
expression can be converted to its corresponding
product-of-sums (POS) form by factoring the
Boolean expression.


The product-of-sums (POS) form of a Boolean
expression can be converted to its corresponding
sum-of-products (SOP) form by multiplying out the
Boolean expression.

43
Logic Circuit Implementations

Student Exercise:

Draw the AND-OR circuits for the following


Sum-of-Products (SOP) expressions:

1. F1 = A'B + AC' + B'C


2. F2 = ABD + BCD' + AB'C' + B'CD

Draw the OR-AND circuits for the following


Product-of-Sums (POS) expressions:

1. F1 = (A+B').(A'+C).(B+C')
2. F2 = (A+B+D).(B'+C+D').(A'+B+C).(B+C'+D)

44
Summary of Logic Functions

45

You might also like