INTRODUCTION TO INFORMATION & COMMUNICATION TECHNOLOGY LECTURE 8 : WEEK 8 CSC-110-T Credit : (2 + 1) / Week TEXT AND REF. BOOKS Text Book: Peter Norton (2011), Introduction to Computers, 7 /e, McGraw-Hill Reference Book: Gary B (2012), Discovering Computers, 1/e, South Western Deborah (2013), Understanding Computers, 14/e, Cengage Learning June P & Dan O (2014), New Perspective on Computer, 16/e 1
MOBILE ALERT Kindly Switch Off your Mobile/Cell Phone OR Switch it to Silent Mode Please GOOGLE SITE ADDRESS FOR LECTURE NOTES AND STUDY MATERIAL DOWNLOAD, PLEASE VISIT : https://sites.google.com/site/shucsc110/ OR TYPE SHUCSC110 & GOOGLE 2
LOGIC GATES & BOOLEAN ALGEBRA Presented by: Flt. Lt. Shujaat H. Butt (R) MS. Telecomm. & Network Management, UK Masters (CS), Bahria University Khi, Pakistan Prince2 Project Management (Foundation) Certified Microsoft Certified Professional (MCP) Email : shsucsc1100@gmail.com Learning Outcome Binary Logic, Variables and Gates Logical Operations Notational Examples Truth Tables Logic Function Implementation Logic Gates, Symbol and Behavior Logic Diagram and Expressions Boolean Algebra, Operator Precedence DeMorgan s Theorem 3
Binary Logic and Gates Binary variables Take on one of two values. Logical operators Operate on binary values and binary variables. Basic logical operators are the logic functions AND, OR and NOT. Logic gates Implement logic functions. Boolean Algebra: A useful mathematical system for specifying and transforming logic functions. We study Boolean algebra as a foundation for designing and analyzing Digital Circuits Binary Variables Recall that the two binary values have different names: True/False On/Off Yes/No 1/0 We use 1 and 0 to denote the two values. Variable identifier examples: A, B, y, z, or X 1 for now 4
Logical Operations The three basic logical operations are: AND OR NOT AND is denoted by a dot ( ). OR is denoted by a plus (+). NOT is denoted by an over-bar ( ), a single quote mark (') after, or (~) before the variable. Notation Examples Examples: Y = A.B is read Y is equal to A AND B. Z = x + y is read z is equal to x OR y. X = A is read X is equal to NOT A. Note: The statement: 1 + 1 = 2 (read one plus one equals two ) is not the same as 1 + 1 = 1 (read 1 OR 1 equals 1 ). 5
Operator Definitions Operations are defined on the values "0" and "1" for each operator: AND 0 0 = 0 0 1 = 0 1 0 = 0 1 1 = 1 OR 0 + 0 =0 0 + 1 = 1 1 + 0 = 1 1 + 1 = 1 NOT 0 = 1 1 = 0 Truth Tables Tabular listing of the values of a function for all possible combinations of values on its arguments Example: Truth tables for the basic logic operations: X 0 0 1 1 AND Y Z = X Y 0 0 1 0 0 0 1 1 OR X Y Z = X+Y 0 0 0 0 1 1 1 0 1 1 1 1 NOT X Z = X 0 1 1 0 6
Truth Tables Cont d Used to evaluate any logic function Consider F(X, Y, Z) = X Y + Y Z X Y Z X Y Y Y Z F = X Y + Y Z 0 0 0 0 1 0 0 0 0 1 0 1 1 1 0 1 0 0 0 0 0 0 1 1 0 0 0 0 1 0 0 0 1 0 0 1 0 1 0 1 1 1 1 1 0 1 0 0 1 1 1 1 1 0 0 1 Logic Function Implementation Using Switches Inputs: logic 1 is switch closed logic 0 is switch open Outputs: logic 1 is light on logic 0 is light off. NOT input: logic 1 is switch open logic 0 is switch closed Switches in parallel => OR Switches in series => AND Normally-closed switch => NOT C 7
Basic Logic Gates Logic gates perform basic LOGICAL FUNCTIONS and are the fundamental building blocks of DIGITAL INTEGRATED CIRCUITS. Most logic gates take an input of TWO binary values, and output a SINGLE value of a 1 or 0. Logic Gate AND The AND gate is an electronic circuit that gives a high output (1) only if ALL its inputs are high A dot (.) is used to show the AND operation i.e. A.B. (sometimes omitted i.e. AB) 8
Logic Gate OR The OR gate is an electronic circuit that gives a high output (1) if ONE OR MORE of its inputs are high. A plus (+) is used to show the OR operation Logic Gate NOT The NOT gate is an electronic circuit that produces an inverted version of the input at its output. It is also known as an inverter. 9
Logic Gate Symbols and Behavior Logic gates have special symbols: X Y AND gate Z = X Y X Y OR gate Z = X + Y X NOT gate or inverter Z = X And waveform behavior in time as follows: X 0 0 1 1 Y 0 1 0 1 (AND) X Y 0 0 0 1 (OR) X + Y 0 1 1 1 (NOT) X 1 1 0 0 Logic Diagrams and Expressions Logic Equation Truth Table X Y Z F = X + 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1 1 1 1 1 Y Z F = X + Y Z X Y Z Logic Diagram Boolean equations, truth tables and logic diagrams describe the same function Truth tables are unique, but expressions and logic diagrams are not. This gives flexibility in implementing functions. F 10
Boolean Algebra Invented by George Boole in 1854 BOOLE is one of the persons in a long historical chain who was concerned with formalizing and mechanizing the process of logical thinking Boolean algebra is a type of math that deals with bits instead of numbers Truth Table : Laws of Boolean 11
Truth Table : Laws of Boolean Truth Table : Laws of Boolean 12
Boolean Algebra An algebraic structure defined by a set B = {0, 1}, together with two binary operators (+ and ) and a unary operator ( ) 1. 3. 5. 7. 9. X + 0 = X X + 1 = 1 X + X = X X + X = 1 X = X 2. 4. 6. 8. X. 1 = X X. 0 = 0 X. X X. X = X = 0 Identity element Idempotence Complement Involution 10. 12. 14. 16. X + Y = Y + X (X + Y) + Z = X + (Y + Z) X(Y + Z) = XY + XZ X + Y = X. Y 11. 13. 15. 17. XY = YX (XY) Z = X(Y Z) X + YZ = (X + Y) (X + Z) X. Y = X + Y Commutative Associative Distributive DeMorgan s Boolean Operator Precedence The order of evaluation is: 1. Parentheses 2. NOT 3. AND 4. OR Consequence: Parentheses appear around OR expressions Example: F = A(B + C)(C + D) 13
Boolean Algebraic Proof Example 1 A + A B = A (Absorption Theorem) Proof Steps Justification A + A B = A 1 + A B Identity element: A 1 = A = A ( 1 + B) Distributive = A 1 1 + B = 1 = A Identity element Our primary reason for doing proofs is to learn: Careful and efficient use of the identities and theorems of Boolean algebra, and How to choose the appropriate identity or theorem to apply to make forward progress, for simple solutions irrespective of the application. Boolean Algebraic Proof Example 2 AB + AC + BC = AB + AC Proof Steps Justification = AB + AC + BC = AB + AC + 1 BC Identity element = AB + AC + (A + A) BC Complement = AB + AC + ABC + ABC Distributive = AB + ABC + AC + ACB Commutative = AB 1 + ABC + AC 1 + ACB Identity element = AB (1+C) + AC (1 + B) Distributive = AB. 1 + AC. 1 1+X = 1 = AB + AC Identity element 14
Useful Theorems Minimization X Y + X Y = Y Absorption X + X Y = X Simplification X + X Y = X + Y DeMorgan s X + Y = X Y Minimization (dual) (X+Y)(X+Y) = Y Absorption (dual) X (X + Y) = X Simplification (dual) X (X + Y) = X Y DeMorgan s (dual) X Y = X + Y Truth Table to Verify DeMorgan s X + Y = X Y X Y = X + Y X Y X Y X+Y X Y X+Y X Y X Y X+Y 0 0 0 0 1 1 1 1 1 1 0 1 0 1 1 0 0 0 1 1 1 0 0 1 0 1 0 0 1 1 1 1 1 1 0 0 0 0 0 0 Generalized DeMorgan s Theorem: X 1 + X 2 + + X n = X 1 X 2 X n X 1 X 2 X n = X 1 + X 2 + + X n 15
END OF LECTURE Any Questions!!! 16