Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Digital Logic

1,774 views

Published on

Introduction to digital logic, fundamental logic gates, Boolean algebra & simplifications, 3-6 input Kanaugh Maps

Published in: Education
  • Be the first to comment

Digital Logic

  1. 1. Digital Logic CS2052 Computer Architecture Computer Science & Engineering University of Moratuwa Dilum Bandara Dilum.Bandara@uom.lk
  2. 2. Outline  Logic gates  Boolean Algebra  Kanaugh Maps 2
  3. 3. Logic Gates  Every digital device is based on a set of chips designed to store & process information  Basic building blocks of these chips are logic gates  Implementation of gates can be different  Different materials & fabrication technologies  Different operating voltages  e.g., 5v vs. 0v, 3+v vs. 0.5v  Today, they go as low as 1.9 - 2.1v  But their logical behavior is consistent across all computers 3
  4. 4. Common Logic Gates  NOT/inverter  AND 4 Truth table Algebraic function
  5. 5. Common Logic Gates (Cont.)  OR  NAND 5
  6. 6. Common Logic Gates (Cont.)  NOR  XOR/EXOR (Exclusive OR) 6
  7. 7. Common Logic Gates (Cont.)  NXOR/EXNOR (Exclusive NOR) 7
  8. 8. Exercise  Implement 3-input AND using 2-inputs ANDs  Implement a NOT gate using a NAND 8
  9. 9. Fundamental Logic Gate  2-input NAND gate can be used to build any other gate 9
  10. 10. Exercise  Implement AND using NANDs  Homework  Implement following gates using NANDs  OR  XOR 10
  11. 11. Boolean Algebra  Boolean variable  Takes only 2 values – either TRUE (1) or FALSE (0)  Boolean function  Mapping from Boolean variables to a Boolean value  Application  Can represent complex relationships in a digital circuit  Boolean algebra  Deals with binary variables & logic operations operating on those variables  Application  Can simplify a relationship among multiple inputs in a digital circuit 11
  12. 12. Basic Identities of Boolean Algebra  Basic operations  AND (.), OR (+), NOT (– or /)  0 – FALSE  1 – TRUE x + 0 = x x + x = x x · 0 = 0 x . x = x x + 1 = 1 x + x/ = 1 x · 1 = x x · x / = 0 12
  13. 13. Basic Identities (Cont.)  Commutativity x + y = y + x xy = yx  Associativity x + ( y + z ) = ( x + y ) + z x (yz) = (xy) z  Distributivity x ( y + z ) = xy + xz x + yz = ( x + y )( x + z) 13 Textbook has a typo
  14. 14. Basic Identities (Cont.)  DeMorgan’s Theorem ( x + y )/ = x/ y/ ( xy )/ = x/ + y/  Generalized DeMorgan's Theorem (a + b + … z) / = a / b / … z / (a.b … z) / = a / + b / + … z /  Involution (x /) / = x 14
  15. 15. Exercise  Simplify following functions using Boolean Algebra  a + ab  a(a + b)  a(a / + b)  a + a/ b  (a + b.c) / a + ab = a(1+b)=a a(a + b) = a.a +ab=a+ab=a(1+b)=a a + a'b = (a + a')(a + b)=1(a + b) =a+b a(a' + b) = a.a' +ab=0+ab=ab (a + b.c)' = a'.b' + a'.c' 15
  16. 16. Homework  Show steps for following simplifications  (a + b)(a + b') = a  ab + ab'c = ab + ac  (a + b)(a + b' + c) = a + bc  (a(b + z(x + a')))' = a' + b' (z' + x')  (a(b + c) + a'b)'=b'(a' + c')  (a + b)(a' + c)(b + c) = (a + b)(a' + c)  No need to submit answers 16
  17. 17. Minterms  Minterm  Each combination of variables in a truth table  As no of digital inputs (Boolean variables) increase no of minterms increase  2n minterms for n inputs  As n increases  Large truth tables  Long Boolean functions  Easier to represent using decimal equivalent of sum of minterms  F(a, b, c) = Σ (2, 4, 5, 7) 17
  18. 18. Exercise  Represent all odd numbers between 0 – 7 as a sum of minterms  F(a, b, c) = Σ (1, 3, 5, 7)  Use Boolean Algebra to simplify above function Σ (1, 3, 5, 7) = a‘b‘c + a‘bc + ab‘c + abc = a‘c(b‘ + b) + ac (b‘ + b) = a‘c + ac = c (a‘+ a) = c 18 Sum of Products
  19. 19. Karnaugh Map (K-Map)  Pictorial representation of a truth table  Map of squares – each square for each minterm  Adjacent squares change in minterm only by one variable 19 bc a 00 01 11 10 0 0 1 3 2 1 4 5 7 6 Decimal equivalent of minterm
  20. 20. Example – 3 Variable K-Map  Simplify represent of all odd numbers between 0 – 7  F(a, b, c) = Σ (1, 3, 5, 7) 20 ab c 00 01 11 10 0 1 1 1 1 1 0 0 0 0 = c
  21. 21. Exercise – 3 Variable K-Map  Simplify following expression using a K-map 21 ab c 00 01 11 10 0 1 1 0 0 0 1 1 0 0 = a’c’ + a’b’
  22. 22. Kanaugh Map – Simplification  Squares containing 1’s are grouped to get sum- of-product expression  Group size must be 2n  Group must be in rectangular shape  Each group represents an algebraic term  Its OK for groups to overlap  OR of all those terms is the final expression  Maximum group size  better simplification  A don’t care (X) can be interpreted as either 0 or 1 when needed, only if it contributes to simplification  Don’t group Xs together! 22
  23. 23. 4 Variable K-Map 23
  24. 24. Example – 4 Variable K-Map 24
  25. 25. Exercise – 4 Variable K-Map  What would be a Boolean expression of a circuit that detects all even numbers between 0 – 15?  Present as a sum of minterms 25
  26. 26. 5 Variable K-Map – Option 1 26 BC DE A 1 /0 00 01 11 10 00 01 11 10 0 5 3 1 8124 2 20 11 106 7 14 16 13 9 15 19 18 17 28 24 31 2921 23 3022 26 25 27
  27. 27. Example – 5 Variable K-Map  What would be a Boolean expression of a circuit to detect all prime numbers between 0 & 31? 27 BC DE A 1 /0 00 01 11 10 00 01 11 10 0 5 3 1 8124 2 20 11 106 7 14 16 13 9 15 19 18 17 28 24 31 2921 23 3022 26 25 27
  28. 28. 5 Variable K-Map – Option 2 28
  29. 29. Example – 5 Variable K-Map – Option 2 29
  30. 30. 6 Variable K-Map 30
  31. 31. Simplification as Product of Sum  Some times it is useful to obtain the algebraic expression as a product of sums  Can be obtained by finding sum of products for F/ & converting it to F  To find F/ Group 0s in a K-map  F(a, b, c) = Σ (1, 3, 5, 7) = Π (1, 3, 5, 7) 31
  32. 32. Exercise – Product of Sum  Find sum-of-product & product-of-sum representation of following K-map 32 ab c 00 01 11 10 0 1 1 x 1 1 0 0 0 1 F(a, b, c) = ab’ + c F/(a, b, c) = a’c’ + bc’ (F/(a, b, c)) / = (a + c)(b’ + c) = F(a, b, c)

×