Download as pdf or txt
Download as pdf or txt
You are on page 1of 134

UNIT-I

COMBINATIONAL LOGIC CIRCUITS


Let’s Discuss
Combinational Logic Circuits:
 Binary Logic, Integrated Circuits

 Boolean Functions, Canonical And Standard Forms

 The Map Method Two, Three, Four -Variable Maps, Map Manipulation

 Essential Prime Implicants

 Product-Of-Sums Optimization,

 Don’t-Care Conditions

 minimal sum and minimal product.

 The Tabulation Method------ Determination Of Prime Implicants.


Overview
• Binary logic and Gates
• Boolean Algebra
• Basic Properties
• Algebraic Manipulation
• Standard and Canonical Forms
• Minterms and Maxterms (Canonical forms)
• SOP and POS (Standard forms)
Lets work on….

2020/9/26
BASICS…

2020/9/26 Boolean Algebra PJF - 5


Digital System
• Takes a set of discrete information as inputs and discrete
internal information (system state) and generates a set of
discrete information outputs.

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

Inputs: Count Up, Reset


Outputs: Visual Display
State: "Value" of stored digits

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)

Example: F(a,b) = a’•b + b’


G(x,y,z) = x•(y+z’)
Basic Logic Operators
• AND
Binary
• OR
• NOT Unary

• F(a,b) = a•b, F is 1 if and only if a=b=1


• G(a,b) = a+b, G is 1 if either a=1 or b=1
• H(a) = a’, H is 1 if a=0
Basic Logic Operators (cont.)
• 1-bit logic AND resembles binary multiplication:
0 • 0 = 0, 0 • 1 = 0,
1 • 0 = 0, 1•1 =1
• 1-bit logic OR resembles binary addition, except for
one operation:
0 + 0 = 0, 0 + 1 = 1,
1 + 0 = 1, 1 + 1 = 1 (≠ 102)
Truth Tables for logic operators
Truth table: tabular form that represents the relationship
between the input variables of a function and its output

2-Input AND 2-Input OR


A B F=A•B A B F=A+B
0 0 0 0 0 0 NOT
0 1 0 0 1 1 A F=A’
1 0 0 1 0 1 0 1
1 1 1 1 1 1 1 0
Truth Tables (cont.)
• Q: Let a function F() depend on n variables. How
many rows are there in the truth table of F() ?

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)

Note : there are m functions for the given problem.


Construct a truth table for the
following:
1. F(a,b)=a.b+a’b’
2. F(A,B,C)= (a+b+c).(a’+b+c’).(a+b’+c’)
3. Write a truth table for the logic ckt which adds
three single digits and gives sum and carry as the
out put.
4. Represent the the no of days in a month for a non
leap year by truth table,indicate invalid inputs if
any by 0.
5. Write the truth table for four input system
indicating majority of its inputs are true.
2020/9/26
Truth table construction…
A B AB A’B’ F a b c sum carry
0 0 0 1 1 0 0 0 0 0
0 1 0 0 0 0 0 1 1 0
1 0 0 0 0 0 1 0 1 0
1 1 1 0 1
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1

1 1 1 1 1

2020/9/26
leap year -- truth table…

2020/9/26 Boolean Algebra


majority of inputs are true.---

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’

2020/9/26 Boolean Algebra PJF - 25


Boolean expressions-NOT unique
• Unlike truth tables, expressions x y z F G
representing a Boolean function are NOT 0 0 0 1 1
unique.
• Example: 0 0 1 0 0
• F(x,y,z) = x’•y’•z’ + x’•y•z’ + x•y•z’ 0 1 0 1 1
• G(x,y,z) = x’•y’•z’ + y•z’
0 1 1 0 0
• The corresponding truth tables for F() and
G() are to the right. They are identical. 1 0 0 0 0
• Thus, F() = G() 1 0 1 0 0
1 1 0 1 1
1 1 1 0 0
Logic Gates
• Logic gates are abstractions of electronic circuit
components that operate on one or more input
signals to produce an output signal.

