1 digital logic design week 5 simplifying logic expressions

Post on 31-Dec-2015

215 Views

Category:

Documents

5 Downloads

Preview:

Click to see full reader

TRANSCRIPT

1

Digital Logic Design

Week 5

Simplifying logic expressions

2

• Algebraic method– Standard forms (Algebraic way to represent any

logic function)– Simplification using Boolean algebra

• K-Map method (Karnaugh maps)– 2, 3, 4 variable expressions– 5, 6 variable expressions (NOT)

• VEM (Variable entered mapping) (NOT)

Simplifying logic expressions

3

Standard forms

All Boolean expressions can be converted into either of two forms:

Sum-of-products (SOP) form

Product-of-sums (POS) form

4

Sum-of-products (SOP)Sum-of-products (SOP) expressions formed by summing (Boolean addition-ORing) product terms (ANDed terms).

Example:Example:

DCACDCBA AND gates form

products

OR gate forms the sum

5

Standard sum-of-products form

Standard SOP expressionAll variables in the domain appear in each product term in the expression

Example:

A minterm is a product term involving all variables in the domain Standard SOP expressions often called sum of minterms

DCABDCBACDBA

6

Truth tables from standard SOP form

Complete the truth table for X = ABCCBACBA

Place a 1 in output column for each input combination that makes X = 1

Place a 0 in remaining rows

A B C X----------------------------------------0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

A B C X----------------------------------------0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

7

Product-of-sums (POS)Product-of-sums (POS) expressions are sum terms “multiplied” together

Examples:

The following expressions are not in POS form:

CBABA

CACBABA

CBA CDBA

Remember: “multiplication” here means ANDed together

DCBEDCCBA

8

Product-of-sums (POS)

Example: CADCBBA

AND gate forms the product

OR gates form sums

9

Standard product-of-sums form

Standard POS expressionAll variables in the domain appear in each sum term in the expression

Example:

A maxterm is a sum term involving all variables in the domain Standard POS expressions often called product of maxterms

DCBADCBADCBA

10

Truth tables from standard POS form

A B C X----------------------------------------0 0 0 00 0 1 10 1 0 00 1 1 01 0 0 11 0 1 01 1 0 01 1 1 1

Complete the truth table for X = CBACBACBACBACBA

Place a 0 in output column for each input combination that makes X = 0

Place a 1 in remaining rows

A B C X----------------------------------------0 0 00 0 10 1 00 1 11 0 01 0 11 1 01 1 1

11

Standard expressions from a truth table

Four 1’s in output column, corresponding to minterms ABC,CAB,CBABC,A

ABCCABCBABCA X

Four 0’s in output column, corresponding to maxterms

CBAC,BA,CBAC,BA

CBACBACBACBA X

Find standard SOP and standard POS expressions for X

A B C X----------------------------------------0 0 0 00 0 1 00 1 0 00 1 1 11 0 0 11 0 1 01 1 0 11 1 1 1

12

• Algebraic method– Standard forms (Algebraic way to represent any

logic function)– Simplification using Boolean algebra

• K-Map method (Karnaugh maps)– 2, 3, 4 variable expressions

Simplifying logic expressions

13

• Simplified Boolean expressions results in efficient hardware implementations Simpler expressions → fewer gates → faster & uses less power

• Simplification using Boolean algebra applies laws: commutative, associative, distributive rules

A+1=1, A+0=A, A·A’=0, A+A=A, A+BC=(A+B)·(A+C), A’’=A, … De Morgan’s theorem

(A·B)’=A’+B’ (A+B)’=A’·B’

• Also needs skill, persistence and often luck!

Simplification using Boolean algebra

14

• Sensors: Oil pressure HIGH/NORMAL A=1 : pressure HIGH Temperature HIGH/NORMAL B=1 : temp. HIGH Flow rate HIGH/NORMAL C=1 : flow HIGH

• Output Alarm ON/OFF F=1 : alarm ON

• Alarm ON only when: oil pressure is NORMAL, temperature is HIGH and flow is

NORMAL, or oil pressure is HIGH and flow or temperature is NORMAL, or flow is HIGH and temperature is HIGH

Example: alarm system

15

Alarm system: our first solution

BCCBACBAF

CBA CBA

BC

Logisim file Week05_1.circ in the course site

16

Alarm system: our simplified solution

BAF

Week05_2.circ

Alarm circuit doesn’t even need

flow rate measurement!

17

Simplifying the solution• Simplify the expression for F using Boolean algebra

F = A’BC’ + A(B’ + C’) + BC= A’BC’ + AB’ + AC’ + BC= (A+A’B)C’ + AB’ + BC= ((A + A’) (A + B)) C’ + AB’ + BC= ……………………= ……………..= ……………….= A + B

COMPLEX & TIME CONSUMING

RESULT: Boolean algebra simplification relies on:Laws, rules, theorems, skill and patience

18

Karnaugh-map (K-map) is organised as a matrix of squares, where each square represents a minterm (ANDed variables, ex: AB’C) adjacent squares always differ by just one literal (so that the

unifying theorem may apply: a + a' = 1)

It is another way of representing truth table of a logic circuit

For 2-variable case (e.g.: variables a,b), the map can be drawn as:

K-maps

a

b

equivalent to:

ab

0 1

0 1

19

You will have noticed that the order of binary bits above the box is not in the standard binary sequence (00, 01,10,11).

It is arranged so that the values for adjacent columns vary by only a single bit (00, 01, 11, 10).

This sequence is known as grey code and it is a key factor in the way Karnaugh maps work.

K-maps

20

Using K-maps• The Boolean expression can then be entered into the Karnaugh

map• Like a truth table, a 1 is entered into the grid to show when the

Boolean expression is true.

21

Simplification using Karnaugh maps

• After Karnaugh map has been filled in for a given expression, simplification is a 2-step process:

1. Group the 1’s Groups to enclose adjacent cells Groups must be square or rectangular, and contain

1,2,4,8 or 16 cells Goal is to:

Cover all 1’s at least once Maximise size of groups Minimise number of groups

2. Determine simplified SOP expression

2222 of 13

Using a Karnaugh Map

The next stage is to group 1s together.

Loops should be drawn starting with the largest possible loop, and additional loops should then be drawn until all the 1s are included in a loop. Loops should always be made as large as possible, and adjacent 1s can be included into more than one loop.

Adjacent 1s can be looped together in horizontal and vertical groups of 2, 4 or 8, but never diagonally. Single 1s should be looped by themselves.

Since each loop results in a separate term, the smallest number of loops created will result in the simplest expression.

23 of 13

Using a Karnaugh Map

Each group of 1s is a separate term in the final simplified expression that can be determined by inspection.

The first loop in the example groups together 1s for both A and C irrespective of the state of B. The expression is therefore A.C

The last loop in the example is for a single term, and so cannot be simplified. A.B.C

The second loop groups together 1s for both A and B irrespective of the state of C. The expression is therefore A.B

24

From truth table to Karnaugh map

A B C F0 0 0 10 0 1 10 1 0 00 1 1 01 0 0 11 0 1 01 1 0 11 1 1 0

25

From truth table to Karnaugh mapDraw the Karnaugh map for the expression defined by the following truth table

A B C Xminterms

------------------------------------0 0 0 00 0 1 1 A’B’C0 1 0 1 A’BC’0 1 1 01 0 0 01 0 1 01 1 0 1 ABC’1 1 1 1 ABC

2626 of 13

Groups of 1s can be grouped together as shown to get the following simplified equation.

Here is a four-input problem and its associated Truth Table and Karnaugh map.

Karnaugh Maps With More Variables

top related