prof. sin-min lee department of computer science

46
Prof. Sin-Min Lee Department of Computer Science POS, K-map and Multiplexer

Upload: noelle-porter

Post on 15-Mar-2016

44 views

Category:

Documents


7 download

DESCRIPTION

CS147 Lecture 6. Prof. Sin-Min Lee Department of Computer Science. POS, K-map and Multiplexer. Karnaugh maps. Last time we saw applications of Boolean logic to circuit design. The basic Boolean operations are AND, OR and NOT. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Prof. Sin-Min Lee Department of Computer Science

Prof. Sin-Min LeeDepartment of Computer Science

POS, K-map and Multiplexer

Page 2: 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.

Today we’ll look at a graphical technique for simplifying an expression into a minimal sum of products (MSP) form: There are a minimal number of product terms in the expression. Each term has a minimal number of literals.

Circuit-wise, this leads to a minimal two-level implementation.

Page 3: Prof. Sin-Min Lee Department of Computer Science

Review: Standard forms of expressions

We can write expressions in many ways, but 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

The advantage is that any sum of products expression can be implemented using a two-level circuit literals and their complements at the “0th” level AND gates at the first level a single OR gate at the second level

This diagram uses some shorthands… NOT gates are implicit literals are reused this is not okay in LogicWorks!

f(x,y,z) = y’ + x’yz’ + xz

Page 4: Prof. Sin-Min Lee Department of Computer Science

Unsimplifying expressions

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.

In both cases, we’re actually “unsimplifying” our example expression. The resulting expression is larger than the original one! But having all the individual minterms makes it easy to combine them together with the K-

map.

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

Page 5: Prof. Sin-Min Lee Department of Computer Science

K-maps from truth tables You can also fill in the K-map directly from a truth table. The output in row i of the table goes into square

mi of the K-map. Remember that the rightmost columns of the K-

map are “switched.”

Ym0 m1 m3 m2

X m4 m5 m7 m6Z

x y z f (x,y,z)0 0 0 00 0 1 10 1 0 00 1 1 0

1 0 0 01 0 1 11 1 0 11 1 1 1

Y0 1 0 0

X 0 1 1 1Z

Page 6: Prof. Sin-Min Lee Department of Computer Science

The Sum-of-Products (SOP) Form

DCBCDEABC

ABCAB

When two or more product terms are summed by Boolean addition

Page 7: Prof. Sin-Min Lee Department of Computer Science

Conversion of a General Expression to SOP Form

ACDABCDBA

CBA

Any logic expression can be change into SOP form by applying Boolean Algebra techniques

CBCA

CBA

CBA

Try This:

Page 8: Prof. Sin-Min Lee Department of Computer Science

The Standard SOP FormDCBADBACBA

DD CC

CCDBA

DDCBA

DCBADCBACDBADCBADCBA

Page 9: Prof. Sin-Min Lee Department of Computer Science

The Products-of-Sum (POS) Form

When two or more sum terms are multiplied.

CACBABA

CBABA

Page 10: Prof. Sin-Min Lee Department of Computer Science

The Standard POS Form DCBADCBCBA

DD AA

AADCB

DDCBA

DCBADCBADCBADCBADCBA

Rule 12!

Page 11: Prof. Sin-Min Lee Department of Computer Science

Boolean Expression and Truth Table

Page 12: Prof. Sin-Min Lee Department of Computer Science

Examine each of the products to determine where the product is equal to a 1. Set the remaining row outputs to 0.

Converting SOP to Truth Table

Page 13: Prof. Sin-Min Lee Department of Computer Science

Opposite process from the SOP expressions. Each sum term results in a 0. Set the remaining row outputs to 1.

Converting POS to Truth Table

Page 14: Prof. Sin-Min Lee Department of Computer Science

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

ABCCABCBABCAX

CBACBACBACBAX

Page 15: Prof. Sin-Min Lee Department of Computer Science

The Karnaugh Map

Page 16: Prof. Sin-Min Lee Department of Computer Science

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

Page 17: Prof. Sin-Min Lee Department of Computer Science

The 3-Variable K-Map

Page 18: Prof. Sin-Min Lee Department of Computer Science

The 4-Variable K-Map

Page 19: Prof. Sin-Min Lee Department of Computer Science

K-Map SOP Minimization

A 1 is placed on the K-Map for each product term in the expression.

Each 1 is placed in a cell corresponding to the value of a product term

Page 20: Prof. Sin-Min Lee Department of Computer Science

Example:Map the following standard SOP expression on a K-Map:

ABCCABCBACBA

Solution:

Page 21: Prof. Sin-Min Lee Department of Computer Science

Example:Map the following standard SOP expression on a K-Map:

DCBADCBADCABABCDDCABDCBACDBA

Solution:

Page 22: Prof. Sin-Min Lee Department of Computer Science

Exercise:

CBACBABCA

Map the following standard SOP expression on a K-Map:

ABCDDCABDABCDBCA

Page 23: Prof. Sin-Min Lee Department of Computer Science

Answer:

Page 24: Prof. Sin-Min Lee Department of Computer Science

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 include noncommon 1s

To maximize the size of the groups and to minimize the number of groups

Page 25: Prof. Sin-Min Lee Department of Computer Science

Example: Group the 1s in each K-Maps

Page 26: Prof. Sin-Min Lee Department of Computer Science

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.

Page 27: Prof. Sin-Min Lee Department of Computer Science

Example: Determine the product term for the K-Map below and write the resulting

minimum SOP expression

DCACAB

DCDCACAB

1 DC

Page 28: Prof. Sin-Min Lee Department of Computer Science
Page 29: Prof. Sin-Min Lee Department of Computer Science

Example: Use a K-Map to minimize the following standard SOP expression

CBACBACBABCACBA

CAB

Page 30: Prof. Sin-Min Lee Department of Computer Science

Example: Use a K-Map to minimize the following standard SOP expression

DCBADABCDBCADCBACDBACBDBADCABDCBADCB

CBD

Page 31: Prof. Sin-Min Lee Department of Computer Science

Mapping Directly from a Truth Table

Page 32: Prof. Sin-Min Lee Department of Computer Science

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

Page 33: Prof. Sin-Min Lee Department of Computer Science

Don’t Care (X) ConditionsExample of the use of “don’t care” conditions to simplify an expression

Page 34: Prof. Sin-Min Lee Department of Computer Science

Exercise: Use K-Map to find the minimum SOP from

CBBCACBBCA

CBACBACBA

1

2

Page 35: Prof. Sin-Min Lee Department of Computer Science
Page 36: Prof. Sin-Min Lee Department of Computer Science
Page 37: Prof. Sin-Min Lee Department of Computer Science
Page 38: Prof. Sin-Min Lee Department of Computer Science
Page 39: Prof. Sin-Min Lee Department of Computer Science
Page 40: Prof. Sin-Min Lee Department of Computer Science

SOP

Page 41: Prof. Sin-Min Lee Department of Computer Science

POS

Page 42: Prof. Sin-Min Lee Department of Computer Science

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”.

Page 43: Prof. Sin-Min Lee Department of Computer Science
Page 44: Prof. Sin-Min Lee Department of Computer Science
Page 45: Prof. Sin-Min Lee Department of Computer Science

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.

Page 46: Prof. Sin-Min Lee Department of Computer Science