Sei sulla pagina 1di 9

In this lecture:

Lecture 5: Logic Simplification &


Karnaugh Maps
• Standard form of Boolean Expression:
Dr Pete Sedcole – Sum-of-Products & Product-of-Sums (SOP/POS)
Department of E&E Engineering – Canonical form
Imperial College London
http://cas.ee.ic.ac.uk/~nps/
• Boolean simplification with Boolean algebra
• Boolean simplification with Karnaugh Maps
(Floyd 4.5 – 4.10) • The “Don’t care” logic state
(Tocci 4.1 – 4.5)

E1.2 Digital Electronics 1 5.1 31 October 2008 E1.2 Digital Electronics 1 5.2 31 October 2008

Forms of Boolean Expressions Canonical form


• Sum-of-products (SOP)
– e.g.: X = ABC + DEF + AEF
– the product (AND) terms are formed first, then • In the canonical form of a Boolean expression, every
summed (OR) variable appears in every term
– e.g.: f ( A, B, C , D) = ABC D + AB CD + AB CD
• Product-of-sums (POS)
– e.g.: Y = (A+B+E)(C+D+E)(B+F)
• Canonical form is not an efficient way of writing the
– the sum (OR) terms are formed first, then the product
Boolean expression, but is useful sometimes in
(AND)
design and analysis
• It is possible to convert between the two forms using
DeMorgan’s theorems.
E1.2 Digital Electronics 1 5.3 31 October 2008 E1.2 Digital Electronics 1 5.4 31 October 2008
Canonical form and ∑ notation
• How do we find the canonical form of an expression?
– Start with the SOP (sum-of-products) form • Construct the truth table for the function
– AND each incomplete expression with X + X where f ( A, B, C ) = ABC + ABC + A BC
X is the missing variable Row number A B C f
• e.g.: f ( A, B, C ) = AB + BC 0 0 0 0 0
1 0 0 1 0
2 0 1 0 0
= AB(C + C ) + ( A + A ) BC 3 0 1 1 1 ABC
4 1 0 0 0
= ABC + ABC + ABC + A BC 5 1 0 1 0
6 1 1 0 1 ABC
= ABC + ABC + A BC 7 1 1 1 1 ABC

• The product term in a canonical SOP expression is An alternative notation: write f as a sum of the row
called a ‘minterm’ numbers that have TRUE minterms:

f = ∑(3,6,7)
E1.2 Digital Electronics 1 5.5 31 October 2008 E1.2 Digital Electronics 1 5.6 31 October 2008

Simplifying logic circuits Method 1: Minimisation by Boolean Algebra


Obtain the expression of the circuit’s function, then try to simplify

• Make use of rules and theorems of Boolean algebra to


simplify the Boolean expression
– Try to reduce the complexity of the equation, so that
the circuit is also less complex
– This method relies on your algebraic skill
– Three things you can try…
We will look at two methods:
Algebraic and Karnaugh maps
E1.2 Digital Electronics 1 5.7 31 October 2008 E1.2 Digital Electronics 1 5.8 31 October 2008
Tool 1: Grouping Tool 2: ANDing with redundant logic

• ANDing an expression with ( X + X ) or (1 + 1) does not


• Given: A + AB + BC alter the logic
• ANDing then expanding may enable an expression to be
• Write it as A(1 + B) + BC simplified
• Example: AB + AC + BC = AB (C + C ) + AC + BC
• Then apply (1 + B ) = 1
= ABC + ABC + AC + BC
• Minimised form: A + BC = BC (1 + A) + AC (1 + B )
= BC + AC
E1.2 Digital Electronics 1 5.9 31 October 2008 E1.2 Digital Electronics 1 5.10 31 October 2008

Tool 3: DeMorgan’s Theorems Example of logic design

• Design a logic circuit having three inputs (A, B, C) that


• Inversions of compound expressions can be simplified will have its output HIGH only when a majority of the
using DeMorgan’s Theorems inputs are HIGH
• Example: A B C Z
0 0 0 0
Step 1: 0 0 1 0
AB C + ACD + BC = ( A + B + C ) + ( A + C + D ) + BC Draw the truth table 0 1 0 0
0 1 1 1 → ABC
= A + B + C + D + BC Step 2: 1 0 0 0
Write the product terms 1 0 1 1 → ABC
1 1 0 1 → ABC
= A + B+C + D for each case where the
output is 1 1 1 1 1 → ABC

= AB CD
E1.2 Digital Electronics 1 5.11 31 October 2008 E1.2 Digital Electronics 1 5.12 31 October 2008
Step 3: Step 5:
Write the SOP form for the output Implement the circuit

Z = A BC + AB C + ABC + ABC

Step 4:
Using the rules of Boolean algebra, try to simplify the expression

Z = A BC + AB C + ABC + ABC
= ABC + A BC + ABC + AB C + ABC + ABC
= BC ( A + A ) + AC ( B + B ) + AB(C + C )
= BC + AC + AB

E1.2 Digital Electronics 1 5.13 31 October 2008 E1.2 Digital Electronics 1 5.14 31 October 2008

