0% found this document useful (0 votes)
18 views61 pages

Boolean Algebra and Logic Gates

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views61 pages

Boolean Algebra and Logic Gates

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 61

DIGITAL LOGİC DESİGN (ECEg3141)

3. Boolean algebra and Logic Gates

By Hailay Berihu (M.Sc)

By Hailay B. (M.Sc), AdU, CET, ECE


October 2016 1
Outline of Chapter 3
3.1 Basic Definitions
3.2 Axiomatic Definition of Boolean Algebra
3.3 Boolean Functions
3.4 Canonical and Standard Forms
3.5 Other Logic Operations
3.6 Digital Logic Gates
3.7 Simplification of Boolean Functions

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


2
3.1 Basic Definitions

 Boolean algebra
 may be defined with a set of elements,
 a set of operators, and
 a number of unproved axioms or postulates
 A binary operator-assigns to each pair of
elements from a unique element from.
 As an example, consider the relation
 We say that * is a binary operator if it specifies a rule for
finding c from the pair (a, b) and also if a, b,c S

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


3
3.1 Basic Definitions (Cont’d)

 Boolean algebra provides the operations and the


rules for working with the set {0, 1}.
 Most common postulates
i. Closure-A set S is closed with respect to a binary
operator if, for every pair of elements of S, the binary
operator specifies a rule for obtaining a unique
element of S.
o For example, the set of natural numbers N = {1. 2, 3,
4, ... ) is closed with respect to the binary operator
plus (+) by the rules of arithmetic addition, since for any
a, b є N we obtain a unique c є N by the operation a+b=c
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
4
3.1 Basic Definitions (Cont’d)
ii. Associative law-A binary operator * on a set S is said to be associative whenever

iii. Commutative law-A binary operator on a set S is said to be


commutative whenever

iv.Identity element-A set S is said to have an identity element with respect to a


binary operation on S if there exists an element with the property

v. Inverse-A set S having the identity element e with respect


to a binary operator is said to have an inverse whenever,
for every xє S , there exists an yє S element such that

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


5
3.1 Basic Definitions (Cont’d)
 Example: In the set of integers I with e=0, the
inverse of an element a is (-a) since.
a+(-a)=0
.
vi. Distributive law-If *and , are two binary
operators on a set S, * is said to be distributive
over . whenever

The operators and postulates have the following


meanings:
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
6
3.1 Basic Definitions (Cont’d)

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


7
3.2 Axiomatic Definition of Boolean Algebra
 In 1854 George Boole an algebraic system
now called Boolean algebra
 In 1938 C.E. Shannon introduced a two-valued
Boolean algebra called switching algebra
 For the formal definition of Boolean algebra,
postulates formulated by E.V. Huntington in 1904
is employed

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


8
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 Boolean algebra is defined on a set of elements B binary
operators + and ., the following (Huntington) postulates are
satisfied:

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


9
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 Boolean algebra Vs arithmetic and ordinary
algebra

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


10
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 In order to have a Boolean algebra, one must show:

•we deal only with a two-valued Boolean algebra,


•Two-valued Boolean algebra has applications in set theory and
in propositional logic.
•Our interest here is with the application of Boolean algebra to
gate-type circuits.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


11
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)

 important property of Boolean algebra is called the


duality principle
 every algebraic expression deducible from the postulates
of Boolean algebra remains valid if the operators and
identity elements are inter-changed
 In a two-valued Boolean algebra, the identity elements
and the elements of the set B are the same: 1and 0.
 For dual of an algebraic expression, we simply
interchange OR and AND operators and replace 1's by
0's and 0's by 1's

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


12
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 Table 3.1 Postulates and Theorems of Boolean Algebra

Note that theorem 1(b) is the dual of theorem 1(a)


By Hailay B. (M.Sc), AdU, CET, ECE October 2016
13
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 Any dual theorem can be derived from the proof of its corresponding
pair

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


14
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 The absorption theorem