2-Input AND 2-Input OR NOT (Inverter)

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.

• Cannot exchange x with x’

• 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:

1. X+0=X 2. X•1 =X (dual of 1)


3. X+1 =1 4. X•0 =0 (dual of 3)
5. X+X=X 6. X • X = X (dual of 5)
7. X + X’ = 1 8. X • X’ = 0 (dual of 7)
More Boolean Algebra Properties
Let X,Y, and Z: boolean variables
10. X + Y = Y + X
11. X • Y = Y • X -- Commutative

12. X + (Y+Z) = (X+Y) + Z


13. X•(Y•Z) = (X•Y)•Z -- Associative

14. X•(Y+Z) = X•Y + X•Z


15. X+(Y•Z) = (X+Y) • (X+Z) -- Distributive

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

• Truth tables for F and G are identical 1 0 1 0 0


 same function 1 1 0 1 1
• Use G to implement the logic circuit 1 1 1 0 0
(less components)
Algebraic Manipulation
• Boolean algebra is a useful tool for simplifying
digital circuits.
• Why do it? Simpler can mean cheaper, smaller,
faster.
• Example: Simplify F = x’yz + x’yz’ + xz.
F = x’yz + x’yz’ + xz

= 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

• Note: The complement of a function can also be


derived by finding the function’s dual, and then
complementing all of the literals
Canonical and Standard Forms
• We need to consider formal techniques for the
simplification of Boolean functions.
• Identical functions will have exactly the same canonical form.

• Minterms and Maxterms

• Sum-of-Minterms and Product-of- Maxterms

• Product and Sum terms

• Sum-of-Products (SOP) and Product-of-Sums (POS)


Definitions
• Literal: A variable or its complement

• Product term: literals connected by •

• Sum term: literals connected by +

• Minterm: a product term in which all the variables appear


exactly once, either complemented or uncomplemented

• Maxterm: a sum term in which all the variables appear


exactly once, either complemented or uncomplemented
Minterm
• Represents exactly one combination in the truth table.
• Denoted by mj, where j is the decimal equivalent of the
minterm’s corresponding binary combination (bj).
• A variable in mj is complemented if its value in bj is 0,
otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C), and j=3. Then,
bj = 011 and its corresponding minterm is denoted by m3 = A’BC
similarly, m6 is 110----ABC’
m9 is 1001----AB’C’D
m15 is 1111----ABCD
Maxterm
• Represents exactly one combination in the truth table.

• Denoted by Mj, where j is the decimal equivalent of the


maxterm’s corresponding binary combination (bj).

• A variable in Mj is complemented if its value in bj is 1,


otherwise is uncomplemented.
• Example: Assume 3 variables (A,B,C), and j=3. Then, bj = 011 and
its corresponding maxterm is denoted by M3 = A+B’+C’.
similarly, M6 is 110----A’+B’+C
M9 is 1001---A’+B+C+D’
M15 is 1111----A’+B’+C’+D’
Truth Table notation for Minterms
and Maxterms
• Minterms and x y z Minterm Maxterm
Maxterms are 0 0 0 x’y’z’ = m0 x+y+z = M0
easy to denote
0 0 1 x’y’z = m1 x+y+z’ = M1
using a truth table.
0 1 0 x’yz’ = m2 x+y’+z = M2
• Example:
0 1 1 x’yz = m3 x+y’+z’= M3
Assume 3
variables x,y,z 1 0 0 xy’z’ = m4 x’+y+z = M4
(order is fixed) 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
Canonical Forms (Unique)
• Any Boolean function F( ) can be expressed as a unique
sum of minterms and a unique product of maxterms
(under a fixed variable ordering).

• In other words, every function F() has two canonical


forms:
• Canonical Sum-Of-Products (sum of minterms)

• Canonical Product-Of-Sums (product of maxterms)


Canonical Forms (cont.)
• Canonical Sum-Of-Products:
The minterms included are those mj such that F( ) = 1
in row j of the truth table for F( ).

• 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’).

• Observe that: mj = Mj’


