LOGIC SIMPLIFICATION
Dr Noor Mahammad Sk
High Performance Reconfigurable Computing Systems Engineering
Outline
• Standard form of Boolean Expressions
• Sum-of-Products (SOP), Product-of-Sums (POS)
• Canonical form
• Boolean simplification with Boolean Algebra
• Boolean simplification using Karnaugh Maps
• “Don’t cares”
Forms of Boolean Expressions
• Sum-of-products form (SOP)
• first the product (AND) terms are formed then these are summed
(OR)
• eg: ABC + DEF + GHI
• Product-of-sum form (POS)
• first the sum (OR) terms are formed then the products are taken
(AND)
• eg: (A+B+C) (D+E+F) (G+H+I)
• It is possible to convert between these two forms using
Boolean algebra (DeMorgan’s)
Canonical Form
• Canonical form is not efficient but sometimes useful in
analysis and design
• In an expression in canonical form, every variable
appears in every term
• f(A, B,C,D) = ABCD +ABCD +ABCD
Minterm
• An SOP expression can be forced into canonical form by
ANDing the incomplete terms with terms of the form (X +
X) where X is the name of the missing variable
• The product term in a canonical SOP expression is called
a 'minterm'
A Notation using Canonical Form
• Previous example:
• Construct the truth table for this function
• use a 0 when the variable is complemented, 1 otherwise
• f can be written as the sum of row numbers having TRUE
minterms
Simplifying Logic Circuits
• First obtain one expression for the circuit, then try to
simplify.
• Example:
Two methods for simplifying
• Algebraic method (use Boolean algebra theorems)
• Karnaugh mapping method (systematic, step-by-step
approach)
Method 1: Minimization by Boolean
Algebra
• Make use of relationships and theorems to simplify
Boolean Expressions
• perform algebraic manipulation resulting in a complexity reduction
• this method relies on your algebraic skill
• 3 things to try
• Grouping
• Multiplication by redundant variables
• Application of DeMorgan's Theorem
Grouping
Multiplication by redundant variables
• Multiplying by terms of the form (A + A)does not alter the
logic
• Such multiplications by a variable missing from a term
may enable minimization
Application of DeMorgan's Theorem
• Expressions containing several inversions stacked one
upon the other may often by simplified by applying
DeMorgan's Theorem.
• DeMorgan's Theorem "unwraps" the multiple inversion
Example of Logic Design
• Design a logic circuit having 3 inputs, A, B, C will have its
output HIGH only when a majority of the inputs are HIGH
•Step 1: Set up the truth table
•Step 2: Write the AND term for
each case where the output is a 1
Example Contd.,
• Step 3 Write the SOP form the output
• Step 4 Simplify the output expression
Example Contd.,
• Step 5 Implement the circuit
Minimization by Karnaugh Maps
• What is a Karnaugh map?
• 3 Variable Example:
• A grid of squares
• Each square represents one minterm
• The minterms are ordered according to Gray code
• only one variable changes between adjacent squares
• Squares on edges are considered adjacent to squares on opposite
edges
• Karnaugh maps become clumsier to use with more than 4 variables
Karnaugh Maps
• 4 Variable example
• The square marked ? Represents
• The square marked ?? Represents
• Note that they differ in only the C variable
Filling out a Karnaugh Map
• Write the Boolean expression in SOP form
• For each product term, write a 1 in all the squares which
are included in the term, 0 elsewhere
• canonical form: one square
• one term missing: two adjacent squares
• two terms missing: 4 adjacent squares
Minimization Technique
• Minimization is done by spotting patterns of 1's and 0's
• Simple theorems are then used to simplify the
Boolean description of the patterns
• Pairs of adjacent 1's
• remember that adjacent squares differ by only one variable
• hence the combination of 2 adjacent squares has the form
P(A+A)
• this can be simplified (from before) to just P
• Take out previous example
• the adjacent squares ABC and ABC differ only in A
• hence they can be combined into just BC
• normally indicated by grouping the adjacent squares to be
combined
• Adjacent Pairs
• The same idea extends to pairs of pairs
• “Cover” all the 1’s with maximum grouping:
• The simplified Boolean equation is one that sums all the
terms corresponding to each of the group:
More Examples of grouping
More examples
More Examples
More Examples
Complete Simplification Process
• Construct the K map and place 1s and 0s in the squares
according to the truth table
• Group the isolated 1s which are not adjacent to any other
1s. (single loops)
• Group any pair which contains a 1 adjacent to only one
other 1. (double loops)
• Group any octet even if it contains one or more 1s that
have already been grouped.
• Group any quad that contains one or more 1s that have
not already been grouped, making sure to use the
minimum number of groups.
Complete Simplification Process
• Group any pairs necessary to include any 1s that have
not yet been grouped, making sure to use the minimum
number of groups
• Form the OR sum of all the terms generated by each
group
More Example
Don’t Care Conditions
• In certain cases some of the minterms may never occur or
it may not matter what happens if they do
• In such cases we fill in the Karnaugh map with and X
• meaning don't care
• When minimizing an X is like a "joker“
• X can be 0 or 1 - whatever helps best with the minimization
• Ex
• simplifies to B if X is assumed 1
More “Don’t Care” examples
• “Don’t care” conditions should be changed to either 0 or 1
to produce K-map looping that yields the simplest
expression
Example Problem
• Lets design a logic circuit that controls an elevator door in
a three-story building.
• The circuit will has four inputs.
• M is a logic signal that indicates
• When the elevator is moving (M=1) or Stopped (M=0).
• F1, F2, and F3 are floor indicator signals that are normally
LOW, and they go HIGH only when the elevator is
positioned at the level of that particular floor.
• For example,
• When the elevator is lined up level with the second floor, F2=1 and
F1=F3=0.
• The circuit output is the OPEN signal which is normally LOW and is
to go HIGH when the elevator door is to be opened.
Examples
The Karnaugh Map with 5 variables
5-Variable K-Map
• Min-terms 0 to 15, A is 0 and from 16 to 31, A is 1. A 5-
variable K-Map is drawn as below.
Example
• F = Σ (1, 3, 4, 5, 11, 12, 14, 16, 20, 21, 30)
• Since, the biggest number is 30, we need to have 5
variables to define this function.
F = B’CD’ + A’BCE’ + BCDE’ + A’C'DE + AB’D'E’ + A’B'C’E
• (4, 5, 20, 21) – B’CD’ (Since A & E are the changing variables, it is
eliminated)
• (12, 14) – A’BCE’ (Since D is the changing variable, it is
eliminated)
• (14, 30) – BCDE’ (Since A is the changing variable, it is eliminated)
• (3, 11) – A’C'DE (Since B is the changing variable, it is eliminated)
• (16, 20) – AB’D'E’ (Since C is the changing variable, it is
eliminated)
• (1, 3) – A’B'C’E (Since D is the changing variable, it is eliminated)
• Thus, F = B’CD’ + A’BCE’ + BCDE’ + A’C'DE + AB’D'E’ +
A’B'C’E
Example:
• F = Σ (0, 1, 2, 3, 8, 9, 16, 17, 20, 21, 24, 25, 28, 29, 30, 31)
F = AD’ + C’D’ + A’B'C’ + ABC
• (16, 17, 20, 21, 28, 29, 24, 25) – AD’ (Since B, C and E
are changing variables, they are eliminated)
• (0, 1, 8, 9, 16, 17, 24, 25) – C’D’ (Since A, B and E are
changing variables, they are eliminated)
• (0, 1, 2, 3) – A’B'C’ (Since D and E are changing
variables, they are eliminated)
• (28, 29, 30, 31) – ABC (Since D and E are changing
variables, they are eliminated)
• Thus, F = AD’ + C’D’ + A’B'C’ + ABC
Minterms and Maxterms
K Map Method Summary
• Compared to the algebraic method, the K-map process is
a more orderly process requiring fewer steps and always
producing a minimum expression
• The minimum expression in generally is NOT unique
• For the circuits with large numbers of inputs (larger than
four), other more complex techniques are used.
Summary
• SOP and POS –useful forms of Boolean equations
• Design of a comb. Logic circuit
• (1) construct its truth table, (2) convert it to a SOP, (3) simplify using
Boolean algebra or K mapping, (4) implement
• K map: a graphical method for representing a circuit’s
truth table and generating a simplified expression
• “Don’t cares” entries in K map can take on values of 1 or
0. Therefore can be exploited to help simplification
Reference
• Ronald. J Tocci, Digital System Principles and
Applications, 8th Edition, Prentice Hall.