Digital Logic Zach Cashero Berthoud High School Berthoud, CO This program is based upon collaborative work supported by a National Science Foundation Grant No. 0841259; Colorado State University, Thomas Chen, Principal Investigator, Michael A. de Miranda and Stuart Tobet Co-Principal Investigators. Any opinions, findings, conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. Analog vs. Digital Signals Analog - continuous signal audio Digital - discrete signal, either on or off QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. Photo: http://markun.cs.shinshu-u.ac.jp Digital Everything in your computer is represented as 0’s and 1’s 0 = OFF = Low voltage = 0 V 1 = ON = High voltage = +5 V Why Digital? Much simpler More predictable Able to build more complex functionality Much easier to design a circuit that has 2 states: OFF and ON Logic Gates NOT - inverts the signal 0→1 1→0 AND output is a 1 only if ALL inputs are 1 OR output is a 1 if ANY inputs are 1 Truth Tables Mapping of inputs to output value Must list all possible combinations of inputs How many different combinations are there for 2 inputs? Inputs … … Output . . Truth Tables Mapping of inputs to output value Must list all possible combinations of inputs How many different combinations are there for 2 inputs? 4 00, 01, 10, 11 Inputs … … Output . . NOT Gate 1 input, 1 output QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org AND Gate 2 inputs, 1 output QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org OR Gate 2 inputs, 1 output QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org Transistor NOT Gate QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org Transistor NOT Gate QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org Practical Example QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org AND Gate Using Transistors QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.allaboutcircuits.com Copyright © 1999-2000 Michael Stutz stutz@dsl.org AND Gate IC Photo: http://www.physics.mcmaster.ca Binary Numbers All numbers can be represented as a string of 0’s and 1’s 0 1 2 3 → → → → . . . . . 255 00000000 00000001 00000010 00000011 . . . . . → 11111111 Full Adder Can be tied together to add larger binary numbers QuickTime™ and a TIFF (Uncompressed) decompressor are needed to see this picture. http://www.cise.ufl.edu Inputs Outputs A B Cin Cout Sum 0 0 0 0 0 0 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 0 1 1 0 1 1 0 1 1 0 1 0 1 1 1 1 1 Summary Silicon ⇓ Create channels to conduct current (doping and photolithography) ⇓ Transistors ⇓ Analog signal ⇓ Digital signal ⇓ Logic gates ⇓ Logic blocks ⇓ Microprocessor ⇓ Computer