Shorthand: ∑ and ∏
• f1(a,b,c) = ∑ m(1,2,4,6), where ∑ indicates that this is a
sum-of-products form, and m(1,2,4,6) indicates that
the minterms to be included are m1, m2, m4, and m6.

• f1(a,b,c) = ∏ M(0,3,5,7), where ∏ indicates that this is a


product-of-sums form, and M(0,3,5,7) indicates that
the maxterms to be included are M0, M3, M5, and M7.

• Since mj = Mj’ for any j,


∑ m(1,2,4,6) = ∏ M(0,3,5,7) = f1(a,b,c)
Conversion Between Canonical Forms
• Replace ∑ with ∏ (or vice versa) and replace those j’s that
appeared in the original form with those that do not.

• 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

• Remove duplicate minterms

• f1(a,b,c) = a’b’c + bc’ + ac’


= a’b’c + (a+a’)bc’ + a(b+b’)c’
= a’b’c + abc’ + a’bc’ + abc’ + ab’c’
= a’b’c + abc’ + a’bc + ab’c’
Conversion of POS from standard
to canonical form
• Expand non canonical terms by adding 0 in terms of
missing variables (e.g., xx’ = 0) and using the distributive
law
• Remove duplicate maxterms

• 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

• NAND and NOR Gates


• NAND and NOR circuits

• Two-level Implementations

• Multilevel Implementations
More Logic Gates
• We can construct any combinational circuit with AND,
OR, and NOT gates

• Additional logic gates are used for practical reasons


BUFFER, NAND and NOR
NAND Gate
• Known as a “universal” gate because ANY digital
circuit can be implemented with NAND gates alone.
• To prove the above, it suffices to show that AND, OR,
and NOT can be implemented using NAND gates only.
NAND Gate Emulation
F = (X•X)’ X F = X’
X
= X’+X’
= X’

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

(a) Original SOP


(b) Double inversion and grouping AND-NOT
(c) Replacement with NANDs

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

(b) G = ( (WXY)’ • (YZ)’ )’


= (WXY)’’ + (YZ)’’ = WXY + YZ
Two-Level NAND Gate Implementation
- Example
F (X,Y,Z) = m(0,6)
1. Express F in SOP form:
F = X’Y’Z’ + XYZ’
2. Obtain the AND-OR implementation for F.
3. Add bubbles and inverters to transform AND-OR to
NAND-NAND gates.
Example (cont.)

Two-level implementation with NANDs


F = X’Y’Z’ + XYZ’
Multilevel NAND Circuits
Starting from a multilevel circuit:
1. Convert all AND gates to NAND gates with AND-NOT
graphic symbols.
2. Convert all OR gates to NAND gates with NOT-OR
graphic symbols.
3. Check all the bubbles in the diagram. For every
bubble that is not counteracted by another bubble
along the same line, insert a NOT gate or
complement the input literal from its original
appearance.
Example
Use NAND gates
and NOT gates to implement
Z=E’F(AB+C’+D’)+GH
AB
AB+C’+D’
E’F(AB+C’+D’)
E’F(AB+C’+D’)+GH

Boolean Algebra PJF - 67


