CS1104: Computer Organisation Lecture 3: Boolean Algebra

Slides:



Advertisements
Similar presentations
Boolean Algebra and Logic Gates
Advertisements

CS2100 Computer Organisation
Logical Systems Synthesis.
Chapter 2 Logic Circuits.
Morgan Kaufmann Publishers
Boolean Algebra and Logic Gates 1 Computer Engineering (Logic Circuits) Lec. # 4 Dr. Tamer Samy Gaafar Dept. of Computer & Systems Engineering Faculty.
ECE 331 – Digital System Design Boolean Algebra (Lecture #3) The slides included herein were taken from the materials accompanying Fundamentals of Logic.
Chapter 2 – Combinational Logic Circuits Part 1 – Gate Circuits and Boolean Equations Logic and Computer Design Fundamentals.
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR 1 Boolean Function Boolean function is an expression form containing binary variable, two-operator binary which.
EECC341 - Shaaban #1 Lec # 5 Winter Switching Algebra: Principle of Duality Any theorem or identity in switching algebra remains true if.
1 Section 10.1 Boolean Functions. 2 Computers & Boolean Algebra Circuits in computers have inputs whose values are either 0 or 1 Mathematician George.
Boolean Algebra and Logic Gates
MOHD. YAMANI IDRIS/ NOORZAILY MOHAMED NOOR
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 3-1 Chapter #2: Two-Level Combinational Logic Section 2.1, Logic Functions.
Chapter 2: Boolean Algebra and Logic Functions
Boolean Algebra Boolean algebra Boolean algebra, like any other deductive mathematical system, may be defined with –a set of elements, –a set of operators,
CS1104: Computer Organisation School of Computing National University of Singapore.
Boolean Algebra – I. Outline  Introduction  Digital circuits  Boolean Algebra  Two-Valued Boolean Algebra  Boolean Algebra Postulates  Precedence.
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)
Boolean Algebra and Digital Circuits
1 Representation of Logic Circuits EE 208 – Logic Design Chapter 2 Sohaib Majzoub.
Chapter 2. Outlines 2.1 Introduction 2.2 Basic Definitions 2.3 Axiomatic Definition of Boolean Algebra 2.4 Basic thermos and proprieties of Boolean Algebra.
Dr. Eng. Farag Elnagahy Office Phone: King ABDUL AZIZ University Faculty Of Computing and Information Technology CPCS 222.
Module 4.  Boolean Algebra is used to simplify the design of digital logic circuits.  The design simplification are based on: Postulates of Boolean.
Overview Part 1 – Gate Circuits and Boolean Equations
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
CT455: Computer Organization Boolean Algebra
Based on slides by:Charles Kime & Thomas Kaminski © 2004 Pearson Education, Inc. ECE/CS 352: Digital System Fundamentals Lecture 6 – Canonical Forms.
1 Boolean Algebra  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean.
LOGIC CIRCUITLOGIC CIRCUIT. Goal To understand how digital a computer can work, at the lowest level. To understand what is possible and the limitations.
Boolean Algebra – II. Outline  Basic Theorems of Boolean Algebra  Boolean Functions  Complement of Functions  Standard Forms.
A. Abhari CPS2131 Chapter 2: Boolean Algebra and Logic Gates Topics in this Chapter: Boolean Algebra Boolean Functions Boolean Function Simplification.
Lecture 4 Boolean Algebra. Logical Statements °A proposition that may or may not be true: Today is Monday Today is Sunday It is raining °Compound Statements.
1 Lect # 2 Boolean Algebra and Logic Gates Boolean algebra defines rules for manipulating symbolic binary logic expressions. –a symbolic binary logic expression.
Logic Circuits Lecture 3 By Amr Al-Awamry. Basic Definitions Binary Operators  AND z = x y = x yz=1 if x=1 AND y=1  OR z = x + y z=1 if x=1 OR y=1 
Module –I Switching Function
Binary Logic and Gates Boolean Algebra Canonical and Standard Forms Chapter 2: Boolean Algebra and Logic Gates.
CEC 220 Digital Circuit Design Boolean Algebra Friday, January 17 CEC 220 Digital Circuit Design Slide 1 of 22.
Chapter 2: Basic Definitions BB inary Operators ●A●AND z = x y = x yz=1 if x=1 AND y=1 ●O●OR z = x + yz=1 if x=1 OR y=1 ●N●NOT z = x = x’ z=1 if x=0.
Lecture 18: Boolean Algebra Boolean Functions. w = Chris is allowed to watch television x = Chris's homework is finished y = it is a school night z =
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI Dale Roberts, Lecturer Computer Science, IUPUI
ECE DIGITAL LOGIC LECTURE 8: BOOLEAN FUNCTIONS Assistant Prof. Fareena Saqib Florida Institute of Technology Spring 2016, 02/11/2016.
ECE DIGITAL LOGIC LECTURE 6: BOOLEAN ALGEBRA Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2016, 02/01/2016.
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.
CSE 260 BRAC University.
Basic Laws, theorems, and postulates of Boolean Algebra
CHAPTER 2 Boolean algebra and Logic gates
Boolean Algebra and Logic Gates COE 202 Digital Logic Design Dr. Muhamed Mudawar King Fahd University of Petroleum and Minerals.
CS2100 Computer Organisation
Chapter 2: Boolean Algebra and Logic Functions
ECE 20B, Winter 2003 Introduction to Electrical Engineering, II LECTURE NOTES #2 Instructor: Andrew B. Kahng (lecture)
CS 105 Digital Logic Design
CHAPTER 2 Boolean Algebra
CHAPTER 2 Boolean Algebra This chapter in the book includes:
Princess Sumaya University
Speaker: Fuw-Yi Yang 楊伏夷 伏夷非征番, 道德經 察政章(Chapter 58) 伏者潛藏也
Lecture 3: Boolean Algebra
Boolean Algebra.
Boolean Algebra.
Chapter 2 Boolean Algebra and Logic Gate
CSE 370 – Winter Combinational Logic - 1
Functions Computers take inputs and produce outputs, just like functions in math! Mathematical functions can be expressed in two ways: We can represent.
January 19 W’05 Yutao He 4532B Boelter Hall CSM51A/EEM16-Sec.1 W’05
Boolean Algebra Introduction CSCI 240
COMS 361 Computer Organization
From now on: Combinatorial Circuits:
BOOLEAN ALGEBRA.
Chapter 4 Combinational Logic Design Principles. Overview Objectives -Define combinational logic circuit -Analysis of logic circuits (to describe what.
DISCRETE MATHEMATICS.
Presentation transcript:

CS1104: Computer Organisation Lecture 3: Boolean Algebra

CS1104-3Lecture 3: Boolean Algebra2  Digital circuits Digital circuits  Boolean Algebra Boolean Algebra  Two-Valued Boolean Algebra Two-Valued Boolean Algebra  Boolean Algebra Postulates Boolean Algebra Postulates  Precedence of Operators Precedence of Operators  Truth Table & Proofs Truth Table & Proofs  Duality Duality

CS1104-3Lecture 3: Boolean Algebra3  Basic Theorems of Boolean Algebra Basic Theorems of Boolean Algebra  Boolean Functions Boolean Functions  Complement of Functions Complement of Functions  Standard Forms Standard Forms  Minterm & Maxterm Minterm & Maxterm  Canonical Forms Canonical Forms  Conversion of Canonical Forms Conversion of Canonical Forms  Binary Functions Binary Functions

CS1104-3Introduction4 Boolean algebra forms the basis of logic circuit design. Consider very simple but common example: if (A is true) and (B is false) then print “the solution is found”. In this case, two Boolean expressions (A is true) and (B is false) are related by a connective ‘and’. How do we define these? This and related things are discussed in this chapter. In typical circuit design, there are many conditions to be taken care of (for example, when the ‘second counter’ = 60, the ‘minute counter’ is incremented and ‘second counter’ is made 0. Thus it is quite important to understand Boolean algebra. In subsequent chapters, we are going to further study how to minimize the circuit using laws of Boolean algebra (that is very interesting…)

CS1104-3Digital Circuits5 Digital Circuits (1/2)  Digital circuit can be represented by a black-box with inputs on one side, and outputs on the other. The input/output signals are discrete/digital in nature, typically with two distinct voltages (a high voltage and a low voltage). In contrast, analog circuits use continuous signals. Digital circuit inputsoutputs :: High Low

CS1104-3Digital Circuits6 Digital Circuits (2/2)  Advantages of Digital Circuits over Analog Circuits:  more reliable (simpler circuits, less noise-prone)  specified accuracy (determinable)  but slower response time (sampling rate)  Important advantages for two-valued Digital Circuit:  Mathematical Model – Boolean Algebra  Can help design, analyse, simplify Digital Circuits.

CS1104-3Boolean Algebra7 Boolean Algebra (1/2)  Boolean Algebra named after George Boole who used it to study human logical reasoning – calculus of proposition.  Events : true or false  Connectives : a OR b; a AND b, NOT a  Example: Either “it has rained” OR “someone splashed water”, “must be tall” AND “good vision”. What is an Algebra? (e.g. algebra of integers) set of elements (e.g. 0,1,2,..) set of operations (e.g. +, -, *,..) postulates/axioms (e.g. 0 + x = x,..)

CS1104-3Boolean Algebra8 Boolean Algebra (2/2) Later, Shannon introduced switching algebra (two- valued Boolean algebra) to represent bi-stable switching circuit.

CS1104-3Two-valued Boolean Algebra9  Set of elements: {0,1}  Set of operations: {., +, ¬ } Signals: High = 5V = 1; Low = 0V = 0 xyxy x.y xyxy x+y x x' Sometimes denoted by ’, for example a’

CS1104-3Boolean Algebra Postulates10 Boolean Algebra Postulates (1/3)  The set B contains at least two distinct elements x and y.  Closure: For every x, y in B,  x + y is in B  x. y is in B  Commutative laws: For every x, y in B,  x + y = y + x  x. y = y. x A Boolean algebra consists of a set of elements B, with two binary operations {+} and {.} and a unary operation {'}, such that the following axioms hold:

CS1104-3Boolean Algebra Postulates11 Boolean Algebra Postulates (2/3)  Associative laws: For every x, y, z in B,  (x + y) + z = x + (y + z) = x + y + z  (x. y). z = x.( y. z) = x. y. z  Identities (0 and 1):  0 + x = x + 0 = x for every x in B  1. x = x. 1 = x for every x in B  Distributive laws: For every x, y, z in B,  x. (y + z) = (x. y) + (x. z)  x + (y. z) = (x + y). (x + z)

CS1104-3Boolean Algebra Postulates12 Boolean Algebra Postulates (3/3)  Complement: For every x in B, there exists an element x' in B such that  x + x' = 1  x. x' = 0 The set B = {0, 1} and the logical operations OR, AND and NOT satisfy all the axioms of a Boolean algebra. A Boolean function maps some inputs over {0,1} into {0,1} A Boolean expression is an algebraic statement containing Boolean variables and operators.

CS1104-3Precedence of Operators13 Precedence of Operators (1/2)  To lessen the brackets used in writing Boolean expressions, operator precedence can be used.  Precedence (highest to lowest): '. +  Examples: a. b + c = (a. b) + c b' + c = (b') + c a + b'. c = a + ((b'). c)

CS1104-3Precedence of Operators14 Precedence of Operators (2/2)  Use brackets to overwrite precedence.  Examples: a. (b + c) (a + b)'. c

CS1104-3Truth Table15 Truth Table (1/2)  Provides a listing of every possible combination of inputs and its corresponding outputs.  Example (2 inputs, 2 outputs):

CS1104-3Truth Table16 Truth Table (2/2)  Example (3 inputs, 2 outputs):

CS1104-3Proof using Truth Table17 Proof using Truth Table  Can use truth table to prove by perfect induction.  Prove that: x. (y + z) = (x. y) + (x. z) (i) Construct truth table for LHS & RHS of above equality. (ii) Check that LHS = RHS Postulate is SATISFIED because output column 2 & 5 (for LHS & RHS expressions) are equal for all cases.

CS1104-3Quick Review Questions (1)18 Quick Review Questions (1) Textbook page 54. Question 3-1.

CS1104-3Duality19 Duality (1/2)  Duality Principle – every valid Boolean expression (equality) remains valid if the operators and identity elements are interchanged, as follows: + . 1  0  Example: Given the expression a + (b.c) = (a+b).(a+c) then its dual expression is a. (b+c) = (a.b) + (a.c)

CS1104-3Duality20 Duality (2/2)  Duality gives free theorems – “two for the price of one”. You prove one theorem and the other comes for free!  If (x+y+z)' = x'.y.'z' is valid, then its dual is also valid: (x.y.z)' = x'+y'+z’  If x + 1 = 1 is valid, then its dual is also valid: x. 0 = 0

CS1104-3Basic Theorems of Boolean Algebra 21 Basic Theorems of Boolean Algebra (1/5)  Apart from the axioms/postulates, there are other useful theorems. 1. Idempotency. (a) x + x = x (b) x. x = x Proof of (a): x + x = (x + x).1 (identity) = (x + x).(x + x') (complementarity) = x + x.x' (distributivity) = x + 0 (complementarity) = x (identity)

CS1104-3Basic Theorems of Boolean Algebra 22 Basic Theorems of Boolean Algebra (2/5) 2. Null elements for + and. operators. (a) x + 1 = 1 (b) x. 0 = 0 3. Involution. (x')' = x 4. Absorption. (a) x + x.y = x(b) x.(x + y) = x 5. Absorption (variant). (a) x + x'.y = x+y(b) x.(x' + y) = x.y

CS1104-3Basic Theorems of Boolean Algebra 23 Basic Theorems of Boolean Algebra (3/5) 6. DeMorgan. (a) (x + y)' = x'.y' (b) (x.y)' = x' + y' 7. Consensus. (a) x.y + x'.z + y.z = x.y + x'.z (b) (x+y).(x'+z).(y+z) = (x+y).(x'+z)

CS1104-3Basic Theorems of Boolean Algebra 24 Basic Theorems of Boolean Algebra (4/5)  Theorems can be proved using the truth table method. (Exercise: Prove De-Morgan’s theorem using the truth table.)  They can also be proved by algebraic manipulation using axioms/postulates or other basic theorems.

CS1104-3Basic Theorems of Boolean Algebra 25 Basic Theorems of Boolean Algebra (5/5)  Theorem 4a (absorption) can be proved by: x + x.y = x.1 + x.y (identity) = x.(1 + y) (distributivity) = x.(y + 1) (commutativity) = x.1 (Theorem 2a) = x (identity)  By duality, theorem 4b: x.(x+y) = x  Try prove this by algebraic manipulation.

CS1104-3Boolean Functions26 Boolean Functions (1/2)  Boolean function is an expression formed with binary variables, the two binary operators, OR and AND, and the unary operator, NOT, parenthesis and the equal sign.  Its result is also a binary value.  We usually use. for AND, + for OR, and ' or ¬ for NOT. Sometimes, we may omit the. if there is no ambiguity.

CS1104-3Boolean Functions27 Boolean Functions (2/2)  Examples: F1= x.y.z' F2= x + y'.z F3=(x'.y'.z)+(x'.y.z)+(x.y') F4=x.y'+x'.z From the truth table, F3=F4. Can you also prove by algebraic manipulation that F3=F4?

CS1104-3Complement of Functions28 Complement of Functions (1/2)  Given a function, F, the complement of this function, F', is obtained by interchanging 1 with 0 in the function’s output values. Example: F1 = x.y.z' Complement: F1' = (x.y.z')' = x' + y' + (z')' DeMorgan = x' + y' + z Involution

CS1104-3Complement of Functions29 Complement of Functions (2/2)  More general DeMorgan’s theorems useful for obtaining complement functions: (A + B + C Z)' = A'. B'. C'. …. Z' (A. B. C.... Z)' = A' + B' + C' + … + Z'

CS1104-3Standard Forms30 Standard Forms (1/3)  Certain types of Boolean expressions lead to gating networks which are desirable from implementation viewpoint.  Two Standard Forms: Sum-of-Products and Product-of-Sums  Literals: a variable on its own or in its complemented form. Examples: x, x', y, y'  Product Term: a single literal or a logical product (AND) of several literals. Examples: x, x.y.z', A'.B, A.B, e.g'.w.v

CS1104-3Standard Forms31 Standard Forms (2/3)  Sum Term: a single literal or a logical sum (OR) of several literals. Examples: x, x+y+z', A'+B, A+B, c+d+h'+j  Sum-of-Products (SOP) Expression: a product term or a logical sum (OR) of several product terms. Examples: x, x+y.z', x.y'+x'.y.z, A.B+A'.B', A + B'.C + A.C' + C.D  Product-of-Sums (POS) Expression: a sum term or a logical product (AND) of several sum terms. Examples: x, x.(y+z'), (x+y').(x'+y+z), (A+B).(A'+B'), (A+B+C).D'.(B'+D+E')

CS1104-3Standard Forms32 Standard Forms (3/3)  Every Boolean expression can either be expressed as sum-of-products or product-of-sums expression. Examples: SOP:x.y + x.y + x.y.z POS:(x + y).(x + y).(x + z) both: x + y + z or x.y.z neither:x.(w + y.z) or z + w.x.y + v.(x.z + w)

CS1104-3Minterm & Maxterm33 Minterm & Maxterm (1/3)  Consider two binary variables x, y.  Each variable may appear as itself or in complemented form as literals (i.e. x, x' & y, y' )  For two variables, there are four possible combinations with the AND operator, namely: x'.y', x'.y, x.y', x.y  These product terms are called the minterms.  A minterm of n variables is the product of n literals from the different variables.

CS1104-3Minterm & Maxterm34 Minterm & Maxterm (2/3)  In general, n variables can give 2 n minterms.  In a similar fashion, a maxterm of n variables is the sum of n literals from the different variables. Examples: x'+y', x'+y, x+y',x+y  In general, n variables can give 2 n maxterms.

CS1104-3Minterm & Maxterm35 Minterm & Maxterm (3/3)  The minterms and maxterms of 2 variables are denoted by m0 to m3 and M0 to M3 respectively: Each minterm is the complement of the corresponding maxterm: Example: m2 = x.y' m2' = (x.y')' = x' + (y')' = x'+y = M2

CS1104-3Canonical Form: Sum-of-Minterms36 Canonical Form: Sum of Minterms (1/3)  What is a canonical/normal form?  A unique form for representing something.  Minterms are product terms.  Can express Boolean functions using Sum-of-Minterms form.

CS1104-3Canonical Form: Sum-of-Minterms37 Canonical Form: Sum of Minterms (2/3) a) Obtain the truth table. Example:

CS1104-3Canonical Form: Sum-of-Minterms38 Canonical Form: Sum of Minterms (3/3) b) Obtain Sum-of-Minterms by gathering/summing the minterms of the function (where result is a 1) F1 = x.y.z' =  m(6) F2 = x'.y'.z + x.y'.z' + x.y'.z + x.y.z' + x.y.z =  m(1,4,5,6,7) F3 = x'.y'.z + x'.y.z + x.y'.z' +x.y'.z =  m(1,3,4,5)

CS1104-3Canonical Form: Product-of- Maxterms 39 Canonical Form: Product of Maxterms (1/4)  Maxterms are sum terms.  For Boolean functions, the maxterms of a function are the terms for which the result is 0.  Boolean functions can be expressed as Products-of- Maxterms.

CS1104-3Canonical Form: Product-of- Maxterms 40 Canonical Form: Product of Maxterms (2/4) E.g.: F2 =  M(0,2,3) = (x+y+z).(x+y'+z).(x+y'+z') F3 =  M(0,2,6,7) = (x+y+z).(x+y'+z).(x'+y'+z).(x'+y'+z')

CS1104-3Canonical Form: Product-of- Maxterms 41 Canonical Form: Product of Maxterms (3/4)  Why is this so? Take F2 as an example. F2 =  m(1,4,5,6,7)  The complement function of F2 is: F2' =  m(0,2,3) = m0 + m2 + m3 (Complement functions’ minterms are the opposite of their original functions, i.e. when original function = 0)

CS1104-3Canonical Form: Product-of- Maxterms 42 Canonical Form: Product of Maxterms (4/4) From previous slide, F2' = m0 + m2 + m3 Therefore: F2 = (m0 + m2 + m3 )' = m0'. m2'. m3' DeMorgan = M0. M2. M3 mx' = Mx =  M(0,2,3)  Every Boolean function can be expressed as either Sum-of-Minterms or Product-of-Maxterms.

CS1104-3Quick Reviwe Questions (2)43 Quick Review Questions (2) Textbook pages Questions 3-2 to 3-11.

CS1104-3Conversion of Canonical Forms44 Conversion of Canonical Forms (1/3)  Sum-of-Minterms  Product-of-Maxterms  Rewrite minterm shorthand using maxterm shorthand.  Replace minterm indices with indices not already used. Eg: F1(A,B,C) =  m(3,4,5,6,7) =  M(0,1,2)  Product-of-Maxterms  Sum-of-Minterms  Rewrite maxterm shorthand using minterm shorthand.  Replace maxterm indices with indices not already used. Eg: F2(A,B,C) =  M(0,3,5,6) =  m(1,2,4,7)

CS1104-3Conversion of Canonical Forms45 Conversion of Canonical Forms (2/3)  Sum-of-Minterms of F  Sum-of-Minterms of F'  In minterm shorthand form, list the indices not already used in F. Eg: F1(A,B,C) =  m(3,4,5,6,7) F1'(A,B,C) =  m(0,1,2)  Product-of-Maxterms of F  Prod-of-Maxterms of F'  In maxterm shorthand form, list the indices not already used in F. Eg: F1(A,B,C) =  M(0,1,2) F1'(A,B,C) =  M(3,4,5,6,7)

CS1104-3Conversion of Canonical Forms46 Conversion of Canonical Forms (3/3)  Sum-of-Minterms of F  Product-of-Maxterms of F'  Rewrite in maxterm shorthand form, using the same indices as in F. Eg: F1(A,B,C) =  m(3,4,5,6,7) F1'(A,B,C) =  M(3,4,5,6,7)  Product-of-Maxterms of F  Sum-of-Minterms of F'  Rewrite in minterm shorthand form, using the same indices as in F. Eg: F1(A,B,C) =  M(0,1,2) F1'(A,B,C) =  m(0,1,2)

CS1104-3Quick Review Questions (3)47 Quick Review Questions (3) Textbook page 55. Question 3-12.

CS1104-3Binary Functions48 Binary Functions (1/2)  Given n variables, there are 2 n possible minterms.  As each function can be expressed as sum-of- minterms, there could be 2 2 n different functions.  In the case of two variables, there are 2 2 =4 possible minterms; and 2 4 =16 different possible binary functions.  The 16 possible binary functions are shown in the next slide.

CS1104-3Binary Functions49 Binary Functions (2/2)

End of file