logic simplification slide

46
BOOLEAN ALGEBRA AND LOGIC SIMPLIFICATION 1 Chapter 4

Upload: tn-zahiruddin

Post on 21-Jul-2016

50 views

Category:

Documents


4 download

DESCRIPTION

For references

TRANSCRIPT

Page 1: LOGIC SIMPLIFICATION SLIDE

BOOLEAN ALGEBRA AND

LOGIC SIMPLIFICATION

1

Chapter 4

Page 2: LOGIC SIMPLIFICATION SLIDE

Contents2

Boolean Algebra De Morgan TheoremKarnaugh Map

2 variables 3 variables 4 variables 5 variables

Don’t care condition

Page 3: LOGIC SIMPLIFICATION SLIDE

Boolean Algebra

Boolean algebra is the mathematics of digital systems.Terms used in Boolean algebra

A variable is a symbol used to represent a logical quantity. Any single variable can have the value of 1 or 0.

The complement is the inverse of a variable and is indicated by a bar over the variable. The complement of the variable A is A. If A=1, then A =0. Sometimes a prime symbol is used to denote a complement of a variable, A’ .

A literal is each appearance of a variable or its complement.For example, F (X ,Y ,Z) = XY(Z + YX) + YZ:

3 Variables 7 Literals

3

Page 4: LOGIC SIMPLIFICATION SLIDE

Laws of Boolean Algebra4

Commutative Law Addition: A + B = B + A

Multiplication : AB = BA

A

B

XB

A

X

A

B

XB

A

X

Page 5: LOGIC SIMPLIFICATION SLIDE

Laws of Boolean Algebra (cont.)5

Associative Law Addition: A + (B + C) = (A + B) + C

Multiplication: A(BC) = (AB)C

A

BC C

A

B≡

A

BC

≡AB

C

Page 6: LOGIC SIMPLIFICATION SLIDE

Laws of Boolean Algebra (cont.)6

Distributive Law A(B + C) = AB + AC

A

BC

C

A

B≡

Page 7: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra7

1. A + 0 = A2. A + 1 = 13. A • 0 = 04. A • 1 = A5. A + A = A6. A + A’ = 1

7. A • A = A8. A • A’ = 09. (A’)’ = A10. A + AB = A11. A + A’B = A + B12. (A+B)

(A+C)=A+BC

Page 8: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)8

1. A + 0 = A

2. A + 1 =1

A=0

0

0A=1

0

1

A=0

1

1A=1

1

1

Page 9: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)9

3. A • 0 = 0

4. A • 1 =A

A=0

0

0A=1

0

0

A=0

1

0A=1

1

1

Page 10: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)10

5. A + A = A

6. A + A’ = 1

A=0

A=0

0A=1

A=1

1

A=0

A’=1

1A=1

A’=0

1

Page 11: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)11

7. A • A = A

8. A • A’ =0

A=0

A=0

0A=1

A=1

1

A=0

A’=1

0A=1

A’=0

0

Page 12: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)12

9. (A’)’ = A

A=0 A’=1 (A’)’=0

A=1 A’=0 (A’)’=1

Page 13: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)13

10. A+AB = A

11. A+ A’B = A + B

A + AB = A • 1 + AB

= A (1 +B)= A • 1= A

A + A’B = (A + AB) + A’B

= A + B(A +A’)= A + B • 1 = A + B

Page 14: LOGIC SIMPLIFICATION SLIDE

Rules of Boolean Algebra (cont.)14

12. (A + B)(A + C) = A + BC

(A+ B)(A + C) = AA + AC + AB + BC= A + AC + AB + BC= A (1 +C) + AB + BC= A • 1 + AB + BC= A(1 + B) + BC= A • 1 + BC= A + BC

Page 15: LOGIC SIMPLIFICATION SLIDE

DeMorgan’s Theorem

1. XY = X + Y

2. X + Y = X Y

15

NAND Negative-OR

NOR Negative-AND

Page 16: LOGIC SIMPLIFICATION SLIDE

DeMorgan’s Theorem Examples

Apply DeMorgan’s theorem for WXYZ.16

WXYZ = W + X + Y + Z

Page 17: LOGIC SIMPLIFICATION SLIDE

DeMorgan’s Theorem Examples

Apply DeMorgan’s Theorem for (A+B+C)D Let (A+B+C) = X, and D =Y Applying DeMorgan’s Theorem

(A+B+C)D= A+B+C + D

Applying DeMorgan’s Theorem for first term

A+B+C + D = A B C + D

17

Page 18: LOGIC SIMPLIFICATION SLIDE

Simplification Using Boolean Algebra

AB + A(B+C) + B(B+C)= AB + AB + AC + BB + BC= AB + AC + B + BC= AB + AC + B= B + AC

18

Apply distributive law

BB=B (R7); AB+AB=AB (R5)

B+BC = B (R10)

B+AB = B (R10)A

BC A

B

C

Page 19: LOGIC SIMPLIFICATION SLIDE

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

Simplification Using Boolean Algebra19

Apply DeMorgan’s Theorem

Apply DeMorgan’s Theorem

Apply Distributive Law

