Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Logic Gates Digital Computer Logic Kashif Bashir WWW:

Similar presentations


Presentation on theme: "1 Logic Gates Digital Computer Logic Kashif Bashir WWW:"— Presentation transcript:

1 1 Logic Gates Digital Computer Logic Kashif Bashir WWW: http://www.kashifpaf.greatnow.com Email: kashif@pafkiet.edu.pk

2 2 Module Outline Binary Logic and Basic Gates Boolean Algebra Standard Forms Simplification of Boolean Functions NAND and NOR Gates XOR Gate Integrated Circuits CMOS Gates

3 3 Binary Logic Deals with variables that take on only two discrete values and operations of mathematical logic that are applied to these variables The two values are known by different names: HIGH and LOW TRUE and FALSE 0 and 1 Variables may be denoted by any name but single letter character names such as A, B, C, X, Y, Z, etc. are common and easy to use

4 4 Logical Operations AND Represented by a dot · or sometimes  or  Binary operator, i.e. operates on two variables at a time OR Represented by a + or sometimes  or  Binary operator, i.e. operates on two variables at a time NOT Represented by a bar over the variable, e.g. A or A’ Unary operator, i.e. operates on a single variable Also referred to as COMPELMENT operator

5 5 Binary Logic and Basic Gates Digital Circuits and Systems are complex However, the basic building blocks of all digital circuits and systems are logic gates Logic gates are therefore called the basic primitives of digital systems Logic gates in reality are implemented using electronic components such as transistors However, we are not concerned with their internal electronic properties but rather their external logic behavior

6 6 Electronic vs. Logical +V _X_X X X _X_X Electronic ImplementationLogical Behavior

7 7 Standard Symbols X _X_X X Y X + Y X Y X · Y AND OR NOT

8 8 Truth Table A table of combinations of the binary variables showing the the relationship between between the values the variables take on and the values of the result of the operation XYXY AND Z = X · Y 0 0101 1010 1 0 0 0 1 XYXY OR Z = X + Y 0 0101 1010 1 0 1 1 1 X NOT Z = X 0 1 1 0

9 9 Gates with More Than Two Inputs A C F = A · B · C 3-Input AND gate B A F = A+B+C+D+E+F B C D E F 6-Input OR gate

10 10 Truth Table XYZXYZ AND F = X · Y · Z 0000000 0010010 010010 0 011011 0 100100 0 1011010 1101100 111111 1

11 11 Boolean Algebra Defines rules of operations on Binary Logic and Logic Functions Sometimes similar to Binary Arithmetic but some times different – because binary logic variables can only take on two possible values 0 and 1 A Boolean function consists of a binary variable denoting the function, an equals sign, and an algebraic expression formed by using binary variables. For example F = X + Y’Z

12 12 Truth Tables for Boolean Functions Truth Table can be constructed for every boolean function A boolean function of n-variables will have 2 n rows in its truth table These 2 n inputs are formed by counting from 0 to 2 n - 1 For example G(W,X,Y,Z) will have 16 rows in the truth table and F(A,B) will have 4 rows

13 13 Truth Table for F = X + Y’Z XYZXYZ Truth Table for F = X + Y’ · Z F 0000000 0010011 010010 0 011011 0 100100 1 1011011 1101101 111111 1 X Y Z F Logic Circuit Diagram for F = X + Y’Z

14 14 Timing Diagram 0 001 AND 0 111 OR 0011 X 0 101 Y NOT(X) 1 100  Horizontal axis represents time  Vertical axis shows the value of the signal  High voltage level represents 1 and low voltage level represents 0  Timing diagrams are very important in digital systems design and verification

15 15 Basic Identities of Boolean Algebra 1. X + 0 = X 2. X · 1 = X 3. X + 1 = 1 4. X · 0 = 0 5. X + X = X 6. X · X = X 7. X + X’ = 1 8. X · X’ = 0 9. (X’)’ = X

16 16 Basic Identities of Boolean Algebra 1. X + Y = Y + X 2. XY = YX 3. X + (Y + Z) = (X + Y) + Z 4. X (YZ) = (XY)Z 5. X(Y+Z) = XY+ XZ 6. X + YZ = (X + Y)(X + Z) 7. (X + Y)’ = X’Y’ 8. (XY)’ = X’ + Y’ CommutativeAssociativeDistributiveDeMorgan’s

17 17 Algebraic Manipulation Using basic identities a boolean function can be simplified For example F = X’YZ + X’YZ’ + XZ = X’Y(Z + Z’) + XZ = X’Y·1 + XZ =X’Y + XZ

18 18 Algebraic Manipulation Examples 1. X + XY = X (1+Y) = X 2. XY + XY’ = X (Y + Y’) = X 3. X + X’Y = (X + X’) (X + Y) = X + Y 4. X (X + Y) = X + XY = X (1 + Y) = X 5. (X + Y)(X + Y’) = X + XY’ + XY + YY’ = X (1 + Y’) + XY = X · 1 + XY = X + XY = X (1 + Y) = X 6. X(X’ + Y) = XX’ +XY = XY

19 19 Duality Principle Dual of an expression is obtained by changing AND to OR and OR to AND throughout and 1’s to 0’s and 0’s to 1’s, if they appear in the expression X + Y’  XY’ XY+X’Y’  (X + Y)(X’ + Y’) Boolean equation remains valid if we take the dual of the expression on both sides of an equals sign

20 20 Consensus Theorem XY + X’Z + YZ = XY + X’Z Proof XY + X’Z + YZ = XY + X’Z + YZ(X + X’) = XY = X’Z + XYZ + X’YZ = XY + XYZ + X’Z + X’YZ = XY (1 +Z) + X’Z(1 + Y) = XY + X’Z Dual of Consensus Theorem is: (X + Y)(X’ + Z)(Y + Z) = (X + Y)(X’ + Z)

