Unit 1 PDF
Unit 1 PDF
Unit 1 PDF
The Map Method Two, Three, Four -Variable Maps, Map Manipulation
Product-Of-Sums Optimization,
Don’t-Care Conditions
2020/9/26
BASICS…
Discrete Discrete
Inputs Information
Processing Discrete
System Outputs
System State
Types of Digital Systems
• No system state present
• Combinational Logic System
• Output = Function(Input)
• Y=F(X)
• system state present
• Sequential logic system
• State updated at discrete times
=> Synchronous Sequential System
• State updated at any time
=>Asynchronous Sequential System
• State = Function (State, Input)
• Output = Function (State) Y=F(S,X)
or Function (State, Input)
Digital System Example:
A Digital Counter (e. g., odometer):
Count Up
Reset 0 0 1 3 5 6 4
Synchronous or Asynchronous?
A Digital Computer Example
Memory
Control
CPU unit Datapath
Inputs:
Outputs: CRT,
Keyboard,
LCD, modem,
mouse, modem, Input/Output speakers
microphone
Signal
• An information variable represented by physical quantity.
• For digital systems, the variable takes on discrete values.
• Two level, or binary values are the most prevalent values
in digital systems.
• Binary values are represented abstractly by:
• digits 0 and 1
• words (symbols) False (F) and True (T)
• words (symbols) Low (L) and High (H)
• and words On and Off.
• Binary values are represented by values or ranges of
values of physical quantities
Signal Examples Over Time
Time
Continuous
in value &
Analog
time
Digital Discrete in
value &
Asynchronous continuous
in time
Synchronous Discrete in
value & time
Binary Logic
• Deals with binary variables that take 2 discrete
values (0 and 1), and with logic operations
• Three basic logic operations:
• AND, OR, NOT
• Binary/logic variables are typically represented as
letters: A,B,C,…,X,Y,Z
Binary Logic Function
F(vars) = expression
Operators ( +, •, ‘ )
Variables
set of binary
Constants ( 0, 1 )
variables
Groupings (parenthesis)
n n
A: 2 rows, since there are 2 possible
binary patterns/combinations for the n
variables
Lets Construct Some Truth Tables….
STEPS:
1.Read the given problem and find out
a.no of input variables ------n
b.no of output variables------m
c. the logical relation between i/p and o/p
2.Now construct the truth table with
n
a. N= 2 Rows
b. M= n+m Columns
c. F =logical relation (n,m)
1 1 1 1 1
2020/9/26
leap year -- truth table…
2020/9/26
Truth Tables (revisited)
• Enumerates all possible x y z F1 F2 F3
combinations of variable values 0 0 0 0 1 1
and the corresponding function
0 0 1 0 0 1
value
• Truth tables for some arbitrary 0 1 0 0 0 1
functions 0 1 1 0 1 1
F1(x,y,z), F2(x,y,z), and F3(x,y,z) are 1 0 0 0 1 0
shown to the right.
1 0 1 0 1 0
1 1 0 0 0 0
1 1 1 1 0 1
Truth Tables (cont.)
• Truth table: a unique representation of a Boolean
function
• If two functions have identical truth tables, the
functions are equivalent (and vice-versa).
• Truth tables can be used to prove equality
theorems.
• However, the size of a truth table grows
exponentially with the number of variables
involved, hence unwieldy. This motivates the use of
Boolean Algebra.
Construct A Truth Table
• Example:
• F(x,y,z) = x’•y’•z’ + x’•y•z’ + x•y•z’
• G(x,y,z) = x’•y’•z’ + y•z’
A A
F G A H
B B
F = A•B G = A+B H = A’
Boolean Algebra
• Very nice machinery used to manipulate (simplify)
Boolean functions
• George Boole (1815-1864): “An investigation of the
laws of thought”
• Terminology:
• Literal: A variable or its complement
• Product term: literals connected by •
• Sum term: literals connected by +
Boolean Algebra Properties
Let X: boolean variable, 0,1: constants
1. X + 0 = X -- Zero Axiom
2. X • 1 = X -- Unit Axiom
3. X + 1 = 1 -- Unit Property
4. X • 0 = 0 -- Zero Property
Boolean Algebra Properties (cont.)
Let X: boolean variable, 0,1: constants
5. X + X = X -- Idepotence
6. X • X = X -- Idepotence
7. X + X’ = 1 -- Complement
8. X • X’ = 0 -- Complement
9. (X’)’ = X -- Involution
Duality
• The dual of an expression is obtained by exchanging
(• and +), and (1 and 0) in it, provided that the
precedence of operations is not changed.
• Example:
• Find H(x,y,z), the dual of F(x,y,z) = x’yz’ + x’y’z
• H = (x’+y+z’) (x’+y’+ z)
Duality (cont’d)
With respect to duality, Identities 1 – 8 have
the following relationship:
16. (X + Y)’ = X’ • Y’
17. (X • Y)’ = X’ + Y’ -- DeMorgan’s
In general,
( X1 + X2 + … + Xn )’ = X1’•X2’ • … •Xn’,
and
( X1•X2•… •Xn )’ = X1’ + X2’ + … + Xn’
Combinational Logic Circuit from Logic Function
(cont.)
• In order to design a cost-effective and
A B C F G
efficient circuit, we must minimize the
circuit’s size (area) and propagation 0 0 0 1 1
delay (time required for an input 0 0 1 1 1
signal change to be observed at the
0 1 0 1 1
output line)
0 1 1 1 1
• Observe the truth table of F=A’ + B•C’
+ A’•B’ and G=A’ + B•C’ 1 0 0 0 0
= x’y(z+z’) + xz
= x’y•1 + xz
= x’y + xz
Algebraic Manipulation (cont.)
• Example: Prove
x’y’z’ + x’yz’ + xyz’ = x’z’ + yz’
• Proof:
x’y’z’+ x’yz’+ xyz’
= x’y’z’ + x’yz’ + x’yz’ + xyz’
= x’z’(y’+y) + yz’(x’+x)
= x’z’•1 + yz’•1
= x’z’ + yz’.
Complement of a Function
• The complement of a function is derived by
interchanging (• and +), and (1 and 0), and
complementing each variable.
• Otherwise, interchange 1s to 0s in the truth table
column showing F.
• The complement of a function IS NOT THE SAME as
the dual of a function.
Complementation: Example
• Find G(x,y,z), the complement of
F(x,y,z) = xy’z’ + x’yz
• G = F’ = (xy’z’ + x’yz)’
= (xy’z’)’ • (x’yz)’ DeMorgan
= (x’+y+z) • (x+y’+z’) DeMorgan again
• Canonical Product-Of-Sums:
The maxterms included are those Mj such that F( ) = 0
in row j of the truth table for F( ).
Example a b c f1
0 0 0 0
• Truth table for f1(a,b,c) at right
0 0 1 1
• The canonical sum-of-products form for f1 is 0 1 0 1
f1(a,b,c) = m1 + m2 + m4 + m6 0 1 1 0
= a’b’c + a’bc’ + ab’c’ + abc’ 1 0 0 1
1 0 1 0
• The canonical product-of-sums form for f1 is
1 1 0 1
f1(a,b,c) = M0 • M3 • M5 • M7
1 1 1 0
= (a+b+c)•(a+b’+c’)•
(a’+b+c’)•(a’+b’+c’).
• Example:
f1(a,b,c) = a’b’c + a’bc’ + ab’c’ + abc’
= m1 + m2 + m4 + m6
= ∑(1,2,4,6)
= ∏(0,3,5,7)
= (a+b+c)•(a+b’+c’)•(a’+b+c’)•(a’+b’+c’)
Standard Forms (NOT Unique)
• Standard forms are “like” canonical forms, except that
not all variables need appear in the individual product
(SOP) or sum (POS) terms.
• Example:
f1(a,b,c) = a’b’c + bc’ + ac’
is a standard sum-of-products form
• f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
is a standard product-of-sums form.
Conversion of SOP from standard to
canonical form
• Expand non-canonical terms by inserting equivalent of 1
in each missing variable x:
(x + x’) = 1
• f1(a,b,c) = (a+b+c)•(b’+c’)•(a’+c’)
= (a+b+c)•(aa’+b’+c’)•(a’+bb’+c’)
= (a+b+c)•(a+b’+c’)•(a’+b’+c’)•
(a’+b+c’)•(a’+b’+c’)
= (a+b+c)•(a+b’+c’)•(a’+b’+c’)•(a’+b+c’)
Combinational Logic Circuit from Logic Function
• Consider function F = A’ + B•C’ + A’•B’
• A combinational logic circuit can be constructed to implement F, by
appropriately connecting input signals and logic gates:
• Circuit input signals from function variables (A, B, C)
• Circuit output signal function output (F)
• Logic gates from logic operations
A F
B
Timing Diagram
t0 t1 t2 t3 t4 t5 t6
1
Input A 0
1 Transitions
signals B 0
1
F=A•B 0 Basic
Gate
Assumption:
Output G=A+B 1
0 Zero time for
Signals
1 signals to
H=A’ 0 propagate
Through gates
Combinational Logic Circuit from Logic
Function (cont.)
C
A F
C
B
A G
More Logic Gates
• Two-level Implementations
• Multilevel Implementations
More Logic Gates
• We can construct any combinational circuit with AND,
OR, and NOT gates
X X F X•Y
F = ((X•Y)’)’
Y Y
= (X’+Y’)’
= X’’•Y’’
= X•Y
X X
F = (X’•Y’)’ F = X+Y
= X’’+Y’’
Y Y
= X+Y
NAND Circuits
• To easily derive a NAND implementation of a
boolean function:
• Find a simplified SOP
• SOP is an AND-OR circuit
• Change AND-OR circuit to a NAND circuit
• Use the alternative symbols below
SOP with NAND
NOT-OR
AND-OR (SOP) Emulation
Using NANDs
Two-level implementations
a) Original SOP
b) Implementation with NANDs
AND-OR (SOP) Emulation
Using NANDs (cont.)
Verify:
(a) G = WXY + YZ
X Y F = XY
XNOR: “equal” gate 0 0 1
0 1 0
X F
1 0 0
Y 1 1 1
Exclusive-OR (XOR) Function
• XOR (also ) : the “not-equal” function
• XOR(X,Y) = X Y = X’Y + XY’
• Identities:
• X0=X
• X 1 = X’
• XX=0
• X X’ = 1
• Properties:
• XY=YX
• (X Y) W = X ( Y W)
XOR function implementation
• XOR(a,b) = ab’ + a’b
• Straightforward: 5 gates
• 2 inverters, two 2-input ANDs, one 2-input OR
• 2 inverters & 3 2-input NANDs
• Nonstraightforward:
• 4 NAND gates
XOR circuit with 4 NANDs
Simplifying a trivial example
82
Description of Kmaps and
Terminology
• A Kmap is a matrix consisting of rows and
columns that represent the output values of a
Boolean function.
• The output values placed in each cell are derived
from the minterms of a Boolean function.
• A minterm is a product term that contains all of the
function’s variables exactly once, either
complemented or not complemented.
83
Description of Kmaps
and Terminology
• For example, the minterms for a function having
the inputs x and y are:
• Consider the Boolean function,
• Its minterms are:
84
Description of Kmaps and
Terminology
• Similarly, a function
having three inputs,
has the minterms
that are shown in this
diagram.
85
Description of Kmaps and Terminology
86
Description of Kmaps and Terminology
• As another example, we
give the truth table and
KMap for the function,
F(x,y) = x + y at the right.
• This function is equivalent
to the OR of all of the
minterms that have a value
of 1. Thus:
87
Kmap Simplification for Two Variables
• Of course, the minterm function that we derived
from our Kmap was not in simplest terms.
• That’s what we started with in this example.
• We can, however, reduce our complicated
expression to its simplest terms by finding adjacent
1s in the Kmap that can be collected into groups
that are powers of two.
88
Two-Variable Map (cont.)
• Example:
m0 (=x1’x2’) is adjacent to m1 (=x1’x2) and m2 (=x1x2’)
but NOT m3 (=x1x2)
Two-Variable Map
x2 x1
x1 0 1 x2 0 1
0 1 0 2
0 m0 m1
OR 0 m0 m2
2 3 1 3
1 m2 m3 1 m1 m3
1 m4 m5 m7 m6
WX 00 01 11 10
00 m0 m1 m3 m2
01 m4 m5 m7 m6
10 m8 m9 m11 m10
2020/9/26
K-MAP CONSTRUCTION & SIMPLIFICATION
• Based on no of input variables ,size of the K-MAP is decided.
• Put the truth table into a form with inputs in Gray code order.
95
K-Map SOP Minimization
• The K-Map is used for simplifying Boolean expressions
to their minimal form.
• A minimized SOP expression contains the fewest
possible terms with fewest possible variables per
term.
• Generally, a minimum SOP expression can be
implemented with fewer logic gates than a standard
expression.
Mapping a Standard SOP Expression
The expression:
A B C A B C ABC AB C
000 001 110 100
Practice:
A B C A BC ABC ABC
A BC AB C AB C
A B CD A BC D ABC D ABCD ABC D A B C D AB CD
Mapping a Standard SOP Expression
W X Y Z Out
put
0 0 0 0 1
0 0 0 1 0
0 0 1 0 0
0 0 1 1 0
0 1 0 0 1
0 1 0 1 1
0 1 1 0 1
0 1 1 1 0
1 0 0 0 1
1 0 0 1 0
1 0 1 0 0
1 0 1 1 0
1 1 0 0 1
1 1 0 1 1
1 1 1 0 1
98
1 1 1 1 0 Karnaugh Example
Mapping a Nonstandard SOP Expression
F=A’BC’+A’BC+ABC’+ABC • 1B0
• 1B1
2020/9/26
Mapping a Nonstandard SOP Expression
• Map the following SOP expressions on K-maps:
A AB ABC
BC A C
B C AB ABC AB CD A B C D AB CD
A C D ACD A BC D
Simplification
2020/9/26
adjacent cells in the K-MAP
2020/9/26
Grouping Rules for K-MAP (SOP)
1. Groups may not include any cell containing a zero.
2. Groups may be horizontal or vertical, but not
diagonal.
3. Groups must contain 1, 2, 4, 8, or in general 2n cells. ...
4. Each group should be as large as possible.
5. Each cell containing a one must be in at least one
group.
6. Groups may overlap.
7. Groups may wrap around the table.
8. There should be as few groups as possible.
2020/9/26
Grouping Rule--1
Groups may not include any cell containing a zero
2020/9/26
Grouping Rule--2
Groups may be horizontal or vertical, but not diagonal.
2020/9/26
Grouping Rule--3
• Groups must contain 1, 2, 4, 8, or in general 2n cells.
That is if n = 1, a group will contain two 1's since 21 = 2.
If n = 2, a group will contain four 1's since 22 = 4.
2020/9/26
Grouping Rule--4
Each group should be as large as possible.
2020/9/26
Grouping Rule--5
Each cell containing a one must be in at least one group.
2020/9/26
Grouping Rule--6
Groups may overlap.
2020/9/26
Grouping Rule--7
Groups may wrap around the table. The leftmost cell in a row may be
grouped with the rightmost cell and the top cell in a column may be
grouped with the bottom cell.
2020/9/26
Grouping Rule--8
There should be as few groups as possible, as long as
this does not contradict any of the previous rules.
2020/9/26
LET’S GROUP AND SIMPLIFY
F=A’B’
2020/9/26
LET’S GROUP AND SIMPLIFY
2020/9/26
Grouping
CD
00 01 11 10 B A C AC D
AB
00 1 1 AC
01 1 1 1 1 B
11 1 1 1 1
AC D
10 1
Determining the Minimum SOP
Expression from the Map (exercises)
CD CD
AB 00 01 11 10 AB 00 01 11 10
00 1 1 00 1 1
01 1 1 1 1 01 1 1 1
11 11 1 1 1
10 1 1 10 1 1 1
A B A C AB D D AB C BC
Practicing K-Map (SOP)
AB C A BC A B C A B C AB C
B AC
B C D A BC D ABC D A B CD AB CD
A B CD A BC D ABC D AB CD
D BC
4-variable k-map
CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 00 00
01 01 01
11 11 11
10 10 10
CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 00 00
01 01 01
11 11 11
10 10 10
2020/9/26
Mapping a Standard POS Expression (full
example)
The expression:
( A B C )( A B C )( A B C )( A B C )
CD CD CD
AB 00 01 11 10 AB 00 01 11 10 AB 00 01 11 10
00 00 00
01 01 01
11 11 11
10 10 10
2020/9/26
“Don’t Care” Conditions
• Sometimes a situation arises in which some input
variable combinations are not allowed, i.e. BCD
code:
• There are six invalid combinations: 1010, 1011, 1100,
1101, 1110, and 1111.
• Since these unallowed states will never occur in an
application involving the BCD code they can be
treated as “don’t care” terms with respect to their
effect on the output.
• The “don’t care” terms can be used to advantage
on the K-map (how? see the next slide).
Don't Care Conditions
• There may be a combination of input values which
• will never occur
• if they do occur, the output is of no concern.
• The function value for such combinations is called a don't
care.
• They are denoted with x or –. Each x may be arbitrarily
assigned the value 0 or 1 in an implementation.
• Don’t cares can be used to further simplify a function
Minimization using Don’t Cares
0 1 0 1
1 1 0 1
0 0 x x
1 1 x x
cd
Another Example ab
x 1 0 0
1 x 0 x
• Simplify the function g(a,b,c,d) 1 x x 1
whose K-map is shown at right. 0 x x 0
• g = a’c’+ ab
or x 1 0 0
1 x 0 x
• g = a’c’+b’d 1 x x 1
0 x x 0
x 1 0 0
1 x 0 x
1 x x 1
0 x x 0
Q-M Method
2020/9/26