1 / 39

Exploring Boolean Functions and Standard Forms

Learn about Boolean functions and their different representations in terms of schematic diagrams, truth tables, and Boolean expressions. Understand the concepts of sum-of-products, canonical sum-of-products, product-of-sums, and canonical product-of-sums forms.

khandley
Télécharger la présentation

Exploring Boolean Functions and Standard Forms

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EGR 2131 Unit 3Synthesis • Read Brown & Vranesic, Sections 2.6 to 2.8. • Homework #3 and Lab #3 due next week. • Quiz next week.

  2. Review: Three Ways of Describing a Circuit • To describe a circuit built up from logic gates, we can: • Draw a schematic diagram. • Write a truth table. • Write a Boolean expression.

  3. Boolean Functions • When we draw a schematic diagram, or write a truth table, or write a Boolean expression, we’re specifying a Boolean function, which is a relationship between input variables and an output variable. • Every Boolean function has exactly one truth table, but has many possible Boolean expressions or schematic diagrams.

  4. Boolean Functions (Cont’d.) • When we apply a rule of Boolean algebra to a Boolean expression, we end up with a new Boolean expression. But the original expression and the new expression describe the same Boolean function.

  5. Boolean Functions: Example • The following two Boolean expressions describe the same Boolean function, whose truth table is • xyy • xy • There are many other Boolean expressions (and also many different schematic diagrams) that describe this same Boolean function.

  6. Standard Forms • As noted, a given Boolean function can be expressed by many different Boolean expressions. • Four standard forms of Boolean expressions have been given special names: • Sum-of-products form • Canonical sum-of-products form • Product-of-sums form • Canonical product-of-sums form

  7. Terminology: Boolean “Addition” and “Multiplication” The OR operation is often called Boolean addition, and we say that variables that are ORed together form a sum term. The AND operation is often called Boolean multiplication, and we say that variables that are ANDed together form a product term. The expression (x1+x2+x3)(x4+x5) is the product of two sum terms. Example #1 The expression AB + CD + AD is the sum of three product terms. Example #2

  8. Standard Form #1: 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. • Three examples of expressions in SOP form: • In SOP form, an overbar cannot extend over more than one variable. So the following expression is not in SOP form:

  9. Standard Form #2: Canonical Sum-of-Products Form • Canonical sum-of-products form is a special case of sum-of-products form in which every product term is a minterm. What is a minterm?...

  10. Minterms • A minterm is a special kind of product term in which every input variable appears (either with or without an overbar). • Example: Suppose we’re working on a problem with three input variables x1, x2, and x3. Some minterms are: • On the other hand, is a product term but not a minterm, since x3 is missing.

  11. Shorthand Notation for Minterms • It’s useful to assign a number to each minterm by replacing each non-inverted variable with a 1 and each inverted variable with a 0. • Example (assuming three input variables x1, x2, and x3): • The minterm corresponds to the binary number 100, which is decimal 4, so we’ll call it m4. • Note that we use lowercase m for minterms.

  12. Standard Form #3: Product-of-Sums Form • A Boolean expression is in product-of-sums form (POS) when it’s written as the product of one or more sums. • Three examples of expressions in POS form: • In POS form, an overbar cannot extend over more than one variable. So the following expression is not in POS form:

  13. Standard Form #4: Canonical Product-of-Sums Form • Canonical product-of-sums form is a special case of product-of-sums form in which every sum term is a maxterm. What is a maxterm?...

  14. Maxterms • A maxterm is a special kind of sum term in which every input variable appears (either with or without an overbar). • Example: Suppose we’re working on a problem with three input variables x1, x2, and x3. Some maxterms are: • On the other hand, is a sum term but not a maxterm, since x2 is missing.

  15. Shorthand Notation for Maxterms • It’s useful to assign a number to each maxterm by replacing each non-inverted variable with a 0 and each inverted variable with a 1. • Example (assuming three input variables x1, x2, and x3): • The maxterm corresponds to the binary number 011, which is decimal 3, so we’ll call it M3. • Note that we use uppercase M for maxterms.

  16. Minterms, Maxterms, and Truth Tables • When setting up a truth table, we list all possible values of the input variables. So each row in a truth table corresponds to one minterm and one maxterm, as shown in the book’s Figure 2.17.

  17. Nonstandard Forms • Many Boolean expressions are not in any of the standard forms. • Two examples: • But every expression can be converted to any of the standard forms by using DeMorgan’stheorem, the distributive property, the “double-inversion” theorem, and other rules of Boolean algebra.

  18. Writing the Canonical SOP Expression from a Truth Table • Given the truth table for a function, it’s easy to write the canonical SOP expression for that function. • Step 1. For each row in the truth with a 1 in the output column, list the corresponding minterm of the input variables. • Step 2. Form the OR of the minterms from Step 1. • See example on next slide…

  19. Example Write the canonical SOP expression from this truth table.  = m2  = m3  = m5 f(x1,x2, x3) = = m2+ m3+ m5 = ∑m(2, 3, 5) Math symbol ∑means “sum.”

  20. Writing the Canonical POS Expression from a Truth Table • Given the truth table for a function, it’s easy to write the canonical POS expression for that function. • Step 1. For each row in the truth with a 0 in the output column, list the corresponding maxtermof the input variables. • Step 2. Form the AND of the maxtermsfrom Step 1. • See example on next slide…

  21. Example Write the canonical POS expression from this truth table. •  = M0 •  = M4 • = M6 • = M7 f(x1, x2, x3) = = M0 M4 M6M7 = ∏M(0, 4, 6, 7) Math symbol ∏ means “product.”

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

  23. Logic Diagram from Sum-of-Products Expression • Given an SOP expression, it’s easy to draw the corresponding logic diagram, which will consist of a group of AND gates followed by an OR gate (possibly with some inverters before the AND gates). • Example:

  24. Logic Diagram from Product-of-Sums Expression • Given a POS expression, it’s easy to draw the corresponding logic diagram, which will consist of a group of OR gates followed by an AND gate (possibly with some inverters before the OR gates). Example: f =

  25. Cost of a Circuit • We know that there are many Boolean expressions (and thus many different schematic diagrams) that describe any given Boolean function. • When it’s time to build a circuit that implements the function, we generally prefer to use the least costly expression. • Our measure of cost: the sum of the number of gates plus the number of inputs to these gates.

  26. Cost of a Circuit: Examples • What is the cost of the circuit shown below? • What is the cost of implementing the following function as it’s written?f= x1x2 + x3(x4 + x5)

  27. x x + y Universal Gates NAND gates are sometimes called universal gates because they can be used to produce the other basic Boolean functions. x x xy y Inverter AND gate x x x + y y y OR gate NOR gate

  28. NAND-Only Logic • Because NAND gates are universal gates, and because in most technologies NAND gates are faster and take up less space than AND or OR gates, it’s very common for chips to be manufactured using just NAND gates. • Unfortunately, thinking in terms of NAND is less natural for humans than thinking in terms of AND and OR. The following slides show some tricks to make it easier.

  29. Two Ways to Draw a NAND Gate: “AND-invert” or “Invert-OR” • DeMorgan’s theorem tells us that the following are equivalent: • Mentally “push” the bubble through from input to output (or vice versa), changing the shape as you do so.

  30. Two-Level NAND Implementation • It’s easy to draw a two-level NAND implementation for any SOP expression. Recall that an SOP expression translates directly into a two-level AND-OR circuit such as: 2. Then “absorb” theinverters into the gates. 1. Insert extra inverter pairs.

  31. x x + y NOR Is Also a Universal Gate • What we’ve seen for NAND gates also applies to NOR gates. • First, NOR gates are universal gates and can form all of the basic gates: x x x+ y y Inverter OR gate x x xy y y AND gate NAND gate

  32. Two Ways to Draw a NOR Gate: “OR-invert” or “Invert-AND” • DeMorgan’s theorem also tells us that the following are equivalent: • Again, mentally “push” the bubble through, changing the shape as you do so.

  33. NOR-Only Logic • Using the same sort of techniques we saw above for NAND gates, the book shows how to implement Boolean expressions using only NOR gates.

  34. Summary: Alternative Symbols for Inverter, NAND, and NOR

  35. Design Example: Multiplexer • The book’s Section 2.8 gives two examples of the design process. Each example starts with a verbal description of a design problem and ends with a schematic diagram. • The second of these examples is to design a multiplexer, which is an important type of circuit that we’ll often encounter.

  36. Design Example: Multiplexer (Cont’d.) • Verbal description: “In computer systems it is often necessary to choose data from exactly one of a number of possible sources. Suppose that there are two sources of data, provided as input signals x1 and x2…. We want to design a circuit that produces an output that has the same value as either x1 or x2, dependent on the value of a selection control signal s. Therefore, the circuit should have three inputs: x1, x2, and s. Assume that the output of the circuit will be the same as the value of input x1 if s = 0, and it will be the same as x2 if s = 1.”

  37. Design Example: Multiplexer (Cont’d.) • Truth table from the verbal description: • Canonical SOP expression from the truth table:

  38. Design Example: Multiplexer (Cont’d.) • Simplified SOP expression (after applying some rules of Boolean algebra): • Circuit:

  39. Design Example: Multiplexer (Cont’d.) • The circuit we’ve designed is called a 2-to-1 multiplexer because it has two data inputs, one of which is passed through to the output. • Graphical symbol with distinctive shape: • Also useful are multiplexers with more data inputs, such as 4-to-1 or 8-to-1. Same basic idea, but the circuit will contain more gates.

More Related