21 21 Complement of a Function Obtained by interchange of 1’s top 0’s and 0’s to 1’s for the values of F in the truth table Can be derived algebraically by applying DeMorgan’s theorem Complement of an expression is obtained by interchanging AND and OR and complementing each variable and constant Example: F = X’YZ’ + X’Y’Z F’ = (X + Y’ + Z)(X + Y + Z’)

22 22 Standard Forms Variety of possible ways of writing a boolean function algebraically Hard to see unambiguously that it is the same function we are talking about Standard forms have been developed Standard forms also generate more desirable logic circuits Product terms and Sum terms Product: XY’Z Sum: X + Y’ + Z

23 23 Truth Table and Algebraic Expression A truth table defines a boolean function An algebraic expression for the function is derived by finding the logical sum of all the product terms for which the function assumes a binary value 1 For example: F = X’Y’Z + XY’Z’ + XYZ’ + XYZ XYZXYZ Truth Table for F = X + Y’ · Z F 0000000 0010011 010010 0 011011 0 100100 1 1011011 1101101 111111 1

24 24 Minterms A product term in which all the variables appear exactly once, either complemented or uncomplemented, is called a minterm There are 2 n minterms for n Boolean variables Any Boolean function can be expressed as logical sum of minterms The complement of a function contain those minterm not included in the original function A function that includes all the 2 n minterms is equal to logic 1 The symbol for a minterm is m j where j denotes the decimal equivalent of the binary combination for which the minterm has value 1

25 25 Maxterms A sum term containing all the variables once in complemented or uncomplemented form is called a maxterm There are 2 n maxterms for n Boolean variables Any Boolean function can be expressed as logical product of maxterms The symbol for a maxterm is M j where j denotes the decimal equivalent of the binary combination for which the maxterm has value 0

26 26 XYZXYZ 000000 001001 010010 011011 100100 101101 110110 111111 E 0 1 0 0 0 1 0 1 F 1 1 0 0 1 0 1 1 Example E(X, Y, Z) =  m(1,5,7) F(X, Y, Z) =  m(0,1,4,6,7) E’(X, Y, Z) =  m(0,2,3,4,6) F’(X, Y, Z) =  m(2,3,5) E + F =  m(0,1,4,5,6,7) E · F =  m(1,7)

27 27 Sum of Products Implementation Also called sum of minterms Look again at the previous example F = X’Y’Z + XY’Z’ + XYZ’ + XYZ It can be represented as m 0 + m 2 + m 5 + m 7 Or alternatively: F(X, Y, Z) =  m(0,2,5,7) F’ =  m(1,3,4,6)

28 28 Product of Sums Implementation Also called product of maxterms A Boolean function can be expressed as product of maxterms F =  M(1,3,4,6) Related to the sum of products or minterm representation of the F’

29 29 Two Level Implementations The standard forms result in two level implementation of a Boolean function Sum of products representation results in an AND/OR implementation Product of sums results in an OR/AND implementation

30 30 Karnaugh Maps Boolean expressions may be simplified by using algebraic operations But there is not set method to predict the steps to take That means not amenable to automated techniques Karnaugh Maps to the rescue Generates simplified expressions that are in SOP or POS form Produce two-level implementation with a minimum number of gates and a minimum number of inputs to the gates Sometimes two or more expressions that satisfy the simplification criteria

31 31 Two-Variable Map Four minterms so four squares As an example two K-maps are shown: 1. F(X, Y) = XY 2. F(X, Y) = X’Y + XY’ m0m0 m1m1 m2m2 m3m3 X’Y’X’Y XY’XY Y X 01 0 1 00 01 Y X 01 0 1 01 11 Y X 01 0 1

32 32 Three-Variable Map X’Y’Z’X’Y’Z XY’Z’XY’Z YZ X 0001 0 1 X’YZX’YZ’ XYZXYZ’ 1110 m0m0 m1m1 m4m4 m5m5 m3m3 m2m2 m7m7 m6m6

33 33 Example 1

34 34 Four-Variable Map Example - 1

35 35 Four-Variable Map Example - 2

36 36 Five Variable K-Maps

37 37 Five Variable K-Maps Example

38 38 Don’t Care Conditions

39 39 NAND Not AND = NAND X Y X · Y(X · Y)’ X Y XYXY NAND (X · Y)’ 0 0101 1010 1 1 1 1 0

40 40 NOR Gates Not OR = NOR XYXY NOR (X + Y)’ 0 0101 1010 1 1 0 0 0 X Y X Y X + Y (X + Y)’

41 41 XOR XOR = Exclusive OR

42 42 Use of XOR in Parity Generation and Checking

43 43 A Complete Set of Gates AND, OR, NOT NAND NOR XOR?

44 44 Integrated Circuits An Integrated Circuit or IC or chip is a small silicon crystal containing the electronic components

45 45 Integrated Circuits

46 46 Levels of Integration SSI MSI LSI VLSI

47 47 Digital Logic Families What? Why? RTL DTL TTL ECL MOS CMOS BiCMOS

48 48 Important Characteristics Fan-in Fan-out Noise Margin Power Dissipation Propagation Delay

49 49 Propagation Delay for an Inverter t PHL t PLH IN OUT X _X_X

50 50 CMOS Circuits CMOS = Complementary Metal Oxide Semiconductor A type of transistor Two types N-channel (NMOS) P-channel (PMOS)


Download ppt "1 Logic Gates Digital Computer Logic Kashif Bashir WWW:"

Similar presentations


Ads by Google