AB\CD 00 01 11 10
Minimisation using Karnaugh Maps
00
• What is a Karnaugh map? An example 01 ? ??
with 4 variables:
BC 11
A grid of squares A 00 01 11 10 Corresponds to
minterm ABC 10
0
An example with
three variables: 1
The square marked ? represents: A BC D
• Similar to a truth table: shows the output value for every combination The square marked ?? represents:
of inputs A BCD
• Each square represents a minterm Note that they differ only in the C variable
• Only one variable changes between adjacent squares (similar to
Gray Codes)
• Squares at the edges are adjacent to squares on the opposite edges
E1.2 Digital Electronics 1 5.15 31 October 2008 E1.2 Digital Electronics 1 5.16 31 October 2008
Filling out a Karnaugh Map Minimisation technique
• Write the Boolean expression in SOP form • Minimisation is done by spotting patterns of 1s and 0s
• For each product term, write a 1 in all the squares which are
included in the term
• The rules of algebra can be used to describe the
• Write a 0 in the remaining blank squares
patterns in simple product terms
• Example: • For example, take a pair of adjacent 1s:
X = A BC + ABC + AB – Adjacent squares differ by one variable
– The expression for a pair of adjacent 1s has the form:
A \ BC 00 01 11 10 ( P )C + ( P )C = ( P )(C + C )
0 0 0 1 0
1 0 1 1 1 This can be simplified to just P

E1.2 Digital Electronics 1 5.17 31 October 2008 E1.2 Digital Electronics 1 5.18 31 October 2008

• The example from an earlier slide: X = A BC + ABC + AB


A BC
A \ BC 00 01 11 10
A \ BC 00 01 11 10
0 0 0 1 0
0 0 0 1 0
1 0 1 1 1
1 0 1 1 1

ABC • “Cover” all the 1s with the largest groups


• The adjacent squares A BC and ABC differ only in A • The simplified Boolean expression is found by summing
– Therefore they can be combined into just BC all the terms corresponding to each group
– Normally we draw boxes around the squares to be
combined
X = AC + BC + AB
• Can do this for larger groups of 1s (of 4, 8, …)
E1.2 Digital Electronics 1 5.19 31 October 2008 E1.2 Digital Electronics 1 5.20 31 October 2008
More examples of grouping

AB\CD 00 01 11 10 AB\CD 00 01 11 10
00 0 1 0 0 00 0 0 0 0
01 0 1 0 0 01 1 0 0 1
11 1 1 1 1 11 1 0 1 1
10 0 1 0 0 10 0 0 0 0

AB + C D BD + ABC

E1.2 Digital Electronics 1 5.21 31 October 2008 E1.2 Digital Electronics 1 5.22 31 October 2008

E1.2 Digital Electronics 1 5.23 31 October 2008 E1.2 Digital Electronics 1 5.24 31 October 2008
K-map simplification Complete K-map simplification process

1. Construct the K-map and place 1s and 0s in the squares according


• Goal: find the form of a Boolean expression with the to the SOP expression or truth table
minimum number of product terms 2. Find the largest grouping of 1s that are not already all in a group; if
• Method: group together 1s on a K-map there is more than one possibility, choose a grouping that
minimises the total number of groups
• Constraints:
3. Repeat step 2 until only isolated 1s remain
– all 1s must be part of a group (even if it is a single
group) 4. Form single groups of the remaining isolated 1s

– all groups must be of size 1, 2, 4, 8, 16, … 5. Find the product term that corresponds to each group
6. OR together all the product terms

E1.2 Digital Electronics 1 5.25 31 October 2008 E1.2 Digital Electronics 1 5.26 31 October 2008

‘Don’t Care’ conditions


• In certain cases some input combinations may never
occur, or the output doesn’t matter when they do
• In this case we fill in the truth table / K-map with an ‘X’
• ‘X’ means ‘don’t care’ (it is not a Boolean variable)
• ‘X’ acts like a joker or wildcard – it can be either a 1 or a
0 depending on which value will help the minimisation

Example: A \ BC 00 01 11 10
X can be 0 or 1, but the
0 0 0 1 X
best minimisation is if Z=B
X=1 1 0 0 1 1

E1.2 Digital Electronics 1 5.27 31 October 2008 E1.2 Digital Electronics 1 5.28 31 October 2008
More ‘don’t care’ examples Open the lift doors
when the lift is
stopped at a floor

F2 F3 F2 F3 F2 F3 F2 F3

M F1 0 1 X 1
M F1 1 X X X
OPEN = MF1 + MF 2 + MF 3
M F1 0 X X X
M F1 0 0 X 0

E1.2 Digital Electronics 1 5.29 31 October 2008 E1.2 Digital Electronics 1 5.30 31 October 2008

The Karnaugh map of 5 variables K-map method summary

• Compared to algebraic manipulation, the K-map method


AB\CD 00 01 11 10 AB\CD 00 01 11 10 is a more structured process requiring a fixed number of
00 00 steps
01 01
• K-maps always produce a minimum expression
11 11
10 10 • The minimum expression is in general NOT unique
• For circuits with a large number of inputs (more than 4)
E=0 E=1
other, more complex techniques must be used

E1.2 Digital Electronics 1 5.31 31 October 2008 E1.2 Digital Electronics 1 5.32 31 October 2008
Summary
• SOP and POS are useful forms of Boolean equations
• Designing a combinational logic circuit:
1. Construct a truth table
2. Convert it to SOP
3. Simplify using Boolean algebra or a K-map
4. Implement
• A Karnaugh map is a graphical method for representing and
simplifying Boolean expressions
• “Don’t care” entries in a K-map can take values of 1 or 0 depending
on which value is more helpful in the simplification

E1.2 Digital Electronics 1 5.33 31 October 2008

Potrebbero piacerti anche