Memory Systems L1 - Department of Computer Science

advertisement
POS, K-map and Multiplexer
Prof. Sin-Min Lee
Department of Computer Science
Karnaugh maps
 Last time we saw applications of Boolean
logic to circuit design.



The basic Boolean operations are AND, OR and
NOT.
These operations can be combined to form
complex expressions, which can also be directly
translated into a hardware circuit.
Boolean algebra helps us simplify expressions
and circuits.
Review: Standard forms of
expressions
 We
can write expressions in many ways, but
f(x,y,z) = y’ + x’yz’ + xz
some ways are more useful than others
 A sum of products (SOP) expression
contains:


Only OR (sum) operations at the “outermost”
level
Each term that is summed must be a product of
literals
Unsimplifying expressions
xy + y’z + xz = (xy  1) + (y’z  1) + (xz  1)
= (xy  (z’ + z)) + (y’z  (x’ + x)) + (xz  (y’ + y))
= (xyz’ + xyz) + (x’y’z + xy’z) + (xy’z + xyz)
= xyz’ + xyz + x’y’z + xy’z
 You can also convert the expression to a sum
of minterms with Boolean algebra.


Apply the distributive law in reverse to add in
missing variables.
Very few people actually do this, but it’s
occasionally useful.
K-maps
from
truth
tables
 You can also fill in the K-map directly from a
truth table.


x
0
0
0
0
The output in row i of the table goes into square
Y
mi of the K-map.
m
m
m
m
m
m
m
Remember that the rightmostXcolumns
of
them KZ
map are “switched.”
y
z
f(x,y,z)
0
0
1
1
0
1
0
1
0
1
0
0
0
0
1
0
1
0
0
1
1
1
3
2
4
5
7
6
Y
X
1
1
1
0
0
0
1
1
0
1
Z
0
1
The Sum-of-Products (SOP)
Form
two or more product terms are summed by
When
Boolean addition
AB  ABC
ABC  CDE  BC D
Conversion of a General
Expression to SOP Form
Any logic expression can be change into SOP form by
applying Boolean Algebra techniques
AB  CD  AB  ACD
Try This:
A  B C


 A B C
  A  B C
 AC  BC
The Standard SOP Form
ABC  ABD  ABCD
C
D
D
C
 
A BD  C  C 
ABC  D  D
ABCD  ABC D  ABCD  ABCD  ABCD
The Products-of-Sum (POS)
Form
When two or more sum terms are multiplied.
A  B A  B  C 
 A  B A  B  C A  C 
The Standard POS Form
A  B  C B  C  D A  B  C  D 
D
D
A
A
Rule 12!
A  B  C   D D
B  C  D   A A
A  B  C  D A  B  C  D A  B  C  D A  B  C  D A  B  C  D 
Boolean Expression and Truth
Table
Converting SOP to Truth Table
 Examine each of the products to determine where
the product is equal to a 1.
 Set the remaining row outputs to 0.
Converting POS to Truth Table
 Opposite process from the SOP expressions.
 Each sum term results in a 0.
 Set the remaining row outputs to 1.
Converting from Truth Table to
SOP and POS
Inputs
Output
A
B
C
X
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
1
1
0
0
1
1
0
1
0
1
1
0
1
1
1
1
1
X  ABC  ABC  ABC  ABC



X  A  B  C  A  B  C A  B  C A  B  C

The Karnaugh Map
The Karnaugh Map
 Provides a systematic method for simplifying
Boolean expressions
 Produces the simplest SOP or POS
expression
 Similar to a truth table because it presents all
of the possible values of input variables
The 3-Variable K-Map
The 4-Variable K-Map
K-Map SOP Minimization
 A 1 is placed on the KMap for each product
term in the expression.
 Each 1 is placed in a
cell corresponding to
the value of a product
term
Example:
Map the following standard SOP expression on a K-Map:
ABC  ABC  ABC  ABC
Solution:
Example:
Map the following standard SOP expression on a K-Map:
ABCD  ABC D  ABCD  ABCD  ABC D  ABCD  ABC D
Solution:
Exercise:
Map the following standard SOP expression on a K-Map:
ABC  ABC  ABC
ABC D  ABC D  ABC D  ABCD
Answer:
K-Map Simplification of SOP
Expressions
 A group must contain either 1, 2, 4, 8 or 16 cells.
 Each cell in group must be adjacent to one or more
cells in that same group but all cells in the group do
not have to be adjacent to each other
 Always include the largest possible number 1s in a
group in accordance with rule 1
 Each 1 on the map must be included in at least one
group. The 1s already in a group can be included in
another group as long as the overlapping groups
To maximize the size of the groups and to minimize the number of groups
include
noncommon 1s
Example: Group the 1s in each KMaps
Determining the minimum SOP
Expression from the Map
 Groups the cells that have 1s. Each group of
cells containing 1s create one product term
composed of all variables that occur in only
one form (either uncomplemented or
complemented) within the group. Variable
that occurs both uncomplemented and
complemented within the group are
eliminated. These are called contradictory
variables.
Example: Determine the product term for the
K-Map below and write the resulting
minimum SOP expression
B  AC  ACD
1
CD
B  AC  ACD  C D
Example: Use a K-Map to minimize the
following standard SOP expression
ABC  ABC  ABC  ABC  ABC
B  AC
Example: Use a K-Map to minimize
the following standard SOP expression
BC D  ABC D  ABC D  ABCBD  ABCD  ABC D  ABC D  ABC D  ABC D
D  BC
Mapping Directly from a Truth
Table
Don’t Care (X) Conditions
 A situation arises in which input variable
combinations are not allowed
 Don’t care terms either a 1 or a 0 may be
assigned to the output
Don’t Care (X)Example
Conditions
of the use of “don’t
care” conditions to simplify an
expression
Exercise: Use K-Map to find the
minimum SOP from
1
ABC  A BC  ABC

 
A BC  BC  A BC  BC

2
SOP
POS
Multiplexers
 A combinational circuit that selects info from
one of many input lines and directs it to the
output line.
 The selection of the input line is controlled
by input variables called selection inputs.
 They are commonly abbreviated as “MUX”.
Combinational circuit
implementation using MUX
 We can use Multiplexers to express
Boolean functions also.
 Expressing Boolean functions as MUXs
is more efficient than as decoders.
 First n-1 variables of the function used
as selection inputs; last variable used as
data inputs.
 If last variable is called Z, then each
data input has to be Z, Z’, 0, or 1.
Download