Presentation is loading. Please wait.

Presentation is loading. Please wait.

From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University.

Similar presentations


Presentation on theme: "From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University."— Presentation transcript:

1 From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University

2 Origins The most amazing and likely to be most long- lived invention of the 1800’s was…

3 Origins The most amazing and likely to be most long- lived invention of the 1800’s was… The steam engine? The lightning rod? The carbonated beverage?

4 Origins The most amazing and likely to be most long- lived invention of the 1800’s was… THE ELECTRIC SWITCH

5 A switch A switch is a simple device that can act as a conductor or isolator Can be used for amazing things…

6 Switches Either (OR) Both (AND) + - - One can build basic devices, but operation requires mechanical force

7 Transistors What happens when switches are replaced with solid-state devices The most amazing invention of the 1900s Can be used for purposes other than switching (e.g. radios) Two types, PNP and NPN base collector emitter N PP collectoremitter -+ PNP base collector P NN emitter + - NPN

8 NPN Transistor Connect E to C when base = 1 P and N Transistors PNP Transistor Connect E to C when base = 0 E C E C B B Can be used to build primitives from which electronic machines can be constructed

9 Then and Now The first transistor, on a workbench at AT&T Bell Laboratories in 1947 An Intel Pentium has approximately 125 million transistors

10 Inverter in out + gnd InOut 01 10 Function: NOT Called an inverter Symbol: Useful for taking the inverse of an input in out Truth table

11 NAND Gate a out + gnd b ABout 001 101 011 110 Function: NAND Symbol: b a out

12 NOR Gate a out + gnd b ABout 001 100 010 110 Function: NOR Symbol:

13 Building Functions NOT: AND: OR: NAND and NOR are universal, can implement any function using just NAND or just NOR gates useful for manufacturing Can specify functions by describing gates, truth tables or logic equations b a b a

14 Logic Equations AND out = ab OR out = a + b NOT out = a

15 Identities Identities are useful for manipulating logic equations For purposes of optimization & ease of implementation a + a = 1 a + 0 = a a + 1 = 1 aa = 0 a0 = 0 a1 = a a(b+c) = ab + ac (a + b) = a b (a b) = a + b a + a b = a + b

16 Logic Manipulation abca+ba+cLHSbcRHS 00000000 00101000 01010000 01111111 10011101 10111101 11011101 11111111 Can manipulate logic equations algebraically Can also use a truth table to prove equivalence Example: (a+b)(a+c) = a + bc (a+b)(a+c) = aa + ab + ac + bc = a + a(b+c) + bc = a(1 + (b+c)) + bc = a + bc

17 Logic Minimization A common problem is how to implement a desired function most efficiently One can derive the equation from the truth table How does one find the most efficient equation? Manipulate algebraically until satisfied Use Karnaugh maps abcminterm 000abc 001 010 011 100 101 110 111 for all outputs that are 1, take the corresponding minterm, OR the minterms to obtain the result in “sum of products” form

18 Karnaugh maps Encoding of the truth table where adjacent cells differ in only one bit about 000 010 100 111 0010 00 01 11 10 truth table for AND Corresponding Karnaugh map ab

19 Bigger Karnaugh Maps 3-input func a b c y 00 01 11 10 0 1 ab c 4-input func a b c y 00 01 11 10 00 01 ab cd d 11 10

20 Minimization with Karnaugh maps (1) abcout 0000 0011 0100 0111 1001 1011 1100 1110 Sum of minterms yields abc + abc + abc + abc

21 Minimization with Karnaugh maps (2) abcout 0000 0011 0100 0111 1001 1011 1100 1110 Sum of minterms yields abc + abc + abc + abc Karnaugh maps identify which inputs are (ir)relevant to the output 0001 1101 00 01 11 10 0 1 c ab

22 Minimization with Karnaugh maps (2) abcout 0000 0011 0100 0111 1001 1011 1100 1110 Sum of minterms yields abc + abc + abc + abc Karnaugh map minimization Cover all 1’s Group adjacent blocks of 2 n 1’s that yield a rectangular shape Encode the common features of the rectangle  out = ab + ac 0001 1101 00 01 11 10 0 1 c ab

23 Karnaugh Minimization Tricks (1) Minterms can overlap out = bc + ac + ab Minterms can span 2, 4, 8 or more cells out = c + ab 0111 0010 00 01 11 10 0 1 c ab 1111 0010 00 01 11 10 0 1 c ab

24 Karnaugh Minimization Tricks (2) The map wraps around out = bd 1001 0000 0000 1001 00 01 11 10 00 01 ab cd 11 10 0000 1001 1001 0000 00 01 11 10 00 01 ab cd 11 10

25 Karnaugh Minimization Tricks (3) “Don’t care” values can be interpreted individually in whatever way is convenient assume all x’s = 1 out = d assume middle x’s = 0 assume 4 th column x = 1 out = bd 100x 0xx0 0xx0 1001 00 01 11 10 00 01 ab cd 11 10 0000 1xxx 1xx1 0000 00 01 11 10 00 01 ab cd 11 10

26 Multiplexors A multiplexor selects between multiple inputs out = a, if d = 0 out = b, if d = 1 Build truth table Build Karnaugh map Derive logic diagram a b d 0

27 Multiplexor Implementation abdout 0000 0010 0100 0111 1001 1010 1101 1111 Build a truth table a b d 0

28 Multiplexor Implementation abdout 0000 0010 0100 0111 1001 1010 1101 1111 Build the Karnaugh map a b d 0 0011 0110 00 01 11 10 0 1 d ab

29 Multiplexor Implementation abdout 0000 0010 0100 0111 1001 1010 1101 1111 Derive minimal logic equation out = ad + bd a b d 0 0011 0110 00 01 11 10 0 1 d ab

30 Multiplexor Implementation abdout 0000 0010 0100 0111 1001 1010 1101 1111 Draw the circuit out = ad + bd a b d 0 0011 0110 00 01 11 10 0 1 d ab d out b a

31 Summary We can now implement any logic circuit Can do it efficiently, using Karnaugh maps to find the minimal terms required Can use either NAND or NOR gates to implement the logic circuit Can use P- and N-transistors to implement NAND or NOR gates


Download ppt "From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University."

Similar presentations


Ads by Google