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. Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and


  1. Gates and Logic: From Transistors to Logic Gates and Logic Circuits Prof. Anne Bracy CS 3410 Computer Science Cornell University The slides are the product of many rounds of teaching CS 3410 by Professors Weatherspoon, Bala, Bracy, and Sirer.

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

  3. Silicon Valley & the Semiconductor Industry • Transistors: Youtube video “How does a transistor work” • https://www.youtube.com/watch?v=IcrBqCFLHIY Break: show some Transistor, Fab, Wafer photos • 3

  4. Transistors 101 Gate Gate Source Drain Source Drain — Insulator Insulator + + - + + + + - + + + + + + + + + - + - P-type channel created - - - - - - - + + + + + + + + + - + - + - + + - - P-type P-type P-type P-type - N-type - N-type - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Off On N-Type Silicon: negative free-carriers (electrons) P-Type Silicon: positive free-carriers (holes) P-Transistor: negative charge on gate generates electric field that creates a (+ charged) p-channel connecting source & drain N-Transistor: works the opposite way Metal-Oxide Semiconductor (Gate-Insulator-Silicon) Complementary MOS = CMOS technology uses both p- & n-type • transistors 4

  5. CMOS Notation N-type On/Closed Off/Open 0 1 gate P-type On/Closed Off/Open 0 1 gate Gate input controls whether current can flow between the other two terminals or not. Hint: the “o” bubble of the p-type tells you that this gate wants a 0 to be turned on 5

  6. iClicker Question Which of the following statements is false ? (A) P- and N-type transistors are both used in CMOS designs. (B) As transistors get smaller, the frequency of your processor will keep getting faster. (C) As transistors get smaller, you can fit more and more of them on a single chip. (D) Pure silicon is a semi conductor. (E) Experts believe that Moore’s Law will soon end. 6

  7. 2-Transistor Combination: NOT • Logic gates are constructed by combining transistors in complementary arrangements • Combine p&n transistors to make a NOT gate: CMOS Inverter : power source (1) power source (1) power source (1) — + p-gate p-gate p-gate closes stays open 0 0 1 1 output input n-gate n-gate n-gate closes — + stays open ground (0) ground (0) ground (0) 7

  8. Inverter V supply (aka logic 1) Function: NOT Symbol: in out out in Truth Table: (ground is logic 0) In Out 0 1 1 0 8

  9. Logic Gates Digital circuit that either allows • signal to pass through it or not Used to build logic functions • Seven basic logic gates: • AND, OR , NOT , NAND (not AND), Ge George rge Boole le,(1815-1864) 1864) NOR (not OR), XOR Did you know? XNOR (not XOR) George Boole Inventor of the idea of logic gates. He was born in Lincoln, England and he was the son of a shoemaker. 9

  10. Logic Gates: Names, Symbols, Truth Tables A Out NOT: A 0 1 1 0 A B Out A B Out A A 0 0 1 NAND: 0 0 0 AND: B 0 1 1 B 0 1 0 1 0 1 1 0 0 1 1 0 1 1 1 A B Out A B Out OR: A A 0 0 1 NOR: 0 0 0 B B 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 A B Out A B Out XOR: . A A XNOR: 0 0 1 0 0 0 B B 0 1 0 0 1 1 1 0 0 1 0 1 1 1 1 1 1 0

  11. NOR Gate V supply Function: NOR Symbol: A a B out b out A B Truth Table: A B out 0 0 1 0 1 0 1 0 0 1 1 0 11

  12. iClicker Question Which Gate is this? Function: V supply V supply Symbol: A B out B Truth Table: A B out A 0 0 (A) NOT 0 1 (B) OR 1 0 (C) XOR (D) AND 1 1 (E) NAND 12

  13. Abstraction • Hide complexity through simple abstractions § Simplicity • Box diagram represents inputs and outputs § Complexity • Hides underlying NMOS- and PMOS-transistors and atomic interactions Vdd a in out d out b Vss a d out out in 13 b

  14. iClicker Question Which Gate is this? Function: Symbol: a b Out Truth Table: A B out 0 0 (A) NOT 0 1 (B) OR 1 0 (C) XOR (D) AND 1 1 (E) NAND 14

  15. Universal Gates • NAND and NOR: § Can implement any function with NAND or just NOR gates § useful for manufacturing • NOT: a • AND: a b • OR: a b 15

  16. What does this logic circuit do? Function: Symbol: a Truth Table: Out d a b d Out 0 0 0 b 0 0 1 0 1 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 Multiplexing Like a Boss 16

  17. Goals for Today • From Switches to Logic Gates to Logic Circuits • Transistors, Logic Gates, Truth Tables • Logic Circuits § From Truth Tables to Circuits (Sum of Products) § Identity Laws • Logic Circuit Minimization § Algebraic Manipulations § Karnaugh Maps 17

  18. Logic Implementation How to implement a desired logic function? 1) Write minterms a b c out minterm 2) Write sum of products: 0 0 0 0 a b c OR of all minterms where out=1 0 0 1 1 a b c out = abc + abc + abc 0 1 0 0 a b c 0 1 1 1 a b c a 1 0 0 0 a b c b c 1 0 1 1 a b c out 1 1 0 0 a b c 1 1 1 0 a b c Any combinational circuit can be implemented in two levels of logic (ignoring inverters) 18

  19. Logic Equations NOT: = ā = !a = ¬ a NAND: AND: = a · b = a & b = a Ù b (a ⚫ b) = !(a & b) = ¬ (a Ù b) OR: = a + b = a | b = a Ú b NOR: (a + b) = !(a | b) = ¬ (a Ú b) XOR: = a Å b = a b + āb XNOR: (a ⨁ b) = ab + ab Logic Equations § Constants: true = 1, false = 0 § Variables: a, b, out, … § Operators (above): AND, OR, NOT, etc. 19

  20. Identities Identities useful for manipulating logic equations • For optimization & ease of implementation a + 0 = a a + 1 = 1 a + ā = 1 a · 0 = 0 a · 1 = a a · ā = 0 20

  21. Identities Identities useful for manipulating logic equations • For optimization & ease of implementation ( a + b ) = a • b A A ↔ B ( ab ) = a + b B A A ↔ B B a + a b = a a (b+c) = ab + ac a ( b + c ) = a + b • c 21

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

  23. Minimization Example a + 0 = a Minimize this logic equation: a + 1 = 1 a + ā = 1 (a+b)(a+c) = (a+b)a + (a+b)c a · 0 = 0 a · 1 = a = aa + ba + ac + bc a · ā = 0 = a + a(b+c) + bc = a + bc a + a b = a a (b+c) = ab + ac ( a + b ) = a • b ( ab ) = a + b a ( b + c ) = a + b • c 23

  24. iClicker Question a + 0 = a (a+b)(a+c) à a + bc a + 1 = 1 a + ā = 1 How many gates were a · 0 = 0 a · 1 = a required before and after? a · ā = 0 a + a b = a BEFORE AFTER a (b+c) = ab + ac (A) 2 OR 1 OR (B) 2 OR, 1 AND 2 OR ( a + b ) = a • b (C) 2 OR, 1 AND 1 OR, 1 AND (D) 2 OR, 2 AND 2 OR ( ab ) = a + b (E) 2 OR, 2 AND 2 OR, 1 AND a ( b + c ) = a + b • c 24

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

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

  27. Minimization in Practice 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 27

  28. Building a Karnaugh Map a b c out Sum of minterms yields 0 0 0 0 out = 0 0 1 1 0 1 0 0 abc + abc + abc + abc 0 1 1 1 1 0 0 1 1 0 1 1 1 1 0 0 1 1 1 0 c ab 00 01 11 10 K-maps identify which inputs 0 0 0 1 0 are relevant to the output 1 1 0 1 1 28

  29. 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 = a b " 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 29

  30. Karnaugh Minimization Tricks (1) c ab 00 01 11 10 Minterms can overlap 0 1 1 1 0 out = b c " + a c " + ab 0 0 1 0 1 ab c 00 01 11 10 Minterms can span 2, 4, 8 or 1 1 1 1 0 more cells 0 0 1 0 1 out = c " + ab 30

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

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend