Dr. Eng. Farag Elnagahy Office Phone: 67967 King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.

Slides:



Advertisements
Similar presentations
BOOLEAN ALGEBRA. A Mathematical notation used to represent the function of the Digital circuit. A notation that allows variables & constants to have only.
Advertisements

Prof. Sin-Min Lee Department of Computer Science
Boolean Algebra and Combinational Logic
Logic Gate Level Part 2. Constructing Boolean expression from truth table First method: write nonparenthesized OR of ANDs Each AND is a 1 in the result.
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Section 10.3 Logic Gates.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Lecture 3. Boolean Algebra, Logic Gates
Propositional Calculus Math Foundations of Computer Science.
Fall 2002CMSC Discrete Structures1 Yes, No, Maybe... Boolean Algebra.
Chapter 2: Boolean Algebra and Logic Functions
Boolean Algebra أ. زينب آل كاظم 1. Boolean Functions In Boolean algebra we work with the set {0,1}, where: 0 ≡ F (False) & 1 ≡ T (True). The 3 Operations.
11.1 Boolean Functions. Boolean Algebra An algebra is a set with one or more operations defined on it. A boolean algebra has three main operations, and,
Section Section Summary Introduction to Boolean Algebra Boolean Expressions and Boolean Functions Identities of Boolean Algebra Duality The Abstract.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
1 Logic Gates Digital Computer Logic Kashif Bashir WWW:
1 COMBINATIONAL LOGIC One or more digital signal inputs One or more digital signal outputs Outputs are only functions of current input values (ideal) plus.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Applied Discrete Mathematics Week 13: Boolean Algebra
Boolean Algebra and Digital Circuits
Switching functions The postulates and sets of Boolean logic are presented in generic terms without the elements of K being specified In EE we need to.
Department of Computer Engineering
1 The Chinese University of Hong Kong Faculty of Education Diploma in Education (Part-Time) Winter 1997 Educational Communications and Technology Assignment.
Combinational Logic 1.
Discrete Mathematics and Its Applications.  The English mathematician George Boole ( ) sought to give symbolic form to Aristotle's system of.
Chapter 2 Two- Level Combinational Logic. Chapter Overview Logic Functions and Switches Not, AND, OR, NAND, NOR, XOR, XNOR Gate Logic Laws and Theorems.
CHAPTER 3: PRINCIPLES OF COMBINATIONAL LOGIC
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
LOGIC GATES & BOOLEAN ALGEBRA
1 Lecture 6 BOOLEAN ALGEBRA and GATES Building a 32 bit processor PH 3: B.1-B.5.
February 2, 2004CS 2311 Karnaugh maps Last time we saw applications of Boolean logic to circuit design. – The basic Boolean operations are AND, OR and.
ENG241 Digital Design Week #2 Combinational Logic Circuits.
Discrete Mathematics CS 2610 September Equal Boolean Functions Two Boolean functions F and G of degree n are equal iff for all (x 1,..x n )  B.
Karnaugh Maps (K-Maps)
Computer Systems 1 Fundamentals of Computing Simplifying Boolean Expressions.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
CHAPTER 1 SETS, FUNCTIONs, ELEMENTARY LOGIC & BOOLEAN ALGEBRAs
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Boolean Algebra M. AL- Towaileb1. Boolean Functions In Boolean algebra we work with the set {0,1}, where: 0 ≡ F (False) & 1 ≡ T (True). The 3 Operations.
ECE 3110: Introduction to Digital Systems Chapter #4 Review.
Boolean Algebra & Logic Circuits Dr. Ahmed El-Bialy Dr. Sahar Fawzy.
CS151 Introduction to Digital Design Chapter Map Simplification.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
Karnaugh Map and Circuit Design.
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
CSE 461. Binary Logic Binary logic consists of binary variables and logical operations. Variables are designated by letters such as A, B, C, x, y, z etc.
Boolean Algebra.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
CHAPTER 2 Boolean algebra and Logic gates
Chapter 12. Chapter Summary Boolean Functions Representing Boolean Functions Logic Gates Minimization of Circuits (not currently included in overheads)
CHAPTER 3 Simplification of Boolean Functions
Department of Preparatory Year, Umm Al Qura University
Chapter 11 (Part 1): Boolean Algebra
Lecture 4 Nand, Nor Gates, CS147 Circuit Minimization and
CS 105 Digital Logic Design
… and now for the Final Topic:
Princess Sumaya University
CHAPTER 3 SETS AND BOOLEAN ALGEBRA
CSE 311 Foundations of Computing I
Discrete Mathematics CS 2610
CMSC Discrete Structures
BASIC & COMBINATIONAL LOGIC CIRCUIT
Yes, No, Maybe... BooleanAlgebra 12/10/2018.
Applied Discrete Mathematics Week 4: Functions
COMS 361 Computer Organization
Dr. Clincy Professor of CS
CMSC Discrete Structures
Circuit Simplification and
Presentation transcript:

Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222 Discrete Structures I Boolean Algebra

2 Boolean Functions Boolean algebra provides the operations and the rules for working with the set {0, 1}. the rules for working with the set {0, 1}. Electronic and optical switches can be Electronic and optical switches can be studied using this set and the rules of studied using this set and the rules of Boolean algebra. Boolean algebra. We are going to focus on three operations: Boolean complementation, Boolean complementation, Boolean sum, and Boolean sum, and Boolean product 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 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 Boolean Functions and Logic Gates AND Gate XOR Gate

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

6 Boolean Functions

7 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 1  0+ (0+1)=0 Its logical equivalent is (T  F)   (F  T)  F (T  F)   (F  T)  F

8 Boolean Expressions and Boolean Functions Definition: Let B = {0, 1}. The variable x is called a Boolean variable if it assumes values only from B. A function from B n, the set {(x 1, x 2, …, x n ) |x i  B, 1  i  n}, to B is called a Boolean function of degree 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 B 2 To B xyF(x,y)

10 Boolean Expressions and Boolean Functions The Boolean expressions in the variables x 1, x 2, …, x n are defined recursively as:  0,1,x 1,x 2,…,x n are Boolean expressions.  If E 1 and E 2 are Boolean expressions, then E 1, E 1 E 2, and E 1 +E 2 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 B 3 To B) Definition: The Boolean functions F and G of n variables are equal if and only if F(b 1, b 2, …, b n ) = G(b 1, b 2, …, b n ) whenever b 1, b 2, …, b n 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 Example: Find the value of the Boolean function F(x,y,z)=xy+z (this function From B 3 To B) A Boolean function of degree n can be represented by an n-cube (hypercube) with the corresponding function value at each vertex. Boolean Expressions and Boolean Functions

13 Boolean Expressions and Boolean Functions The complement of the Boolean function F is the function F function F where F(b 1, b 2, …, b n ) = F(b 1, b 2, …, b n ) Let F and G be Boolean functions of degree n. The Boolean sum F+G is defined by (F+G)(b 1,b 2,…,b n ) = F(b 1,b 2, …,b n )+G(b 1,b 2,…,b n ) and Boolean product FG is defined by (FG)(b 1,b 2, …,b n ) = F(b 1,b 2, …,b n ) G(b 1,b 2, …,b n )

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

15 Boolean Expressions and Boolean Functions Question: How many different Boolean functions of degree 4 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, F 1,F 2,F 3, and F 4 xF1F1 F2F2 F3F3 F4F

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 expression A into an equivalent expression B (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 interchanging Boolean sums and Boolean products and interchanging 0s 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 F d, 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 law x(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 to other mathematical structures such 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 an abstract definition of a Boolean algebra.

25 Definition of a Boolean Algebra Definition: A Boolean algebra is a set B with two binary operations  and , elements 0 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) and x  (y  z) = (x  y)  (x  z) (distributive laws)

26 Exercises pp. ( )

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  A literal is a Boolean variable or its complement.  A minterm of Boolean variables x 1,…,x n is a Boolean product of n literals y 1 y 2 …y n, where y i is either the literal x i or its complement x i. Note that the minterm y 1 y 2 …y n has the value 1 Note that the minterm y 1 y 2 …y n has the value 1 Iff each y i is 1.  A maxterm of Boolean variables x 1,…,x n is a Boolean sum of n literals y 1 y 2 …y n, where y i is either the literal x i or its complement x i. Note that the maxterm y 1 y 2 …y n has the value 0 Note that the maxterm y 1 y 2 …y n has the value 0 Iff each y i is 0.

30 Representing Boolean Functions Minterms and maxterms The table below illustrates the minterms and maxterms for three input Boolean variables

31 Representing Boolean Functions Find Boolean 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 Example Find a minterm that equal 1 if x 1 = x 3 =0 and x 2 = x 4 =x 5 =1 and equals 0 otherwise. and x 2 = x 4 =x 5 =1 and equals 0 otherwise. The minterm is x 1 x 2 x 3 x 4 x 5 Example Find the sum-of-products expansion for the function F(x,y,z)=(x+y)z (truth table) the function F(x,y,z)=(x+y)z (truth table)F(x,y,z)=(x+y)z =xz+yz Distributive law =xz+yz Distributive law =x1z+1yz Identity law =x1z+1yz Identity law =x(y+y)z+(x+x)yz Unity law =x(y+y)z+(x+x)yz Unity law =xy z+xyz+xyz+xyz Distributive law =xy z+xyz+xyz+xyz Distributive law =xy z+xyz+xyz Idempotent law =xy z+xyz+xyz Idempotent 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 x  y= x + y NAND NOR x = x  x xy = (x  y)  (x  y) x = x  x x+y = (x  y)  (x  y)

40 Representing Boolean Functions Exercises pp

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 passed if it receives at least two yes votes. Design a circuit that determines whether a proposal passes 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 passed if it receives at least two 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. 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 pp. ( ) Exercises

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 Two variables 2 2 possible 2 2 possible Minterms. 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 A two-variables Karnaugh 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 Minimization of Circuits

51 A two-variables Karnaugh Map Find Boolean expressions that represent the function F(A,B) which is given in the following table. Minimization of Circuits Don’t care condition ? x

52 A Three-variables Karnaugh Map Minimization of Circuits Use K-Map to find a minimal expansion of the function, and draw the circuit diagram.

53 A four-variables Karnaugh Map Minimization of Circuits Use K-Map to find a minimal expansion of the function, and draw the circuit diagram.

54 pp. ( ) Exercises