The following truth table verifies the first absorption theorem

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


15
3.2 Axiomatic Definition of Boolean Algebra (Cont’d)
 The truth table for the first DeMorgan’s theorem

The operator precedence for evaluating Boolean


expressions is
(1) parentheses, (2) NOT, (3) AND, and (4) OR
As an example, consider the truth table for DeMorgan’s theorem. The left side of
the expression is (x + y)'. Therefore, the expression inside the parentheses is
evaluated first and the result then complemented.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


16
3.3 Boolean Functions
 A Boolean function is an expression formed with binary variables
 Consider, for example, the Boolean function

To represent a function in a truth table, we need a list of the 2 n combinations of


l's and 0's of the n binary variables

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


17
3.3 Boolean Functions (Cont’d)
 The manipulation of Boolean algebra is applied mostly to the
problem of finding simpler expressions for the same function,
Consider, for example, the function:

In general, two functions of n binary variables are said


to be equal if they have the same value for all possible
2n combinations of the n variables.
A Boolean function may be transformed from an
algebraic expression into a logic diagram composed of
AND, OR, and NOT gates.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


18
3.3 Boolean Functions (Cont’d)
The implementation of the four functions introduced in the previous discussion is shown in
Figure 3.1.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


19
3.3 Boolean Functions (Cont’d)
 Algebraic Manipulation
 A literal is a primed or unprimed variable.
 The minimization of the number of literals and the number of terms
results in a circuit with less equipment
 The number of literals in a Boolean function can be minimized by algebraic
manipulations

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


20
3.3 Boolean Functions (Cont’d)
 Complement of a Function
 The complement of a function F is F' and is obtained from
an interchange of 0's for 1's and l's for 0's in the value of F.
 The three-variable form of the first DeMorgan’s theorem is
derived below.
 The postulates and theorems are those listed in Table 3.1.

DeMorgan's theorems for any number of variables resemble in form


the two variable case and can be derived by successive substitutions
similar to the method used in the above derivation.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


21
3.3 Boolean Functions (Cont’d)

Remember that the dual of a function is obtained from the inter-change of AND and
OR operators and1’s and 0's.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


22
3.4 Canonical and Standard Forms
 Minterms and Maxterms
 A binary variable may appear either in its normal