AA=A (R7); AB+ABC=AB (R10)

A+AC=A (R10)

A+AB=A (R10)

Page 20: LOGIC SIMPLIFICATION SLIDE

SOP vs POS

Sum-of-Products (SOP) Two or more product terms are summed by Boolean addition. Implemented by ORing the outputs of two or more AND gates For e.g., ABC+CDE+B’CD’ If any of the product-term is HIGH, then output is HIGH

Product-of-Sums (POS) Two or more sum terms are multiplied by Boolean

multiplication. Implemented by ANDing the outputs of two or more OR gates For e.g., (A’+B)(A+B’+C) If any of the sum-term is LOW, then output is LOW

20

Page 21: LOGIC SIMPLIFICATION SLIDE

Canonical Forms of Boolean Algebra

Also known as, Standard formLongest form of Boolean Expressions

All variable appears in each sum/product terms

21

Page 22: LOGIC SIMPLIFICATION SLIDE

Canonical Forms of Boolean Algebra (cont.)

Minterms – Standard Sum-of-Products (SOP) All variables appear in each product terms Output is HIGH if any product-term is HIGH

22

Binary Equivalent(ABC)

Minterm Minterm

Number000 A’B’C’ m0

001 A’B’C m1

010 A’BC’ m2

011 A’BC m3

100 AB’C’ m4

101 AB’C m5

110 ABC’ m6

111 ABC m7

Note:0 – bar1 – no bar

Page 23: LOGIC SIMPLIFICATION SLIDE

Canonical Forms of Boolean Algebra (cont.)

For eg; X(A,B,C) = ∑m(0, 2, 3, 5)=m0 + m2 + m3 + m5

=A’B’C’ + A’BC’ + A’BC + AB’C

23

Binary (ABC) X000 1001 0010 1011 1100 0101 1110 0111 0

Page 24: LOGIC SIMPLIFICATION SLIDE

Canonical Forms of Boolean Algebra (cont.)

Maxterms – Standard Product-of-Sums (POS) All variables appear in each sum terms Output is LOW if any sum-term is LOW

24

Binary Equivalent(ABC)

Maxterm

000 (A+B+C) M0

001 (A+B+C’) M1

010 (A+B’+C) M2

011 (A+B’+C’) M3

100 (A’+B+C) M4

101 (A’+B+C’) M5

110 (A’+B’+C) M6

111 (A’+B’+C’) M7

Note:1 – bar0 – no bar

Page 25: LOGIC SIMPLIFICATION SLIDE

Canonical Forms of Boolean Algebra (cont.)

For eg; X (A, B, C) = ∏M(1, 2, 6, 7)= M1 • M2 • M6 • M7

=(A+B+C’)(A+B’+C)(A’+B’+C)(A’+B’+C’)

25

Binary (ABC) X000 1001 0010 0011 1100 1101 1110 0111 0

Page 26: LOGIC SIMPLIFICATION SLIDE

Karnaugh Map26

The Karnaugh map provides a systematic method for simplifying Boolean expressions in SOP or POS form

The Karnaugh map is an array of cells in which each cell represents a binary value of the input variables.

A Karnaugh map is similar to a truth table as it presents all the possible values of input variables and the resulting output for each value.

The number of cells is equal to the total number of possible input variable combination, 2n.

Page 27: LOGIC SIMPLIFICATION SLIDE

The 2-variables Karnaugh Map27

Is an array of 22 = 4 cellsTruth table

A B Minterm0 0 m00 1 m11 0 m21 1 m3

AB AB

AB AB

0

0 1

1

AB

Page 28: LOGIC SIMPLIFICATION SLIDE

The 3-variables Karnaugh Map28

is an array of eight cells.

Page 29: LOGIC SIMPLIFICATION SLIDE

The 4-variables Karnaugh Map29

is an array of sixteen cells.

Page 30: LOGIC SIMPLIFICATION SLIDE

Cell adjacency30

The cells in a Karnaugh Map are arranged so that there is only a single-variable change between adjacent cells.

Adjacency is defined by a single-variable change.

Each cell is adjacent to the cells that are immediately next to it on any of its four sides.

The cells in the top row are adjacent to the corresponding cells in the bottom row . The cells in the outer left column are adjacent to the cells in the outer right column. This is called the “wrap-around” adjacency.

Page 31: LOGIC SIMPLIFICATION SLIDE

31

Page 32: LOGIC SIMPLIFICATION SLIDE

K-map Mapping32

Example 1: Map the standard SOP function below on a K-map

f(a,b,c) = ∑m(0, 5, 7) = a’b’c’ + ab’c + abc

a‘b’c’

abc

ab’c

1

1 1

Page 33: LOGIC SIMPLIFICATION SLIDE

K-map Simplification33

SOP expression; Boolean expression must be presented in standard SOP form.

Map 1’s on the minterm cells that make the standard expression

Perform next 3 steps to simplify the expression:1. Grouping the 1s2. Determining the product term for each group3. Summing the resulting product terms

Page 34: LOGIC SIMPLIFICATION SLIDE

K-map simplification (cont.)34

• Grouping the 1’s:• Enclose adjacent cells containing 1s.• A group must contain either 1, 2,4,8 or 16 cells. Maximize

