1 / 54

Boolean Algebra and Logic Gates

Learn about Boolean algebra operations and logic gates. Understand the concepts of Boolean complement, Boolean sum, Boolean product, and logic gates like NOT, OR, AND, XOR, NAND, and NOR. Explore Boolean functions and their representations.

aguilarr
Télécharger la présentation

Boolean Algebra and Logic Gates

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. King ABDUL AZIZ UniversityFaculty Of Computing and Information Technology CPCS 222 Discrete Structures I Boolean Algebra Dr. Eng. Farag Elnagahy farahelnagahy@hotmail.com Office Phone: 67967

  2. Boolean Functions • Boolean algebra provides the operations and the rules for working with the set {0, 1}. • Electronic and optical switches can be studied using this set and the rules of Boolean algebra. • We are going to focus on three operations: • Boolean complementation, • Boolean sum, and • Boolean product

  3. Boolean Functions and Logic Gates The complement is denoted by a bar. It is defined by 0=1 1=0 The Boolean sum, denoted by + or by OR (inclusive OR), has the following values: 1+1=1 1+0=1 0+1=1 0+0=0 Not Gate “Inverter” OR Gate

  4. Boolean Functions and Logic Gates The Boolean product, denoted by  or by AND, has the following values: 11=1 10=0 01=0 00=0 XOR (exclusive OR)11=0 10=1 01=1 00=0 xy =xy+xy AND Gate XOR Gate

  5. Boolean Functions and Logic Gates NAND and NOR are two very important gates. Their symbols and truth tables are shown below NAND NAND x y = x y NOR x  y= x + y NOR

  6. Boolean Functions

  7. Boolean Functions The complement, Boolean sum, and Boolean product correspond the Logical operators  , ,and  respectively, where 0 corresponds to F , and 1 corresponds to T. 10+ (0+1)=0 Its logical equivalent is (T F)  (F T)  F

  8. Boolean Expressions andBoolean Functions Definition: Let B = {0, 1}. The variable x is called a Boolean variable if it assumes values only from B. A functionfrom Bn, the set {(x1, x2, …, xn) |xiB, 1  i  n}, to B is called a Boolean functionofdegree n. Boolean functions can be represented using expressions made up from the variables and Boolean operations.

  9. Boolean Expressions and Boolean Functions Example: the function F(x,y)=xy from the set of ordered pairs of Boolean variable to the set {0, 1} is a Boolean function of degree 2 with F(1,1)=0, F(1,0)=1, F(0,1)=0, and F(0,0)=0. this function From B2 To B

  10. Boolean Expressions and Boolean Functions • The Boolean expressions in the variables • x1, x2, …, xn are defined recursively as: • 0,1,x1,x2,…,xnare Boolean expressions. • If E1 and E2 are Boolean expressions, then E1, E1E2, and E1+E2 are Boolean expressions. • Each Boolean expression represents a Boolean function. The values of this function are obtained by substituting 0 and 1 for the variables in the expression.

  11. Boolean Expressions and Boolean Functions Example: Find the value of the Boolean function F(x,y,z)=xy+z (this function From B3 To B) Definition: The Boolean functions F and G of nvariables are equal if and only if F(b1, b2, …, bn) = G(b1, b2, …, bn) whenever b1, b2, …, bn belong to B. Two different Boolean expressions that represent the same function are called equivalent. For example, the Boolean expressions xy, xy+0, and xy1 are equivalent

  12. 110 111 101 100 010 011 000 001 Boolean Expressions and Boolean Functions Example: Find the value of the Boolean function F(x,y,z)=xy+z (this function From B3 To B) A Boolean function of degree n can be represented by an n-cube (hypercube) with the corresponding function value at each vertex.

  13. Boolean Expressions and Boolean Functions The complement of the Boolean function F is the function F whereF(b1, b2, …, bn) = F(b1, b2, …, bn) Let F and G be Boolean functions of degree n. The Boolean sumF+G is defined by (F+G)(b1,b2,…,bn) = F(b1,b2, …,bn)+G(b1,b2,…,bn) and Boolean productFG is defined by (FG)(b1,b2, …,bn) = F(b1,b2, …,bn) G(b1,b2, …,bn)

  14. Boolean Expressions and Boolean Functions Question: How many different Boolean functions of degreen are there? Solution: There are 2n different n-tuples of 0s and 1s. A Boolean function is an assignment of 0 or 1 to each of these 2n different n-tuples. Therefore, there are 22n different Boolean functions.

  15. Boolean Expressions and Boolean Functions Question: How many different Boolean functions of degree4 are there? 16

  16. Boolean Expressions and Boolean Functions Question: How many different Boolean functions of degree 1 are there? Solution: There are four of them, F1,F2,F3, and F4

  17. Identities of Boolean algebra

  18. Identities of Boolean algebra

  19. Identities of Boolean algebra

  20. Identities of Boolean algebra

  21. Identities of Boolean algebra (Duality) There are useful identities of Boolean expressions that can help us to transform an expressionAinto an equivalentexpressionB (see previous table) We can derive additional identities with the help of the dual of a Boolean expression. Duality principle The Boolean equation remains valid if we take the dual of the expression on both sides of the equals sign. The dual of a Boolean expression is obtained by interchangingBoolean sums and Boolean products and interchanging0s and 1s.

  22. Identities of Boolean algebra (Duality) Examples: The dual of x(y + z) is x + yz The dual of x1 + (y + z) is (x + 0) ( y . z). The dual of a Boolean function F represented by a Boolean expression is the function represented by the dual of this expression. This dual function, denoted by Fd, does not depend on the particular Boolean expression used to represent F.

  23. Identities of Boolean algebra (Duality) Therefore, an identity between functions represented by Boolean expressions remains valid when the duals of both sides of the identity are taken. We can use this fact, called the duality principle, to derive new identities. For example, consider the absorption lawx(x + y) = x. By taking the duals of both sides of this identity, we obtain the equation x + xy = x, which is also an identity (and also called an absorption law).

  24. Definition of a Boolean Algebra All the properties of Boolean functions and expressions that we have discovered also apply toother mathematical structuressuch as propositions and sets and the operations defined on them. If we can show that a particular structure is a Boolean algebra, then we know that all results established about Boolean algebras apply to this structure. For this purpose, we need anabstract definitionof a Boolean algebra.

  25. Definition of a Boolean Algebra Definition: A Boolean algebra is a set B with twobinary operations and , elements0 and 1, and a unary operation – such that the following properties hold for all x, y, and z in B: x  0 = x and x  1 = x (identity laws) x  (x) = 1 and x  (x) = 0 (Complement laws) (x  y)  z = x  (y  z) and (x  y)  z = x  (y  z) and (associative laws) x  y = y  x and x  y = y  x (commutative laws) x  (y  z) = (x  y)  (x  z) andx  (y  z) = (x  y)  (x  z) (distributive laws)

  26. Exercises pp. (756-757) 1-3 5 7 9-10 12-13 24-28

  27. Representing Boolean Functions • Two important problems of Boolean algebra will be studied in the next slides: • Given the value of a Boolean function, how can a Boolean expression that represents this function be found? • Is there a smaller set of operators that can be used to represent all Boolean functions?

  28. Representing Boolean Functions • Any Boolean function can be represented as a : • Sum of products (SOP) of variables and their complements. Disjunctive normal form (DNF) • Sum-of-products Expansions • Or • Product of sums (POS) of variables and their complements. Conjunctive normal form (CNF) • Product-of-sums Expansions

  29. Representing Boolean Functions • Aliteralis a Boolean variable or its complement. • Amintermof Boolean variablesx1,…,xnis aBoolean product ofnliteralsy1 y2 …yn, whereyiis either the literalxior its complementxi. Notethat the mintermy1 y2 …ynhas the value 1 Iff eachyiis 1. • A maxterm of Boolean variables x1,…,xn is a Boolean sum of n literals y1 y2 …yn, where yi is either the literal xi or its complement xi. Note that the maxterm y1 y2 …yn has the value 0 Iff each yi is 0.

  30. Representing Boolean Functions Minterms and maxterms The table below illustrates the minterms and maxterms forthree inputBoolean variables

  31. Representing Boolean Functions FindBoolean expressions that represent the function F(A,B,C) which is given in the following table.

  32. Representing Boolean Functions Sum-of-products Expansions (DNF) Product -of- sums Expansions (CNF)

  33. Representing Boolean Functions

  34. Representing Boolean Functions

  35. Representing Boolean Functions

  36. Representing Boolean Functions For example

  37. Representing Boolean Functions ExampleFind a minterm that equal 1 ifx1= x3=0 and x2= x4=x5=1 and equals 0 otherwise. The minterm is x1 x2 x3 x4 x5 ExampleFind the sum-of-products expansion for the function F(x,y,z)=(x+y)z (truth table) F(x,y,z)=(x+y)z =xz+yzDistributive law =x1z+1yzIdentity law =x(y+y)z+(x+x)yzUnity law =xy z+xyz+xyz+xyzDistributive law =xy z+xyz+xyzIdempotent law

  38. Representing Boolean Functions • Is there a smaller set of operators that can be used to represent all Boolean functions? Every Boolean function can be represented using the Boolean operators + , . , and . So, we say that the set {+ , ., } is functionally complete. We can eliminate all the + using this entity Then set { ., } is functionally complete. We can eliminate all the . using this entity Then set { +, } is functionally complete.

  39. Representing Boolean Functions • Is there a smaller set of operators that can be used to represent all Boolean functions? Both of the sets { } and {} are functionally complete. x+y using NAND how? xy using NOR x y = x y NAND NOR x  y= x + y x = x  x x = x  x xy = (x  y)  (x  y) x+y = (x  y)  (x  y)

  40. Representing Boolean Functions Exercises pp. 760 1-6 12-15

  41. Combinations of Gates Logic gates can have one or more inputs Construct the circuit that produces the following output:

  42. Combinations of Gates Construct the circuit that produces the following output:

  43. Combinations of Gates • A committee of three individuals decides issues for an organization. Each individual votes either yes or no for each proposal that arises. A proposal is passedif it receives at leasttwo yes votes. Design a circuit that determines whether a proposal passes. • Sometimes light fixtures are controlled by more than switch. Circuits needed to be designed so that flipping any one of the switches for the fixture turns the light on when it is off and turns the light off when it is on. Design circuits that accomplish this when there are two switches and when there are three switches.

  44. Combinations of Gates (half adder) • Combinational logic circuits give us many useful devices. • One of the simplest is the half adder, which finds the sum of two bits. • We can gain some insight as to the construction of a half adder by looking at its truth table

  45. Combinations of Gates (half adder)

  46. Combinations of Gates (full adder) • We can change our half adder into to a full adder by including gates for processing the carry bit. • The truth table for a full adder is shown below.

  47. Combinations of Gates (full adder)

  48. Exercises pp. (765-766) 1-6 10-11 13-19

  49. Minimization of Circuits • Karnaugh Maps • It is a graphical approach used to simplify a Boolean function (sum of products expansion). • Let F(A,B) be a sum-of-products Boolean expression. To minimize F, we use a rectangular array of two rows and two columns in which rows and columns are labeled as follows: Two variables 22possible Minterms. Each square is called a cell corresponds to a minterm. Cells are called adjacent if the minterms that they represent differ in exactly one literal.

  50. Minimization of Circuits A two-variablesKarnaugh Map If a minterm is present in F(A,B), then we place a 1 in the cell corresponding to the minterm, otherwise the cell is left empty or place a O. The resulting array is called K-map corresponding to the expression

More Related