390 likes | 662 Views
Chapter 2A EGR 270 – Fundamentals of Computer Engineering. Reading Assignment: Chapter 2 in Logic and Computer Design Fundamentals, 4 th Edition by Mano . Chapter 2 - Boolean Algebra - comparison to regular algebra Any algebra is built upon : 1) A set of elements
E N D
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Reading Assignment:Chapter 2 in Logic and Computer Design Fundamentals, 4th Edition by Mano Chapter 2 - Boolean Algebra - comparison to regular algebra Any algebra is built upon: 1) A set of elements 2) A set of operators 3) A set of postulates Boolean Algebra is built upon: 1) A set of elements: {0, 1} 2) A set of operators: {+, • } – Define these in class 3) A set of postulates: the Huntington Postulates are the most common
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Huntington Postulates – The following 6 postulates, along with the set of elements and set of operators shown above, uniquely and completely define Boolean algebra. 1) Closure for the operations {+, • } - Discuss 2) Two identity elements: - Illustrate by showing all possible values for x A) 0: 0 + x = x + 0 = x B) 1: 1 • x = x • 1 = x 3) Commutative Laws: - Illustrate by showing all possible values for x and y A) x + y = y + x B) xy = yx
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 4) Distributive Laws: - Prove by truth table A) x • (y + z) = xy + xz B) x + yz = (x + y) • (x + z)
Chapter 2A EGR 270 – Fundamentals of Computer Engineering x x’ 4 0 1 1 0 5) Existence of a Complement: - Illustrate by considering all possible values for x Define by the following truth table: Related postulates: A) x + x’ = 1 B) x • x’ = 0 6) At least two non-equal elements: {0, 1} - Discuss
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 5 Common Theorems Boolean algebra has already been completely defined. Additional theorems are also often used, not because they are required, but because they are useful. Some of the most common theorems are shown below. Note that each theorem could be formally proven using the postulates. 1) Idempotency: (“same power”) A) x + x = x – Illustrate by trying all possible values for x B) x • x = x Example: Show related examples using this theorem.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 2) (no name) – Discuss A) x + 1 = 1 B) x • 0 = 0 3) Involution: – Discuss and illustrate using NOT gates x’’ = = x 4) Associative Laws: – Discuss and illustrate using logic gates A) x + (y + z) = (x + y) + z B) x(yz) = (xy)z
Chapter 2A EGR 270 – Fundamentals of Computer Engineering DeMorgan’sTheorems: Note: These theorems are not obvious and can be tricky. Hint: Apply to one operation at a time (OR or AND). Prove 5A by truth table Example: Show related examples using DeMorgan’s theorem.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 6) Absorption: A) x + xy = x B) x (x+y) = x Example: Show related examples. 7) (no name) A) x + x’y = x + y B) x (x’ + y) = xy Example: Show related examples.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 8) Concensus: A) xy + x’z + yz = xy + x’z B) (x + y)(x’ + z)( y + z) = (x + y)(x’ + z) Example: Show related examples.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Operation Precedence Parentheses Higher NOT AND OR Lower Order of operations – The following precedence is used to evaluate logic operations: . Note that the same order of operations is used in Excel, C++, and MATLAB Example: In which order are the operations performed for the following function? f = ab+cd Note: spacing is often used to make it clearer: f = ab + cd Example: Evaluate the following expression (show each step): F = 10 + (1 1’1)’(1+0’) + (0+1’)10
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Boolean Functions – Simplifying Boolean functions corresponds to minimizing the amount of circuitry (logic gates) to be used. Minimizing Boolean functions No specific rules. In general we use Boolean algebra (postulates and theorems) to reduce the number of terms, literals, logic gates, or integrated circuits (Ics). Literal– a primed (complemented) or unprimed variable. In counting literals, we count all occurrences of each literal. Truth table Boolean function Minimize with Boolean algebra Implement with logic circuits Example: How many literals are in the expression f = ab + a’c + bc’d ? (Answer: 7)
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Examples – Minimize the following Boolean functions: 1) F = AB + A(B + C) + B(B + C) F = AB’(C + BD) + A’B’
Chapter 2A EGR 270 – Fundamentals of Computer Engineering F(A,B,C,D) = A + A’BC + C’ F = [(x’y)’ + z’]’
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 5) 6) f(x,y,z) = x’y(z + y’x) + y’z
Chapter 2A EGR 270 – Fundamentals of Computer Engineering 7)
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Example: A) Find F’ for the function below using DeMorgan’s theorem. B) Find truth tables for F and for F’ for the function below. Are they opposites? Complement of a Function A function F’ has the exact opposite truth table as function F.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering • Canonical and Standard forms • Boolean functions are commonly expressed using the following forms: • Canonical forms: • Sum of minterms • Product of maxterms • Standard forms: • Sum of products (SOP) • Product of sums (POS) • Note: These 4 forms will be used regularly throughout the course. • Many designs begin by expressing functions in Sum of minterms or Product of maxterms forms. • When we minimize expressions the result is typically minimal SOP or minimal POS form.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Minterm – (also called a standard product) A minterm is a term containing all n variables (complemented or uncomplemented) ANDed together. Example:f(A,B) has 4 possible minterms. List them. • Each minterm represents one n-bit word where: • Primed variable 0 • Unprimed variable 1 • Minterm designation: for function f(x,y,z) the input combination 000 represents minterm x’y’z’ and is designated m0. xyz = 000 x’y’z’ m0
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Example:Show all 8 possible minterms and the shorthand designations for f(x, y, z).
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Key Point: A Boolean function F may be represented by a sum (ORed together) of its minterms. They represent the input combinations needed to yield F = 1. So minterms represent the 1’s in the truth table for F. Example:Pick a truth table for some function f(x,y,z) and represent f as a sum of minterms.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Maxterm – (also called a standard sum) A maxterm is a term containing all n variables (complemented or uncomplemented) ORed together. Example:f(A,B) has 4 possible maxterms. List them. • Each maxterm represents one n-bit word where: • Primed variable 1 • Unprimed variable 0 • (note that this is opposite of the notation used for minterms) • Maxterm designation: for function f(x,y,z) the input combination 000 represents maxterm (x + y + z) and is designated M0. xyz = 000 x+y+z M0
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Example:Show all 8 possible maxterms and the shorthand designations for f(x, y, z).
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Key Point: A Boolean function F may be represented by a product (ANDed together) of its maxterms. They represent the input combinations needed to yield F = 0. So maxterms represent the 0’s in the truth table for F. Example:Pick a truth table for some function f(x,y,z) and represent f as a product of maxterms.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Relationship between minterms and maxterms Example: Illustrate the relationships above with any minterm or maxterm.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Conversion between forms Since minterms represent where F = 1 and maxterms represent where F = 0, all terms are either minterms or maxterms. So if F is expressed as a sum of minterms, then F is a product of the maxterms (the terms that were not minterms). So it is simple to convert between forms. Example:Convert to the other canonical form 1. F(A, B) = (0, 1) 2. F(x, y, z) = (0, 1) 3. F(x, y, z) = (4, 5, 6) 4. F(a, b, c, d, e) = (0-4, 8, 13-18)
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Conversion to sum of minterms or product of maxterms forms from other forms Possible approaches include Boolean algebra and truth tables. Examples:Represent each function below as a sum of minterms: 1. F(A, B) = A 2. F(x, y, z) = xy + z
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Examples: Represent each function below as a product of maxterms: 1. F(A, B) = A’B + AB’ 2. F(x, y, z) = x’ + y’
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Standard Forms Canonical forms are not minimized and are not useful for many circuit implementations. Standard forms are more useful. Functions are typically minimized into one of the two standard forms: Sum of Products (SOP) : F = sum of ANDed terms (but not necessarily minterms) 2. Product of Sums (POS) : F = product of ORed terms (but not necessarily maxterms) Sum term (variables ORed) Product term (variables ANDed) Sum (Products ORed) Product (Sums ANDed)
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Example: Determine the type of expression in each case below.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Example: Function F(A,B,C) has the following truth table. Express F in each of the following forms: 1. Sum of minterms 2. Product of maxterms 3. Minimal SOP 4. Minimal POS
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Standard Forms: 2-Level Implementations Standard forms are referred to as “2-level implementations” because they can be implemented with two levels gates (and thus only two gate delays). Note that this does not include initial inverters. Example: Implement a SOP expression using logic gates to illustrate that it is a 2-level implementation. Example: Implement a POS expression using logic gates to illustrate that it is a 2-level implementation.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Non-standard forms: 4 commonly used forms have been covered (sum of minterms, product of maxterms, SOP, and POS). These forms will be used throughout the course. There are, however, other non-standard forms. • Example: The following function is in non-standard form: • F = A(B + C(D+E(G+HJ))) • Draw the logic diagram. How many gate delays are there? • Expand F into minimal SOP form and draw the logic diagram. How many gate delays are there?
Chapter 2A EGR 270 – Fundamentals of Computer Engineering • Basic functions/gates and their truth tables: • We previously defined two functions with two or more inputs: AND, OR. • How many possible 2-input logic functions could be defined (consider the diagram shown below)? (Answer: 16) • How many correspond to actual gates (commercially available)? (Answer: 6) 6 commonly defined 2-input logic functions/gates: 1. AND 4. NOR 2. OR 5. XOR (Exclusive-OR) NAND 6. XNOR (Exclusive-NOR or Equivalence) The AND and OR gates have already been defined. The remaining 4 gates will be discussed on the following slides.
Chapter 2A EGR 270 – Fundamentals of Computer Engineering NAND: Show logic symbol, truth table, and logic expressions: NOR: Show logic symbol, truth table, and logic expressions:
Chapter 2A EGR 270 – Fundamentals of Computer Engineering XOR: Show logic symbol, truth table, and logic expressions: XNOR: Show logic symbol, truth table, and logic expressions:
Chapter 2A EGR 270 – Fundamentals of Computer Engineering Other Logic Symbols: (We won’t use these in this course.)