32
EET 1131 Unit 5 Boolean Algebra and Reduction Techniques Read Kleitz, Chapter 5 (but you can skip Section 5-6). Exam #1 (on Units 1 to 4) next week. Homework #5 and Lab #5 due in two weeks. Quiz next week.

EET 1131 Unit 5 Boolean Algebra and Reduction Techniques Read Kleitz, Chapter 5 (but you can skip Section 5-6). Exam #1 (on Units 1 to 4) next week

Embed Size (px)

Citation preview

Page 1: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

EET 1131 Unit 5Boolean Algebra and Reduction Techniques

Read Kleitz, Chapter 5 (but you can skip Section 5-6).

Exam #1 (on Units 1 to 4) next week.

Homework #5 and Lab #5 due in two weeks.

Quiz next week.

Page 2: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

Reduction Techniques

Reduction techniques let us take a digital circuit and reduce it to a simpler but equivalent circuit.

Example: The two circuits show below are equivalent to each other. (In other words, whenever you give them both the same inputs, they’ll produce the same output.)

Page 3: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

Two Primary Techniques

The two primary manual reduction techniques are:1. Boolean algebra: a set of rules that let us

transform Boolean expressions into equivalent Boolean expressions.

2. Karnaugh maps (also called K-maps): similar to truth tables.

Karnaugh maps provide a step-by-step procedure. If you follow the steps correctly, you’ll get the right answer. Boolean algebra requires more ingenuity on your part.

Page 4: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Boolean Addition and Multiplication

The OR operation is often called Boolean addition. Variables that are ORed together form a sum term.

The AND operation is often called Boolean multiplication. Variables that are ANDed together form a product term.

The expression (A+B+C)(D+E) is the product of two sum terms.The expression AB + CD + AD is the sum of three product terms.

Page 5: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Commutative Laws

The order in which variables are ORed makes no difference.

The commutative law of addition states that

A + B = B + A

The order in which variables are ANDed makes no difference.

The commutative law of multiplication states that

AB = BA

Page 6: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Associative Laws

When ORing more than two variables, the result is the same regardless of the grouping of the variables.

The associative law of addition states that

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

The associative law of multiplication states that

When ANDing more than two variables, the result is the same regardless of the grouping of the variables.

A(BC) = (AB)C

Page 7: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Distributive Law

The distributive law is the factoring law. A common variable can be factored from an expression just as in ordinary algebra. That is

AB + AC = A(B+ C)

The distributive law can be illustrated with equivalent circuits:

B + CC

AX

BAB

B

X

A

CA

AC

AB + ACA(B+ C)

Page 8: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Rules of Boolean Algebra

3. A + 0 = A

4. A + 1 = 1

1. A . 0 = 0

2. A . 1 = A

6. A + A = A

5. A . A = A

8. A + A = 1

7. A . A = 0

9. A = A=

10. A + AB = A + B

Page 9: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

DeMorgan’s Theorems

The complement of a product of variables is equal to the sum of the complemented variables.

DeMorgan’s 1st Theorem

AB = A + B

Applying DeMorgan’s first theorem to gates:

OutputInputs

A B AB A + B

0011

0101

1110

1110

A + BA

BAB

A

B

NAND Negative-OR

Page 10: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

DeMorgan’s Theorems

DeMorgan’s 2nd Theorem

The complement of a sum of variables is equal to the product of the complemented variables.

A + B = A . B

Applying DeMorgan’s second theorem to gates:

A B A + B AB

OutputInputs

0011

0101

1000

1000

ABA

BA + B

A

B

NOR Negative-AND

Page 11: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Apply DeMorgan’s theorem to remove the overbar covering both terms from the expression X = C + D.

DeMorgan’s Theorems

To apply DeMorgan’s theorem to the expression, you can break the overbar covering both terms and change the sign between the terms. This results inX = C . D. Deleting the double bar gives X = C . D. =

Page 12: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

NAND equals “Negative OR”

Page 13: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

NOR equals “Negative AND”

Page 14: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

Alternative Symbols for Inverter, NAND, and NOR

Page 15: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

A

C

D

B

Boolean Analysis of Logic Circuits

Combinational logic circuits can be analyzed by writing the expression for each gate and combining the expressions according to the rules for Boolean algebra.

Apply Boolean algebra to derive the expression for X.

Write the expression for each gate:

Applying DeMorgan’s theorem and the distribution law:

C (A + B )

= C (A + B )+ D

(A + B )

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

X

Page 16: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Boolean Analysis of Logic Circuits

Use Multisim to generate the truth table for the circuit in the previous example.Set up the circuit using the Logic Converter as shown. (Note that the logic converter has no “real-world” counterpart.)

Double-click the Logic Converter to open it. Then click on the conversion bar on the right side to see the truth table for the circuit (see next slide).

Page 17: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Boolean Analysis of Logic Circuits

The simplified logic expression can be viewed by clicking

Simplified expression

Page 18: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

NAND gates are sometimes called universal gates because they can be used to produce the other basic Boolean functions.

Universal Gates

Inverter

AA

AND gate

AB

AB

A

BA + B

OR gate

A

B

A + B

NOR gate

Page 19: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

NOR gates are also universal gates and can form all of the basic gates.

Universal Gates

Inverter

AA

OR gate

AB

A + B

A

BAB

AND gate

A

B

AB

NAND gate

Page 20: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Simplifying NAND Circuits

