gates and logic from transistors to logic gates and logic
play

Gates and Logic: From Transistors to Logic Gates and Logic Circuits - PowerPoint PPT Presentation

Gates and Logic: From Transistors to Logic Gates and Logic Circuits Prof. Hakim Weatherspoon CS 3410 Computer Science Cornell University [Weatherspoon, Bala, Bracy, and Sirer] Goals for Today From Switches to Logic Gates to Logic


  1. Gates and Logic: From Transistors to Logic Gates and Logic Circuits Prof. Hakim Weatherspoon CS 3410 Computer Science Cornell University [Weatherspoon, Bala, Bracy, and Sirer]

  2. Goals for Today • From Switches to Logic Gates to Logic Circuits • Logic Gates • From switches • Truth Tables • Logic Circuits • From Truth Tables to Circuits (Sum of Products) • Identity Laws • Logic Circuit Minimization • Algebraic Manipulations • Truth Tables (Karnaugh Maps) • Transistors (electronic switch) 2

  3. A switch Acts as a conductor or insulator . Can be used to build amazing things… The Bombe used to break the German 3 Enigma machine during World War II

  4. Basic Building Blocks: Switches to Logic Gates + Truth Table A A A A A A B B B B B Light Light Light Light Light - OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF OFF ON ON ON B ON ON OFF OFF ON ON ON ON + A A A B B Light Light A A A B B B Light Light Light - OFF OFF OFF OFF OFF OFF OFF OFF OFF ON OFF OFF ON ON ON OFF B ON OFF ON ON 4

  5. Basic Building Blocks: Switches to Logic Gates • Either (OR) Truth Table A A A A A A B B B B B Light Light Light Light Light - OFF OFF OFF OFF OFF OFF OFF OFF OR OFF OFF OFF ON ON ON B ON ON OFF OFF ON ON ON ON • Both (AND) A A A A B B B Light Light Light A B Light - OFF OFF OFF OFF OFF OFF OFF OFF AND OFF OFF ON ON OFF ON B ON OFF ON OFF ON ON 5

  6. Basic Building Blocks: Switches to Logic Gates • Either (OR) Truth Table A A A A A B B B B Light Light Light Light - OFF OFF OFF 0 0 OFF OFF OFF OR 0 = OFF 0 OFF OFF 1 ON ON 1 = ON B 1 0 ON OFF 1 ON 1 ON • Both (AND) A A B Light - 0 0 AND 0 1 B 1 0 1 1 6

  7. Basic Building Blocks: Switches to Logic Gates A OR B George Boole (1815-1864) A • Did you know? • George Boole: Inventor of the AND idea of logic gates. He was born in Lincoln, England and he was B the son of a shoemaker in a low class family. 7

  8. Takeaway • Binary (two symbols: true and false) is the basis of Logic Design 8

  9. Building Functions: Logic Gates • NOT: A Out A 0 1 A B Out 1 0 • AND: NAND: 0 0 1 A A B Out 0 1 1 0 0 0 A B 1 0 1 0 1 0 1 1 0 B 1 0 0 • OR: NOR: 1 1 1 A B Out A 0 0 1 A B Out A B 0 1 0 0 0 0 1 0 0 B 0 1 1 1 1 0 1 0 1 • Logic Gates 1 1 1  digital circuit that either allows a signal to pass through it or not.  Used to build logic functions  There are seven basic logic gates: AND, OR, NOT , NAND (not AND), NOR (not OR), XOR, and XNOR (not XOR) [later] 9

  10. Goals for Today • From Switches to Logic Gates to Logic Circuits • Logic Gates • From switches • Truth Tables • Logic Circuits • From Truth Tables to Circuits (Sum of Products) • Identity Laws • Logic Circuit Minimization • Algebraic Manipulations • Truth Tables (Karnaugh Maps) • Transistors (electronic switch) 10

  11. Next Goal • Given a Logic function, create a Logic Circuit that implements the Logic Function… • …and, with the minimum number of logic gates • Fewer gates: A cheaper ($$$) circuit! 11

  12. Logic Gates A Out NOT: 0 1 A 1 0 A B Out A B Out 0 0 1 0 0 0 NAND: A A 0 1 1 AND: 0 1 0 1 0 1 B B 1 0 0 1 1 0 1 1 1 NOR: A B Out A B Out A A OR: 0 0 1 0 0 0 0 1 0 B B 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 XNOR: XOR: A B Out A B Out 0 0 1 A 0 0 0 A 0 1 0 0 1 1 B B 1 0 0 1 0 1 1 1 1 1 1 0 12

  13. Logic Implementation • How to implement a desired logic function? a b c out 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 0 1 0 1 1 1 1 0 0 1 1 1 0 13

  14. Logic Implementation • How to implement a desired logic function? 1) Write minterms a b c out minterm 2) sum of products: a b c 0 0 0 0 • OR of all minterms where out=1 0 0 1 1 a b c a b c 0 1 0 0 a b c 0 1 1 1 1 0 0 0 a b c a b c 1 0 1 1 a b c 1 1 0 0 1 1 1 0 a b c 14

  15. Logic Equations • NOT: = !a = ¬ a  out = ā NAND: • AND: = !(a & b) = ¬ (a ∧ b) • out = a ∙ b  o ut = a ∙ b = a & b = a ∧ b NOR: • OR: • out = a + b = !(a | b) = ¬ (a ∨ b)  out = a + b = a | b = a ∨ b XNOR: • XOR: • out = a ⊕ b = ab + ab  out = a ⊕ b = a � b + āb • Logic Equations  Constants: true = 1, false = 0  Variables: a, b, out, … • .  Operators (above): AND, OR, NOT, etc. 15

  16. Identities Identities useful for manipulating logic equations – For optimization & ease of implementation a + 0 = a + 1 = a + ā = a ∙ 0 = a ∙ 1 = a ∙ ā =

  17. Identities Identities useful for manipulating logic equations – For optimization & ease of implementation (a + b) = (a � b) = a + a b = a(b+c) = a(b + c) =

  18. Goals for Today • From Switches to Logic Gates to Logic Circuits • Logic Gates • From switches • Truth Tables • Logic Circuits • From Truth Tables to Circuits (Sum of Products) • Identity Laws • Logic Circuit Minimization – why? • Algebraic Manipulations • Truth Tables (Karnaugh Maps) • Transistors (electronic switch) 18

  19. Checking Equality w/Truth Tables circuits ↔ truth tables ↔ equations Example: (a+b)(a+c) = a + bc a b c 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 19

  20. Takeaway • Binary (two symbols: true and false) is the basis of Logic Design • More than one Logic Circuit can implement same Logic function. Use Algebra (Identities) or Truth Tables to show equivalence. 20

  21. Goals for Today • From Switches to Logic Gates to Logic Circuits • Logic Gates • From switches • Truth Tables • Logic Circuits • From Truth Tables to Circuits (Sum of Products) • Identity Laws • Logic Circuit Minimization • Algebraic Manipulations • Truth Tables (Karnaugh Maps) • Transistors (electronic switch) 21

  22. Karnaugh Maps How does one find the most efficient equation? –Manipulate algebraically until…? –Use Karnaugh Maps (optimize visually) –Use a software optimizer For large circuits –Decomposition & reuse of building blocks 22

  23. Minimization with Karnaugh maps (1) Sum of minterms yields a bc + a bc + a �  out = ab c + � b c a b c out 0 0 0 0 0 0 1 1 0 1 0 0 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 23

  24. Minimization with Karnaugh maps (2) Sum of minterms yields a bc + a bc + a �  out = ab c + � b c a b c out 0 0 0 0 0 0 1 1 Karnaugh map minimization 0 1 0 0 0 1 1 1  Cover all 1’s 1 0 0 1  Group adjacent blocks of 2 n 1 0 1 1 1’s that yield a rectangular 1 1 0 0 1 1 1 0 shape c ab  Encode the common features 00 01 11 10 of the rectangle 0 0 0 0 1  out = a � b + � a c 1 1 1 0 1 24

  25. Karnaugh Minimization Tricks (1) c ab 00 01 11 10 Minterms can overlap 0 0 1 1 1  out = 1 0 0 1 0 ab c 00 01 11 10 Minterms can span 2, 4, 8 0 1 1 1 1 or more cells 1 0 0 1 0  out = 25

  26. Karnaugh Minimization Tricks (2) ab cd 00 01 11 10 00 0 0 0 0 • The map wraps around 01 1 0 0 1  out = 11 1 0 0 1 10 0 0 0 0 ab 00 01 11 10 cd  out = � b � d 00 1 0 0 1 01 0 0 0 0 11 0 0 0 0 10 1 0 0 1 26

  27. Karnaugh Minimization Tricks (3) ab cd 00 01 11 10 00 0 0 0 0 • “Don’t care” values can be 01 interpreted individually in 1 x x x whatever way is convenient 11 1 x x 1 10  assume all x’s = 1 0 0 0 0  out = ab cd 00 01 11 10 00 1 0 0 x  assume middle x’s = 0  assume 4 th column x = 1 01 0 x x 0  out = 11 0 x x 0 10 1 0 0 1 27

  28. Minimization with K-Maps c ab (1) Circle the 1’s (see below) 00 01 11 10 (2) Each circle is a logical 0 0 0 1 0 component of the final equation 1 1 0 1 1 = a � b + � a c Rules: • Use fewest circles necessary to cover all 1’s • Circles must cover only 1’s • Circles span rectangles of size power of 2 (1, 2, 4, 8…) • Circles should be as large as possible (all circles of 1?) • Circles may wrap around edges of K-Map • 1 may be circled multiple times if that means fewer circles 28

  29. Multiplexer • A multiplexer selects between multiple inputs a  out = a, if d = 0 b  out = b, if d = 1 d • Build truth table a b d out 0 0 0 • Minimize diagram 0 0 1 • Derive logic diagram 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 29

  30. Takeaway • Binary (two symbols: true and false) is the basis of Logic Design • More than one Logic Circuit can implement same Logic function. Use Algebra (Identities) or Truth Tables to show equivalence. • Any logic function can be implemented as “sum of products”. Karnaugh Maps minimize number of gates. 30

  31. Goals for Today • From Switches to Logic Gates to Logic Circuits • Logic Gates • From switches • Truth Tables • Logic Circuits • From Truth Tables to Circuits (Sum of Products) • Identity Laws • Logic Circuit Minimization • Algebraic Manipulations • Truth Tables (Karnaugh Maps) • Transistors (electronic switch) 31

Recommend


More recommend