advertisement

CHAPTER 2 BOOLEAN ALGEBRA LOGIC AND LOGIC GATES Basic Theorems and Properties of Boolean Algebra: Duality - We simply interchange OR and AND operators and replace 1’s by 0’s and 0’s by 1’s. Also, the duality principle states that if two Boolean expressions are equal, then their duals are also equal. Ex: X + 0 = X & X ·1 = X Basic Theorem - Boolean Addition: o x + 0 = 0 + x = x (0 is called the additive identity) o x + 1 = 1 (X = AB + C AB + C + 1 = 1) - Boolean Multiplication o x·0=0 o x · 1 = 1· x = x (1 is called the multiplicative identity) - Idempotent Laws o x+x=x o xx=x - Involution Law o (x')' = x - Laws of Complement o x + x' = 1 o x · x' = 0 - Commutative Laws o x+y=y+x o xy=yx - Associative Laws o (x + y) + z = x + (y + z) = x + y + z o (x · y) · z = x (y · z) = x · y · z - Distributive Law o x · (y + z) = (x · y) + (x · z) o x + (y · z) = (x + y) · (x + z) - DeMorgan's Laws o (x + y)' = x' y' o (x · y)' = x' + y' - Consensus Law o x · y + x' · z + y · z = x · y + x' · z The term yz is referred to as the "consensus term". A consensus term is a redundant term and it can be eliminated. Given a pair of terms for which a variable appears in one term and the complement of that variable in another term, the consensus term is formed by multiplying the two original terms together, leaving out the selected variables and its complement. - A field is a set of elements, together with two binary operators. - - The set of real numbers together with the binary operators + and · form the field of real numbers. The field of real numbers is the basis for arithmetic and ordinary algebra. The operators and postulates have the following meanings: o The binary operator + defines addition. o The additive identity is 0. o The additive inverse defines subtraction. o The binary operator · defines multiplication. o The multiplicative identity is 1. o The multiplicative inverse of a = 1/a defines subtraction, i.e. a · 1/a = 1. o The only distributive law applicable is that of · over +: a · (b + c) = (a · b) + (a · c) A two-valued Boolean Algebra is defined on a set of 2 elements, B = {0, 1}, with rules for the 2 binary operators + and · x y 0 0 1 1 x· y 0 1 0 1 0 0 0 1 x y z 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 x y 0 0 1 1 y+z 0 1 0 1 0 1 0 1 x+y 0 1 0 1 0 1 1 1 x · (y + z) 0 1 1 1 0 1 1 1 0 0 0 0 0 1 1 1 x·y x x’ 0 1 1 0 x·z (x · y) + (x · z) 0 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 0 0 0 0 0 0 1 1 Truth table to verify the Distributive Law. A) X Y X+Y X’ + Y’ 0 0 1 1 0 1 0 1 0 1 1 1 1 0 0 0 Truth table to verify DeMorgan’s Law. (x + y)’ = x’ y’ B) X Y X’ Y’ X’ · Y’ 0 0 1 1 0 1 0 1 1 1 0 0 1 0 1 0 1 0 0 0 (x · y)’ = x’ + y’ Logic Gates Operator Precedence - The operator precedence for evaluating Boolean expressions is (1) (), (2) NOT, (3) AND, and (4) OR. Ex: (x + y)’. Venn Diagram - See Fig. 2 – 1, 2 – 2 Page 44. Boolean Functions - A Boolean function is an expression formed with binary variables, the 2 two binary operators OR and AND, and unary operator NOT, parentheses, and an equal sign. For a given value of the variables, the function can be either 0 or 1. - Ex: F1 = xyz’. The function is equal to 1 if x = 1 and y = 1 z’ = 1; otherwise F1 = 0. - To represent a function in a truth table, we a list of 2n combinations of 1’s and 0’s of n binary variables and a column to show the combination for which the function = 0, 1. Table 2-2 Truth tables for F1 = xyz’, F2 = x + y’z, F3 = x’y’z + x’yz + xy’, and F4 = xy’ + x’z - x y z F1 F2 F3 F4 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 1 0 0 1 0 0 1 1 1 1 0 1 0 1 1 1 0 0 0 1 0 1 1 1 0 0 Two functions of n binary values are said to be equal if they have the same value for all possible 2n combination of the n variables. F3 and F4 A Boolean function may be transformed from an algebraic expression into a logic diagram composed of AND, OR, and NOT gates. Fig. 2 – 4. Since are F3 and F4 equal Boolean functions, it is more economical to implement the F4 form than the F3 form. Algebraic Manipulation - - A literal is a primed or unprimed variable. When a Boolean function is implemented with logic gates. Each literal in the function designates an input to a gate, and each term is implemented with a gate. The number of literals in a Boolean function can be minimized by algebraic manipulations. There are no specific rules to follow that will guarantee the final answer. The only method available is a cut-and-try procedure employing postulates, basic theorems, and other manipulation method that becomes familiar with use. Ex: Simplify the following Boolean functions to a minimum number of literals. x + x’ y = (x + x’) (x + y) = 1 (x + y) = x + y x (x’ + y) = (x x’) + (x y) = 0 + xy = xy x’ y’ z + x’ y z + x y’ = x’ z (y + y’) + x y’ = x’ z + x y’ x y + x’ z + y z = x y + x’ z + y z (x + x’) = x y + x’ z + x y z + x’ y z = x y (1 + z) + x’ z (1 + y) = x y + x’ z 5. (x + y) (x’ + z) (y + z) = (x + y) (x’ + z) by duality from function 4. 1. 2. 3. 4. (x + y) (x’ + z) (y + z) = (x · x’ + x · z + x’ · z + y · z) (y + z) 0 = (x · y· z + x · z · z + x’ · y · y + x’ · y · z + y · z · z + y · z · z) z y z z = (x · y· z + x · z + x’ · y + x’ · y · z + y · z) = x · z (1 + y) + x’ · y (1 + z) + y · z = 1 1 = x · z + x’ · y + y · z = x · x’ + x · z + x‘ · y + y · z =0 = (x + y) (x’ + z) - Functions 1 and 2 are the duals of each other and use dual expressions in corresponding steps. Complement of a function - The complement of a function F is F’ and is obtained from an interchange of 0’s for 1’s and 1’s for 0’s in the values of F. The complement of a function may be derived algebraically through DeMorgan’s - (A + B + C + D + … + F)’ (A B C D … F)’ - The generalized form of DeMorgan’s theorem states that the complement of a function is obtained by interchanging AND and OR operates and complementing each literal. F1 = x’ y z’ + x’ y’ z F’1 = (x + y’ + z) (x + y + z’) F2 = x (y’ z’ + y z) F’2 = x’ + (y + z) (y’ + z’) - - = A’ B’ C’ D’ … F’ = A’ + B’ + C’ + D’ + … + F’ Representations of A Function - A function can be specified or represented in any of the following ways: o A truth table o A circuit o A Boolean expression SOP (Sum Of Products) POS (Product of Sums) Canonical SOP Canonical POS Canonical And Standard Forms Minterms and Maxterms - A binary variable may appear in normal form (x) or in complement form (x’) - Ex: Two binary variables x and y combined with an AND gate. There are four combinations: x’y’, x’y, xy’, & xy. - Each of these four AND terms represents one of the distinct areas in the Venn diagram and is called a minterm or a standard product. - Similarly, n variables can be combined to form 2n minterms. The 2n different minterms may be determined by a method similar to the table shown below. - Each minterm is obtained from an AND term of the n variables, with each variable being primed if the corresponding bit of the binary number is a 0 and unprimed if a 1. - In a similar fashion, n variables can be combined to form 2n maxterms or standard sums. The 2n different maxterms may be determined by a method similar to the table shown below. - Each maxterm is obtained from an OR term of the n variables, with each variable being primed if the corresponding bit of the binary number is a 1 and unprimed if a 0. - Each maxterm is the complement of its corresponding minterm, and vice versa. - A Boolean function may be expressed algebraically from a given truth table by forming a minterm for each combination of the variables that produces a 1 in the function and then taking the OR of those terms. Minterms Maxterms x y z Term Designation Term 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 x' y' z' x' y' z x' y z' x' y z x y' z' x y' z x y z' xyz m0 m1 m2 m3 m4 m5 m6 m7 x+y+z x + y + z' x + y' + z x + y' + z' x' + y + z x' + y + z' x' + y' + z x' + y' + z' Designation M0 M1 M2 M3 M4 M5 M6 M7 - Ex: the function in the following table is determined by expressing the combination of 001, 100, and 111 as x’y’z, xy’z’, and xyz. Since each one of these minterms results in f1 =, we should have f1 = x’y’z + xy’z’ + xyz = m1 + m4 + m7 - Similarly, we can verify that f2 = x’yz + xy’z + xyz’ + xyz = m3 + m5 + m6 + m7 - The complement of f1 is “may be read from the truth table by forming a minterm for each combination that produces a 0 in the function and then ORing those terms”: f’1 = x’y’z’ + x’yz’ + x’yz + xy’z + xyz’ Functions of Three Variables x 0 0 0 0 1 1 1 1 y 0 0 1 1 0 0 1 1 z 0 1 0 1 0 1 0 1 Function f1 0 1 0 0 1 0 0 1 Function f2 0 0 0 1 0 1 1 1 If we take the complement of f’1, we obtain the function f1: f1 = (x + y + z) (x + y’ + z) (x + y’ + z’) (x’ + y + z’) (x’ + y’ + z) = M0 · M2 · M3 · M5 · M6 - Similarly, it is possible to read the expression for f2 from the table: f2 = (x + y + z) (x + y + z’) (x + y’ + z) (x’ + y + z’) (x’ + y + z) = M0 · M1 · M2 · M4 - - Boolean functions expressed as a sum of minterms or products of maxterms are said to be in canonical form Sum of Minterms Truth Table for F = A + B’ C A B C F 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 1 1 F (A, B, C) = Σ (1, 4, 5, 6, 7) Ex: Express the function F = A + B’C in a sum of minterms. The function has 2 variables. Term A is missing 2 variables: A = A (B + B’) = AB + AB’ Now A is missing 1 variable A = AB (C + C’) + AB’ (C + C’) A = ABC + ABC’ + AB’C + AB’C’ B’C is missing one variable: B’C = B’C (A + A’) = AB’C + A’B’C Now we combine terms F = ABC + ABC’ + AB’C + AB’C’ + AB’C + A’B’C = A’B’C + AB’C’ + AB’C + ABC’ + ABC = m1 + m4 + m5 + m6 + m7 F (A, B, C) = Σ (1, 4, 5, 6, 7) Product of Maxterms Truth Table for F = xy + x’z x y z F 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 1 1 The sum of minterms is F (x, y, z) = Σ (1, 3, 6, 7) The sum of maxterms is F (x, y, z) = ∏ (0, 2, 4, 5) Ex: Express the Boolean function F = xy + x’z in a product of maxterms. Convert the function into OR terms using the distributive law: F = xy + x’y = (xy + x’) (xy + z) = (x + x’) (y + x’) (x + z) (y + z) = (x’ + y) (x + z) (y + z) The function has 3 variables: x, y, & z. Each OR term is missing one variable: x’ + y = x’ + y + zz’ = (x’ + y +z) (x’ + y + z’) x + z = x + z + yy’ = (x + y + z) (x + y’ + z) y + z = y + z + xx’ = (x + y + z) (x’ + y + z’) Combine the terms and remove the terms that appear more than once: F = (x + y + z) (x + y’ + z) (x’ + y +z) (x’ + y + z’) = M0 + M2 + M4 + M5 The function is expressed as follows: F (x, y, z) = ∏ (0, 2, 4, 5) Conversion between Canonical Forms - Ex: The complement of F (A, B, C) = Σ (1, 4, 5, 6, 7) is F’ (A, B, C) = Σ (0, 2, 3) = m0 + m2 + m3 - If we apply the complement of F’ using DeMorgan’s theorem, we obtain F in a different form: F = (m0 + m2 + m3)’ = m’0 · m’2 · m’3 = M0 + M2 + M3 = ∏ (0, 2, 3) - The last conversion follows from the definition of minterms and maxterms. It is clear that the following relation holds true: m’j = Mj the maxterm with subscript j is a complement of the minterm with the same subscript j, and vice versa. - To convert from one canonical form to another, interchange the symbol Σ and ∏ and list those numbers missing from the original form. Integrated Circuits “IC” - It’s a small silicon semiconductor, called a chip, containing the electronic components for the digital gates. The gates are interconnected inside the chip to form the required circuit. Levels of Integration - Small-scale Integration (SSI): contains several independent gates in a single package. The number of gates is usually fewer than 10. - Medium-scale Integration (MSI): have a complexity between 10 and 100 gates in a single package. They perform specific digital operations such as decoders, adders, and multiplexers. - Large-scale Integration (LSI): contains between 100 and 1000s gates in a single package. The number of gates is usually fewer than 10. They include processors, memory chips, and programmable logic devices. - Very Large-scale Integration (VLSI): contains thousands of gates in a single package. Examples are large memory arrays and complex microcomputer chips.