Recall that, according to Demorgan’s theorem, the following two representations of a NAND gate are equivalent:

OutputInputs

A B AB A + B

0011

0101

1110

1110

A + BA

BAB

A

B

NAND Negative-OR

In many cases, this lets you redraw all-NAND circuits in ways that are much easier to read. See example on next slide.

Page 21: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

For example, the following circuit uses the two equivalent symbols for a NAND gate:

Simplifying NAND Circuits

C

A

B

A

CA + A BX =

The logic is easy to read if you (mentally) cancel the two connected bubbles on a line.

Page 22: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Sum-of-Products form

A Boolean expression is in sum-of-products form (SOP) when it’s written as the sum of one or more products. In SOP form, an overbar cannot extend over more than one variable.

Examples of expressions in SOP form:

The book also discusses product-of-sums form (POS), in which two or more sum terms are multiplied, as in the following examples:

SOP form is more widely used than POS form.

A B C + A B A B C + C D AB +AC + D

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

Page 23: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

SOP and POS forms

Many Boolean expressions are in neither SOP form nor POS form.

Example 1: A(B + C + BC) + (AB + AB)C

Example 2: AB + C(AD + BD)

But every expression can be converted to SOP form by applying some or all of the following: DeMorgan’s theorems, the distributive law, and the commutative law.

Page 24: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

REVIEW: Writing the SOP Expression for any Truth Table

Given the truth table for a circuit, it’s easy to write an SOP-form expression for that circuit.

Step 1. For each of the truth table’s rows with a 1 in the output column, list the corresponding product term of the input variables.

Step 2. Add all of the product terms from Step 1.

See example on next slide…

Page 25: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Example: Writing the SOP Expression for a Truth Table

A B C X

0 0 0 0

0 0 1 0

0 1 0 1

0 1 1 1

1 0 0 0

1 0 1 1

1 1 0 0

1 1 1 0

Page 26: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

Writing the Truth Table for any SOP Expression

Given an SOP expression , it’s easy to write the truth table.

Step 1. Based on the number of input variables, build the truth table’s input columns.

Step 2. For each product term in the SOP expression, place a 1 in the truth table’s output column for all rows that make the product term a 1.

Step 3. After completing Step 2 for all product terms in the SOP expression, place a 0 in the output column for all other rows.

Page 27: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

The Karnaugh map (K-map) is a tool for simplifying expressions with 3 or 4 variables. For 3 variables, 8 cells are required (23).

The map shown is for three variables labeled A, B, and C. Each cell represents one possible product term.

Each cell differs from an adjacent cell by only one variable.

ABC

ABC

ABC

ABC

ABC

ABC

ABC

ABC

Karnaugh maps

Page 28: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

ABC

ABC

ABC

ABC

ABC

ABC

ABC

ABC

AB

AB

AB

AB

C C

Cells in a K-map must be labeled in the order shown.

Karnaugh maps

C C

AB

AB

AB

AB

C C

AB

AB

AB

AB ABC

ABC

Read the terms for the yellow cells.

The cells are ABC and ABC.

Page 29: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

1. Group the 1’s into two overlapping groups as indicated.

2. Read each group by eliminating any variable that changes across a boundary.

3. The vertical group is read AC.

K-maps can simplify combinational logic by grouping cells and eliminating variables that change.

Karnaugh maps

1

1 1

ABC

00

01

11

10

0 1

1

1 1

ABC

00

01

11

10

0 1

Group the 1’s on the map and read the minimum logic.

B changes across this boundary

C changes across this boundary

4. The horizontal group is read AB.

X = AC +AB

Page 30: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

Karnaugh Map Procedure1. If you’re starting with a Boolean expression that is not

in SOP form, convert it to SOP form.2. Set up the K-map, labeling its rows and columns.3. Place 1s in the appropriate squares.4. Group adjacent 1s in groups of 8, 4, 2, or 1. You want

to maximize the size of the groups and minimize the number of groups. Follow this order:

a. Circle any octet.b. Circle any quad that contains one or more 1s that haven’t

already been circled, using the minimum number of circles.

c. Circle any pair that contains one or more 1s that haven’t already been circled, using the minimum number of circles.

d. Circle any isolated 1s that haven’t already been circled.5. Read off the term for each group by including only

those complemented or uncomplemented variables that do not change throughout the group.

6. Form the OR sum of the terms generated in Step 5.

Page 31: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

A 4-variable map has an adjacent cell on each of its four boundaries as shown.

AB

AB

AB

AB

CD CD CD CDEach cell is different only by one variable from an adjacent cell.

Grouping follows the rules given in the text.

The following slide shows an example of reading a four variable map using binary numbers for the variables…

Karnaugh maps

Page 32: EET 1131 Unit 5 Boolean Algebra and Reduction Techniques  Read Kleitz, Chapter 5 (but you can skip Section 5-6).  Exam #1 (on Units 1 to 4) next week

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights Reserved

X

Karnaugh maps

Group the 1’s on the map and read the minimum logic.

1. Group the 1’s into two separate groups as indicated.

2. Read each group by eliminating any variable that changes across a boundary.

3. The upper (yellow) group is read as

AD. 4. The lower (green) group is read

as AD.

ABCD

00

01

11

10

00 01 11 10

1 1

1 1

1

1

1

1

ABCD

00

01

11

10

00 01 11 10

1 1

1 1

1

1

1

1

X = AD +AD

B changes

C changes

B changes

C changes across outer boundary