Yet Another Example!
NOR Gate
• Also a “universal” gate because ANY digital circuit can
be implemented with NOR gates alone.
• This can be similarly proven as with the NAND gate.
NOR Circuits
• To easily derive a NOR implementation of a boolean
function:
• Find a simplified POS
• POS is an OR-AND circuit
• Change OR-AND circuit to a NOR circuit
• Use the alternative symbols below
Two-Level NOR Gate Implementation -
Example
F(X,Y,Z) = m(0,6)
1. Express F’ in SOP form:
1. F’ = m(1,2,3,4,5,7)
= X’Y’Z + X’YZ’ + X’YZ + XY’Z’ + XY’Z + XYZ
2. F’ = XY’ + X’Y + Z
2. Take the complement of F’ to get F in the POS form:
F = (F’)' = (X'+Y)(X+Y')Z'
3. Obtain the OR-AND implementation for F.
4. Add bubbles and inverters to transform OR-AND
implementation to NOR-NOR implementation.
Example (cont.)

Two-level implementation with NORs


F = (F’)' = (X'+Y)(X+Y')Z'
XOR and XNOR
X Y F = XY
XOR: “not-equal” gate 0 0 0
0 1 1
X F 1 0 1
Y 1 1 0

X Y F = XY
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:
• X0=X
• X  1 = X’
• XX=0
• X  X’ = 1
• Properties:
• XY=YX
• (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

• A´BC´ + A´BC + ABC´ + ABC


• A´B (C´ + C) + AB (C´ + C)
• A´B + AB
• (A´ + A) B
•B

C+C’ means C OR (NOT C)


In other words, we don’t care about C
77
Simplifying made easy
• Simplifying Boolean expressions is not always easy.
• So we introduce next a method (a Karnaugh or K
map) that is supposed to make simplification more
visual.
• The first step is to rearrange the inputs into what is
called “Gray code” order.
• Here, Gray is a color.

PHY 201 (Blum) 78


Karnaugh-map
• This way of arranging truth tables combined with
the rules for simplifying Boolean expressions goes
by the name Karnaugh map or K map.
• Named for Maurice Karnaugh.

PHY 201 (Blum) 79


What is K-Map
• It’s similar to truth table; instead of being organized
(i/p and o/p) into columns and rows, the K-map is an
array of cells in which each cell represents a binary
value of the input variables.
• The cells are arranged in a way so that simplification
of a given expression is simply a matter of properly
grouping the cells.
• K-maps can be used for expressions with 2, 3, 4, and 5
variables.
• 3 and 4 variables will be discussed to illustrate the
principles.
Maurice Karnaugh

PHY 201 (Blum) 81


Introduction
• In 1953, Maurice Karnaugh was a
telecommunications engineer at Bell Labs.
• While exploring the new field of digital logic and its
application to the design of telephone circuits, he
invented a graphical way of visualizing and then
simplifying Boolean expressions.
• This graphical representation, now known as a
Karnaugh map, or Kmap, is named in his honor.

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

• A Kmap has a cell for each


minterm.
• This means that it has a cell for
each line for the truth table of a
function.
• The truth table for the function
F(x,y) = xy is shown at the right
along with its corresponding
Kmap.

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.

• In our example, we have two


such groups.
– Can you find them?

88
Two-Variable Map (cont.)

• Any two adjacent cells in the map differ by ONLY


one variable, which appears complemented in one
cell and uncomplemented in the other.

• 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

NOTE: ordering of variables is IMPORTANT


for f(x1,x2), x1 is the row, x2 is the column.
Cell 0 represents x1’x2’; Cell 1 represents
x1’x2; etc. If a minterm is present in the
function, then a 1 is placed in the
corresponding cell.
2-Variable Map -- Example
• f(x1,x2) = x1’x2’+ x1’x2 + x1x2’
= m 0 + m1 + m2
= x 1 ’ + x 2’
x2
• 1s placed in K-map for specified
minterms m0, m1, m2 x1 0 1
• Grouping (ORing) of 1s allows 0 1
simplification
• What (simpler) function is represented 0 1 1
by each dashed rectangle? 2 3
• x 1’ = m 0 + m 1
• x 2’ = m 0 + m 2 1 1 0
• Note m0 covered twice
Three-Variable Map
yz
x 00 01 11 10
0 1 3 2
0 m0 m1 m3 m2
4 5 7 6

1 m4 m5 m7 m6

-Note: variable ordering is (x,y,z); yz specifies


column, x specifies row.
-Each cell is adjacent to three other cells (left or
right or top or bottom or edge wrap)
Four-Variable Maps
YZ

WX 00 01 11 10

00 m0 m1 m3 m2

01 m4 m5 m7 m6

11 m12 m13 m15 m14

10 m8 m9 m11 m10

• Top cells are adjacent to bottom cells. Left-edge cells


are adjacent to right-edge cells.
• Note variable ordering (WXYZ).
K-MAP CONSTRUCTION
& SIMPLIFICATION

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.

• If Boolean equation simplification is for SUM-of-PRODUCTS


form then select the minterms with output value as 1 and mark
it in the respective square of the K-MAP.

• If Boolean equation simplification is for PRODUCT-of-SUM form


then select the maxterms with output value as 0 and mark it in
the respective square of the K-MAP.

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

• Numerical Expansion of a Nonstandard product term


• Assume that one of the product terms in a certain 3-variable
SOP expression is A. B

• It can be expanded numerically to standard form as follows:


• Step 1: Write the binary value of the two variables and attach a 0 for
the missing variable : 100.
C
• Step 2: Write the binary value of the two variables and attach a 1 for
the missing variable : 101. C
• The two resulting binary numbers are the values of the
standard SOP terms  AB C and AB C.
If the assumption that one of the product term in a 3-
variable expression is B. How can we do this?
•2
F=B • So 4 new combinations…
How many terms are • 0 B 0-
missing? • 0B1

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

Simplification is done by grouping


adjacent cells in the K-MAP

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 Boolean Algebra PJF - 113


LET’S GROUP AND SIMPLIFY

2020/9/26
LET’S GROUP AND SIMPLIFY

2020/9/26
Grouping

For a 3-variable map: For a 4-variable map:

A 1-cell group yields a A 1-cell group yields a


3-variable product term 4-variable product term

A 2-cell group yields a A 2-cell group yields a


2-variable product term 3-variable product term

A 4-cell group yields a A 4-cell group yields a


1-variable product term 2-variable product term

An 8-cell group yields a An 8-cell group yields a


value of 1 for the 1-variable product term
expression.
A 16-cell group yields a value
of 1 for the expression.
Four-variable Map Simplification
• One square represents a minterm of 4 literals.
• A rectangle of 2 adjacent squares represents a
product term of 3 literals.
• A rectangle of 4 squares represents a product term of
2 literals.
• A rectangle of 8 squares represents a product term of
1 literal.
• A rectangle of 16 squares produces a function that is
equal to logic 1.
Determining the Minimum SOP
Expression from the Map (example)

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 Boolean Algebra PJF - 121


K-Map POS Minimization
• The approaches are much the same (as SOP) except

that with POS expression, 0s


representing the standard sum terms
are placed on the K-map instead of 1s.
• Note: In Maxterm notation for a variable x 0- x--normal
1- x’--complement
K-map for POS Simplification

2020/9/26
Mapping a Standard POS Expression (full
example)
The expression:
( A  B  C )( A  B  C )( A  B  C )( A  B  C )

000 010 110 101


K-map Simplification of POS Expression
( A  B  C )( A  B  C )( A  B  C )( A  B  C )( A  B  C )
Four-Variable K-Maps Examples
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
“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

• Treat don't cares as if they are 1s to generate PIs.


• Delete PI's that cover only don't care minterms.
• Treat the covering of remaining don't care
minterms as optional in the selection process (i.e.
they may be, but need not be, covered).
“Don’t Care” Conditions
INPUTS O/P CD
A B C D Y 00 01 11 10
0 0 0 0 0 AB
0 0 0 1 0
0 0 1 0 0 00
0
0
0
1
1
0
1
0
0
0
01 1
0
0
1
1
0
1
1
0
0
0
11 x x x x
0
1
1
0
1
0
1
0
1
1
10 1 1 x x
1 0 0 1 1
Without “don’t care”
1 0 1 0 X
Y  AB C  A BCD
1 0 1 1 X
1 1 0 0 X
1 1 0 1 X With “don’t care”
1 1 1 0 X
Y  A  BCD
1 1 1 1 X
cd
ab 00 01 11 10
Example 00 0 1 0 1
01 1 1 0 1
• Simplify the function f(a,b,c,d) 11 0 0 x x
whose K-map is shown at the right. 10 1 1 x x
• f = a’c’d+ab’+cd’+a’bc’
0 1 0 1
or 1 1 0 1
• f = a’c’d+ab’+cd’+a’bd’ 0 0 x x
1 1 x x

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

You might also like