Chapter 12
Chapter 12
Chapter 12
Chapter 12
Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Chapter Summary Claude Shannon
Boolean Functions (1916 - 2001)
Representing Boolean Functions
Logic Gates
Minimization of Circuits
Boolean Functions
Section 12.1
Section Summary
Introduction to Boolean Algebra
Boolean Expressions and Boolean Functions
Identities of Boolean Algebra
The Abstract Definition of a Boolean Algebra
Introduction to Boolean Algebra
Boolean algebra has rules for working with elements from the
set {0, 1} together with the operators + (Boolean sum),
(Boolean product), and .
These operators are defined by:
Boolean sum: 1 + 1 = 1, 1 + 0 = 1, 0 + 1 = 1, 0 + 0 = 0
Boolean product: 1 1 = 1, 1 0 = 0, 0 1 = 0, 0 0 = 0
complement: = 1, = 0
Example: Find the value of 1 0 +
Solution : 1 0 + = 0 +
=0+0
=0
Boolean Complement
The complement of a variable p is denoted by and has
this truth table:
p
1 0
0 1
6
Boolean Product
The Boolean product of variables p and q is denoted
by p . q and has this truth table:
p q p.q
0 1 1
0 0 0
1 1 0
1 0 0
7
Boolean Sum
The sum of variables p and q is denoted by p +q and
has this truth table:
p q p +q
1 1 1
1 0 1
0 1 1
0 0 0
8
Truth Tables
Construction of a truth table:
Rows
Need a row for every possible combination of values for
the atomic variables.
Columns
Need a column for the compound statement (usually at
far right)
Need a column for the truth value of each expression
that occurs in the compound statement as it is built up.
This includes the atomic variables
9
Example Truth Table
Construct a truth table for (x + y ) .
x y z x+y (x + y ) .
1 1 1 1 0 0
1 1 0 1 1 1
1 0 1 1 0 0
1 0 0 1 1 1
0 1 1 1 0 0
0 1 0 1 1 1
0 0 1 0 0 0
0 0 0 0 1 0
10
Problem
How many rows are there in a truth table with n
variables?
Solution: 2n.
11
the rules of precedence
first, all complements are computed,
followed by all Boolean products,
followed by all Boolean sums.
Example:
Find the value of 1.0 +
1.0 + = 0 +
=0+0
=0
Boolean Expressions and Boolean Functions
Definition: Let B = {0, 1}. Then Bn = {(x1, x2, …, xn) | xi ∈ B
for 1 ≤ i ≤ n } is the set of all possible n-tuples of 0s and 1s.
The variable x is called a Boolean variable if it assumes values
only from B, that is, if its only possible values are 0 and 1. A
function from Bn to B is called a Boolean function of degree n.
Example: The function F(x, y) = x from the set of ordered
pairs of Boolean variables to the set {0, 1} is a Boolean
function of degree 2.
Boolean Expressions and Boolean Functions
(continued)
Example: Find the values of the Boolean function
represented by F(x, y, z) = xy +
Solution: We use a table with a row for each
combination of values of x, y, and z to compute the
values of F(x,y,z)
Boolean Expressions and Boolean Functions
(continued)
Definition: Boolean functions F and G of n variables are equal
if and only if F(b1, b2, …, bn)= G(b1, b2, …, bn) whenever b1, b2, …,
bn belong to B. Two different Boolean expressions that
represent the same function are equivalent.
Definition: The complement of the Boolean function F is the
function (x1, x2, …, xn) = .
Definition: Let F and G be Boolean functions of degree n. The
Boolean sum F + G and the Boolean product FG are defined by
(F + G)(x1, x2, …, xn) = (x1, x2, …, xn) + G(x1, x2, …, xn)
(FG)(x1, x2, …, xn) = (x1, x2, …, xn)G(x1, x2, …, xn)
Boolean Functions
Example: How many different Boolean functions of
degree n are there?
The example tells us that there are 16 different Boolean functions of degree two.
We display these in Table 3.
Equivalence of Boolean expressions
Two Boolean expressions e1 and e2 that represent
the exact same function are called equivalent.
Notation: e1 e2, or just e1 = e2.
Equivalence Example
Show that = .
To do this we represent the truth table for the two
expressions
x y x+y .
1 1 0 0 1 0 0
1 0 0 1 1 0 0
0 1 1 0 1 0 0
0 0 1 1 0 1 1
You can see that the last two columns are the same (Equivalent)
Identities of Boolean Algebra
Each identity can be proved using a
table.
This truth table shows that De Morgan’s First Law holds. 1806-1871
x y x.y +
1 1 0 0 1 0 0
1 0 0 1 0 1 1
0 1 1 0 0 1 1
0 0 1 1 0 1 1
21
Representing Boolean
Functions
Section 12.2
Section Summary
Sum-of-Products Expansions
Functional Completeness
Minterm
A minterm of Boolean variables x1,…,xn is a
Boolean product of n literals y1…yn, where yi is
either the literal, xi , or its complement, xi .
Sum-of-Products Expansions
Theorem: Any Boolean function can be represented
as a sum-of-products (SOP) of variables and their
complements
40
Logic Gates symbols
AND gate
Corresponds to the logical conjunction, or Boolean product
41
Logic Gates symbols
OR gate
Corresponds to the logical disjunction, or Boolean sum
42
Logic Gates symbols
XOR gate
Corresponds to the logical exclusive disjunction, or sum
mod 2
43
Logic Gates symbols
NAND gate
AND gate which output is complemented
44
Logic Gates symbols
NOR gate
OR gate which output is complemented
45
Logic Gates symbols
XNOR gate
XOR gate which output is complemented
46
Combinations of Gates
Combinatorial circuits can be constructed using a
combination of inverters, OR gates, and AND gates.
Gates may share input and the output of one or more
gates may be input to another.
We show two ways of
constructing a circuit
that produces the
output xy + y.
Combinations of Gates
Example: Construct
circuits that produce
these outputs
(a) (x + y)
(b)
(c) (x + y +z)()
Minimization of Circuits
Section 12.4
Goals of Circuit Minimization
(1) Minimize the number of primitive Boolean logic
gates needed to implement the circuit.
Ultimately, this also roughly minimizes the number of
transistors, the chip area, and the cost.
Also roughly minimizes the energy expenditure.
This will be our focus.
(2) It is also often useful to minimize the number of
combinational stages or logical depth of the circuit.
This roughly minimizes the delay or latency through the
circuit, the time between input and output.
Minimizing Circuits
Karnaugh Maps
Gray code
Code that modifies only
one bit per line
Patented by Frank Gray in x y
1953 (submitted in 1947) 0 0
The code was known 0 1 Mirror
before 1 1
1 0
Gray code
x y z
0 0 0
0 0 1
0 1 1
0 1 0 Mirror
1 1 0
1 1 1
1 0 1
1 0 0
K-map for 2 variables
x\y 0 1
0 f(0, 0) f(0,1)
1 f(1, 0) f(1,1)
K-map for 2 variables
Example
x y f
x\y 0 1
0 0 1
0 1 0
0 1 0
1 1 1
1 1 1
1 0 1 K-Map
Truth table
K-map for 3 variables
x\yz 00 01 11 10
0 f(0,0,0) f(0,0,1) f(0,1,1) f(0,1,0)
x y z f
0 0 0 1
x\yz 00 01 11 10
0 0 1 1
0 1 1 1 1
0 1 1 1
0 1 0 1 1 0 0 1 0
1 1 0 0
1 1 1 1 K-Map
1 0 1 0
1 0 0 0
Truth table
Expression of f
Using truth table
x y z f
0 0 0 1 ++
0 0 1 1 +
0 1 1 1
0 1 0 1
1 1 0 0
x\yz 00 01 11 10
1 1 1 1
0 1 1 1 1
1 0 1 0
1 0 0 0 1 0 0 1 0
Truth table
Expression of f
Simplification using K-Map
x\yz 00 01 11 10
Find rectangles of adjacent
0 1 1 1 1
1
1 0 0 1 0 Sideof the rectangle should
be a power of 2
Expression of f
Simplification using K-Map
x\yz 00 01 11 10
Theborder of the map are
0 1 0 0 1 adjacent
1 1 0 0 1
Example
K-map for 4 variables
Example
F(w,x,y,z) = + + w x +
wx\yz 00 01 11 10
00 1
01 1 1
11 1 K-Map
10 1
Examples
Is this correct?
Examples