form (x) or in its complement form (x').
 Now consider two binary variables x and y
combined with an AND operation.
 there are four possible combinations: x' y', x'y, xy',
and xy called a minterms, or a standard products.
 n variables forming an OR term, provide 2n
possible combinations, called maxterms, or
standard sums.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


23
3.4 Canonical and Standard Forms (Cont’d)
 Table 3.3 Minterms and Maxterms for Three Binary Variables

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

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


24
3.4 Canonical and Standard Forms (Cont’d)
 A Boolean function may be expressed algebraically from a given truth table.
 Form a minterm for each combination of the variables that produces a 1 in
the function, and then taking the OR of all those terms

 For example, the function f1 in Table 3.4 is determined by expressing the


combinations 001, 100, and 111 as x'y'z, xy'z' , and xyz, respectively. Since
each one of these minterms results in f1=1 we should have

Important property of Boolean algebra: Any Boolean function can be expressed as a


sum of minterms (by "sum" is meant the ORing of terms).
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
25
3.4 Canonical and Standard Forms (Cont’d)
 Now consider the complement of a Boolean function.
 It may be read from the truth table by forming a minterm for
each combination that produces a 0 in the function and then
ORing those terms.
 The complement of f1

 If we take the complement of we obtain the function f1

Similarly, it is possible to read the expression for f2 from the table:

second important property : Any Boolean function can be expressed as a product of


maxterms (by "product" is meant the ANDing of terms)
Form a maxterm for each combination of the variables that produces a 0 in the function,
and then form the AND of all those maxterms.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


26
3.4 Canonical and Standard Forms (Cont’d)
 Boolean functions expressed as a sum of minterms or product of
maxterms are said to be in canonical form.
 Sum of Minterms
 The minterms whose sum defines the Boolean function are those that give
the 1's of the function in a truth table

 It is sometimes convenient to express the Boolean function in its sum of


minterms form.
 If not in this form, it can be made so by first expanding the expression
into a sum of AND terms.
 Each term is then inspected to see if it contains all the variables.
 The following examples clarify this procedure.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


27
3.4 Canonical and Standard Forms (Cont’d)

 Product of Maxterms
 To express the Boolean function as a product of maxterms, it must
first be brought into a form of OR terms.
 any missing variable x in each OR term is ORed with xx’
 This procedure is clarified by the following example.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


28
3.4 Canonical and Standard Forms (Cont’d)

Standard Forms
Canonical forms of Boolean algebra are obtained from reading a
function from the truth table.
Each minterm or maxterm must contain, by definition, all the variables
either complemented or uncomplemented.
Seldom contain least number of literals.
Another way to express Boolean functions is in standard form
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
29
3.4 Canonical and Standard Forms (Cont’d)
 In standard forms, the terms that form the function may contain one, two,
or any number of literals.
 There are two types of standard forms: the sum of products and product of sums.
 An example of a function expressed in sum of products is

 An example of a function expressed in product of sums is

 This expression has three sum terms of one, two, and four literals each,
respectively.
 A Boolean function may be expressed in a nonstandard form. For example, the
function
 is neither in sum of products nor in product of sums. can be changed to a
standard form

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


30
3.5 Other Logic Operations
 For two variables, n=2 , and the number of possible Boolean
functions is 16.

 The 16 functions listed in truth table form can be expressed


algebraically by means of Boolean expressions.
 This is shown in the first column of Table 3.6.
 The Boolean expressions listed are simplified to their minimum
number of literals.
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
31
3.5 Other Logic Operations (Cont’d)
 The 16 functions listed can be subdivided into three categories:
 1. Two functions that produce a constant 0 or 1.
 2. Four functions with unary operations: complement and transfer.
 3. Ten functions with binary operators that define eight different operations: AND, OR,
NAND, NOR, exclusive-OR, equivalence, inhibition, and implication.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


32
3.6 Digital Logic Gates
 Factors to be weighed when considering the construction
of logic gates are
 The feasibility and economy of producing the gate with
physical components,
 The possibility of extending the gate to more than two
inputs,
 The basic properties of the binary operator such as
commutativity and associativity, and
 The ability of the gate to implement Boolean functions
alone or in conjunction with other gates.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


33
3.6 Digital Logic Gates (Cont’d)
 Of the 16 functions defined in Table 3.6, two are equal to
a constant and four others are repeated twice.
 There are only ten functions left to be considered as
candidates for logic gates.
 complement, transfer, AND, OR, NAND, NOR,
exclusive-OR, and equivalence, are used as standard
gates in digital design.
 inhibition and implication, are not commutative
or associative and thus are impractical to use as
standard logic gates.
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
34
3.6 Digital Logic Gates (Cont’d)
 The graphic symbols and truth tables of the eight gates are shown in
Figure 3.2

Figure 3.2 Digital logic gates


By Hailay B. (M.Sc), AdU, CET, ECE October 2016
35
3.6 Digital Logic Gates (Cont’d)
 Extension to Multiple Inputs
 A gate can be extended to have multiple inputs if the binary
operation it represents is commutative and associative.
 The AND and OR operations, defined in Boolean algebra,
possess these two properties.

 The OR function can be extended to three or more variables.


 The NAND and NOR functions are commutative
 The NAND and NOR operators are not associative

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


36
3.6 Digital Logic Gates (Cont’d)

To overcome this difficulty, we define the multiple NOR (or NAND)
gate as a complemented OR (or AND) gate. Thus, by definition, we
have

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


37
3.6 Digital Logic Gates (Cont’d)
 The graphic symbols for the 3-input gates are shown in Figure 3.4.
 In writing cascaded NOR and NAND operations, one must use the correct
parentheses to signify the proper sequence of the gates .

 The second expression is obtained from DeMorgan’s theorem.


 It also shows that an expression in sum of products can be
implemented with NAND gates.
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
38
3.6 Digital Logic Gates (Cont’d)
 The exclusive-OR and equivalence gates are both commutative
and associative and can be extended to more than two inputs.
 However, multiple-input exclusive-OR gates are uncommon from
the hardware standpoint
 The exclusive-OR is an odd function, i.e., it is equal to 1 if the input variables
have an odd number of 1's.
 The construction of a 3-input exclusive-OR function is shown in Figure 3.5.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


39
3.7 Simplification of Boolean Functions
 Minimization is awkward because it lacks specific rules to
predict each succeeding step in the manipulative process by
algebraic means
 The map method provides a simple straightforward procedure for
minimizing Boolean functions
 First proposed by Veitch and modified by Karnaugh, is also known
as the “Veitch diagram" or the "Karnaugh map.“
 The map is a diagram made up of squares.
 Each square represents one minterm
 The simplest algebraic expression is anyone in a sum of
products or product of sums that has a minimum number of
literals

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


40
3.7 Simplification of Boolean Functions (Cont’d)
 Two-and Three-Variable Maps
 A two-variable map is shown in Figure 3.6 (a).
 There are four minterms for two variables; It consists of four squares, one for each
minterm

 As an example, the function xy is shown in Figure 3.7(a). Since xy


is equal to m3, a 1 is placed inside the square that belongs to
m3.
 Similarly, the function x + y is represented in the map of Figure
3.7(b) by three squares marked with 1’s.
 These squares are found from the minterms of the function:
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
41
3.7 Simplification of Boolean Functions (Cont’d)
 A three-variable map is shown in Figure 3.8.
 There are 8 minterms for 3 binary variables.
 Therefore, a map consists of eight squares.

 For example, the square assigned to m5 corresponds to row 1 and


column 01.
 When these two numbers are concatenated, they give the binary
number 101, whose decimal equivalent is 5.
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
42
3.7 Simplification of Boolean Functions (Cont’d)
 Any two adjacent squares in the map differ by only one variable,
which is primed in one square and unprimed in the other.
 For example, m5 and m7 lie in two adjacent squares. Variable y is
primed in m5, and unprimed in m7, whereas the other two variables
are the same in both squares.
 From the postulates of Boolean algebra, it follows that the sum of
two minterms in adjacent squares can be simplified to a single
AND term consisting of only two literals.
 To clarify this, consider the sum of two adjacent squares such
as m5 and m7:

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


43
3.7 Simplification of Boolean Functions (Cont’d)

There are cases where two squares in the map are considered to be
adjacent even though they do not touch each other.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


44
3.7 Simplification of Boolean Functions (Cont’d)
 In Figure 3.8, mo is adjacent to m2 and m4 is adjacent to m6
because the minterms differ by one variable, This can be
readily verified algebraically,

 Consequently, we must modify the definition of adjacent


squares to include this and other similar cases.
 This is done by considering the map as being drawn on a
surface where the right and left edges touch each other to
form adjacent squares.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


45
3.7 Simplification of Boolean Functions (Cont’d)
 Example 3.7.2 Simplify the Boolean function

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


46
3.7 Simplification of Boolean Functions (Cont’d)
 As an example, the logical sum of the four adjacent minterms 0,
2, 4, and 6 reduces to a single literal term z'.

 As a larger number of adjacent squares are combined, we obtain a


product term with fewer literals.
 One square represents one minterrn, giving a term of three
literals.
 Two adjacent squares represent a term of two literals.
 Four adjacent squares represent a term of one literal.
 Eight adjacent squares encompass the entire map &
produce a function that is always equal to 1.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


47
3.7 Simplification of Boolean Functions (Cont’d)
Example 3.7.3 Simplify the Boolean function

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


48
3.7 Simplification of Boolean Functions (Cont’d)

The function has a total of five minterms, as indicated by the five 1's in the map
of Figure 3.12.
The minterms are read directly from the map to be 1, 2, 3, 5, and 7. The
function can be expressed in sum of minterms form:

The given function can be simplified to an expression with only two terms:

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


49
3.7 Simplification of Boolean Functions (Cont’d)
 Don’t-Care Conditions
 There are applications in which the function is not
specified for certain variable value combinations.
 There are two cases in which this occurs. In the first
case, the input combinations never occur.
 As an example, the four-bit binary code for the
decimal digits has six combinations that are not used
and not expected to occur.
 In the second case, the input combinations are
expected to occur, but we do not care what the outputs
are in response to these combinations.
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
50
3.7 Simplification of Boolean Functions (Cont’d)
 Example 3.7.5 Simplification with Don’t-Care Conditions

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


51
3.7 Simplification of Boolean Functions (Cont’d)
 In part (a) of the figure, don’t-care minterms 0 and 2 are included
with the 1s, which results in the simplified function
 In part (b), don’t-care minterm 5 is included with the 1s, and the
simplified function now is
 The two expressions represent two functions that are
algebraically unequal
 It is also possible to obtain an optimized product-of-sums
expression for the function of Figure 4.6.
 including don’t-care minterms 0 and 2 with the 0s, giving the
optimized complemented function
 The optimized expression in product-of-sums form:

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


52
3.7 Simplification of Boolean Functions (Cont’d)
 In general, the complexity of a logic circuit is
directly related to the algebraic expression from
which the function is implemented
 Minimize the number of terms in the optimized
function
 Aavoide any redundant terms whose minterms
are already included in other terms
 Essential Prime Implicants
 we introduce the terms “implicant”, “prime
implicant”, and “essential prime implicant.”
By Hailay B. (M.Sc), AdU, CET, ECE October 2016
53
3.7 Simplification of Boolean Functions (Cont’d)
 A product term is an implicant of a function if the
function has the value 1 for all minterms of the
product term
 All rectangles on a map made up of squares
containing 1s correspond to implicants.
 If the removal of any literal from an implicant P
results in a product term that is not an implicant
of the function, then P is a prime implicant.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


54
3.7 Simplification of Boolean Functions (Cont’d)
 If a minterm of a function is included in only one prime
implicant, that prime implicant is said to be essential.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


55
3.7 Simplification of Boolean Functions (Cont’d)
 2 adjacent 1s form a rectangle representing a
prime implicant, provided that they are not within
a rectangle of 4 or more squares containing 1s.
 4 1s form a rectangle representing a prime
implicant if they are not within a rectangle of 8 or
more squares containing 1s, and so on.
 Each essential prime implicant contains at least
one square that is not contained in any other
prime implicant.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


56
3.7 Simplification of Boolean Functions (Cont’d)
 The systematic procedure for finding the
optimized expression
 We first determine all prime implicants.
 The optimized expression is obtained from the
logical sum of all the essential prime implicants
 Plus other prime implicants needed to include
remaining minterms not included in the essential
prime implicants.

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


57
3.7 Simplification of Boolean Functions (Cont’d)
 Example 3.7.6 Simplification using Prime Implicants

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


58
3.7 Simplification of Boolean Functions (Cont’d)
 Example 3.7.7 Simplification Via essential and Nonessential Prime implicants

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


59
3.7 Simplification of Boolean Functions (Cont’d)

 Nonessential Prime Implicants


 Beyond using all essential prime implicants, the following rule
can be applied to include the remaining minterms of the
function in nonessential prime implicants:
 Selection Rule: Minimize the overlap among prime
implicants as much as possible

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


60
3.7 Simplification of Boolean Functions (Cont’d)
 Example 3.7.8 Simplifying a Function using the Selection rule

By Hailay B. (M.Sc), AdU, CET, ECE October 2016


61

You might also like