the size of the groups to minimize the number of groups . • 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.• Determining the product terms:

• Determine product terms for each group• Check variables that do not change for all the 1’s in each

group

Page 35: LOGIC SIMPLIFICATION SLIDE

35

Example 2: Use K-map to simplify the following SOP expression

F(A,B,C,D) = A’B’C’D’ + A’BC’D’ + A’B’CD + AB’CD + A’B’CD’ + A’BCD’ + ABCD’ + AB’CD’ + ABC’D’ + AB’C’D’

Page 36: LOGIC SIMPLIFICATION SLIDE

36

1

1

1

1

1 1

1

1

11

The domains that have different

values are A,B and C. thus this

group give the simplified expression of

D’.

The domains that remain their values

are B’ and C. thus this

group give the simplified expression of

B’C.

F (A,B,C,D) = B’C + D’

Page 37: LOGIC SIMPLIFICATION SLIDE

Exercises 37

1. Simplify the Boolean function:f(x,y,z) = ∑m(2,3,4,5)

2. Simplify f(x,y,z)= ∑m(3,4,6,7) using K-map.

3. Express the expression f = A’C + A’B + AB’C + BC in sum of minterms using K-map . Then determine the minimal SOP form of the expression.

4. Map the function f(A,B,C,D) = (A+C)(B+C)(B’+C’+D) on a K-map and determine its minterm and maxterm list form.

Page 38: LOGIC SIMPLIFICATION SLIDE

Exe. 3: Express the expression f = A’C + A’B + AB’C + BC in sum of minterms using K-map . Then determine the minimal SOP form of the

expression.

38

Page 39: LOGIC SIMPLIFICATION SLIDE

Exe. 4: Map the function f(A,B,C,D) = (A+C)(B+C)(B’+C’+D) on a K-map and determine its minterm and maxterm list

form.39

2 ways to accomplish this task:1. Express the complement of the function in SOP

form , map the 1s and determine the minterms and maxterms from the K-map cells.

2. Plot 0s on a K-map following the POS expression and determine the maxterms & minterms from the K-map cells.

Page 40: LOGIC SIMPLIFICATION SLIDE

1. Express the complement of the function in SOP form , map the 1s and determine the minterms and maxterms from the K-map cells.

40

f '(A,B,C,D) = [(A+C)(B+C)(B’+C’+D)]’ = (A+C)’ + (B+C)’ + (B’+C’+D)’ = A’C’ + B’C’ + BCD’

0 1 3 2

4 5

12

8 9

13

11

15

7 6

14

10

1 1

1 1

1 1

1

1

Complement

Page 41: LOGIC SIMPLIFICATION SLIDE

1. Express the complement of the function in SOP form , map the 1s and determine the minterms and maxterms from the K-map cells.

41

f ’’(A,B,C,D) = (A’C’ + B’C’ + BCD’)’

0 1 3 2

4 5

12

8 9

13

11

15

7 6

14

10

0 0

0 0

0 0

0

0

Complement

Page 42: LOGIC SIMPLIFICATION SLIDE

0 1 3 2

4 5

12

8 9

13

11

15

7 6

14

10

2. Plot 0’s on a K-map following the POS expression and determine the maxterms & minterms from the K-map cells.

42

f (A,B,C,D) = (A+C)(B+C)(B’+C’+D)

0 0

0 0

0 0

0

0f = ∏ M (0,1,4,5,6,8,9,14)

= ∑ m (2,3,7,10,11,12,13,15)

Page 43: LOGIC SIMPLIFICATION SLIDE

The 5-variables K-Map43

Is a 32 cells map.

Let a function be of domain A,B,C,D,E

The 32 cells K-map is presented by 2 4-variables map. Each of the map has a fixed domain value for each cells, e.g. A=0 and A=1

Page 44: LOGIC SIMPLIFICATION SLIDE

Don’t Care Condition44

The logical sum of the minterms associated with a Boolean function specifies the conditions under which the function is equal to 1. the function is 0 for the rest of the minterms.

However, there are applications where the function is not specified for certain combinations of the variables. E.g. BCD code use only 10 minterms. Other 6 minterms are unused (m10 – m15).

These unspecified minterms is called don’t care conditions, as we don’t care what are the values

Page 45: LOGIC SIMPLIFICATION SLIDE

45

These don’t care conditions can be used on K-map to provide further simplification of the Boolean expression.

The don’t cares minterms are marked with ‘d’ or ‘X’ on the K-map, and can take any values of 1 or 0 if needed to simplify an expression

Page 46: LOGIC SIMPLIFICATION SLIDE

46

Example: Simplify the following Boolean function: f (A,B,C,D) = ∑m ( 1,3,7,11,15) + ∑d (0,2,5)

f(A, B, C, D) = ∏M(4, 6, 8, 9, 10, 12, 13, 14)

0 1 3 2

4 5

12

8 9

13

11

15

7 6

14

10

1 1

1

1

1

dd

d

f (A,B,C,D) = A’B’ + CD

0

0

0

0

0

0

0

0

f (A,B,C,D) = (A’+ C) D