Gates and Logic Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell Universty See: P&H Appendix C.0, C.1, C.2.

Slides:



Advertisements
Similar presentations
Chapter 4 Gates and Circuits.
Advertisements

Switching circuits Composed of switching elements called “gates” that implement logical blocks or switching expressions Positive logic convention (active.
L14: Boolean Logic and Basic Gates
Logical Design.
Introduction to Digital Systems By Dr. John Abraham UT-Panam.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Gates and Logic See: P&H Appendix C.2, C.3 xkcd.com/74/
Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Circuits & Numbers See: P&H Chapter 2.4, 2.5, 3.2, C.5.
ECE C03 Lecture 41 Lecture 4 Combinational Logic Implementation Technologies Prith Banerjee ECE C03 Advanced Digital Design Spring 1998.
Chapter 4 Gates and Circuits.
Computer ArchitectureFall 2008 © August 20 th, Introduction to Computer Architecture Lecture 2 – Digital Logic Design.
Lecture 3. Boolean Algebra, Logic Gates
Gates A digital circuit is one in which only two logical values are present. Typically, a signal between 0 and 1 volt represents one value (e.g. binary.
Prof. Kavita Bala and Prof. Hakim Weatherspoon CS 3410, Spring 2014 Computer Science Cornell University See: P&H Appendix B.2 and B.3 (Also, see B.0 and.
Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Gates and Logic: From switches to Transistors, Logic Gates and Logic Circuits Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University.
3. DIGITAL ELECTRONICS..
Lecture 3. Boolean Algebra, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
1 Survey of Computer Science CSCI 110, Spring 2011 Lecture 16 Digital Circuits, binary Numbers.
ES 244: Digital Logic Design Chapter 1 Chapter 1: Introduction Uchechukwu Ofoegbu Temple University.
Chapter 4 Gates and Circuits. 4–2 Chapter Goals Identify the basic gates and describe the behavior of each Describe how gates are implemented using transistors.
Chapter 4 Gates and Circuits.
Lecture 3. Error Detection and Correction, Logic Gates Prof. Sin-Min Lee Department of Computer Science 2x.
1 CHAPTER 4: PART I ARITHMETIC FOR COMPUTERS. 2 The MIPS ALU We’ll be working with the MIPS instruction set architecture –similar to other architectures.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
Flip-flops, Latches and State Prof. Sirer COMP 303 Koç University.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Logic Design A Review. Binary numbers Binary numbers to decimal  Binary 2 decimal  Decimal 2 binary.
Digital Electronics. Introduction to Number Systems & Codes Digital & Analog systems, Numerical representation, Digital number systems, Binary to Decimal.
Introduction to Computing Systems from bits & gates to C & beyond Chapter 3 Digital Logic Structures Transistors Logic gates & Boolean logic Combinational.
Digital Logic Basics Chapter 2 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 
Concepts of Engineering and Technology Copyright © Texas Education Agency, All rights reserved.
The Digital Logic Level
Gates and Logic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell Universty See: P&H Appendix C.2 and C.3 (Also, see C.0 and C.1)
Digital Logic. 4 Why is 32-bit or 64-bit significant in terms of speed, efficiency? 4 Difference between OR and XOR 4 What is a mux for? PLA 4 Two kinds.
1 DLD Lecture 18 Recap. 2 Recap °Number System/Inter-conversion, Complements °Boolean Algebra °More Logic Functions: NAND, NOR, XOR °Minimization with.
Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
DIGITAL LOGIC ELECTRICITY, GATES, COMPONENTS. DIGITAL LOGIC READING: APPENDIX C THROUGH C.3 The Student shall be able to: Define voltage, current, resistance,
Gates and Logic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell Universty See: P&H Appendix C.2 and C.3 (Also, see C.0 and C.1)
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See: P&H Appendix B.2 and B.3 (Also, see B.1)
1 Ethics of Computing MONT 113G, Spring 2012 Session 1 Digital Circuits, binary Numbers Course webpage:
From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University.
Chapter 3 Digital Logic Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 3-2 Transistor: Building.
Announcements Assignment 6 due tomorrow No Assignment 7 yet.
– 1 – CSCE 211H Fall 2015 Lecture 5 Combinational Components Topics Products-of-Sums Form examples 5 variable and larger Karnaugh Maps Components: Decoders,
1 CS 151: Digital Design Chapter 3: Combinational Logic Design 3-1Design Procedure CS 151: Digital Design.
Logic Design EE-2121 Manesh T. Digital Systems  Introduction  Binary Quantities and Variables  Logic Gates  Boolean Algebra  Combinational Logic.
Numbers and Arithmetic Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Introduction to Computing Systems and Programming Digital Logic Structures.
BOOLEAN ALGEBRA LOGIC GATES. Introduction British mathematician George Boole( ) was successful in finding the link between logic and mathematics.
Minute Paper 4/4/04 Z=50+j86.7=100
– 1 – CSCE 211H Fall 2015 Lecture 5 Combinational Components Topics Products-of-Sums Form examples 5 variable and larger Karnaugh Maps Components: Decoders,
Week 1: Introduction and Logic gates IT3002 – Computer Architecture
Boolean Algebra & Logic Gates
From Switches to Transistors and Gates
Department of Preparatory Year, Umm Al Qura University
Combinational Logic Design&Analysis.
Introduction to Logic Gates
Digital Logic.
Fundamentals & Ethics of Information Systems IS 201
Basics Combinational Circuits Sequential Circuits
Basics Combinational Circuits Sequential Circuits Ahmad Jawdat
Chapter 4 Gates and Circuits.
4. Transistors and logic gates
Gates and Logic: From Transistors to Logic Gates and Logic Circuits
CS105 Introduction to Computer Concepts GATES and CIRCUITS
Computer Science 210 Computer Organization
Hakim Weatherspoon CS 3410, Spring 2013 Computer Science
Digital Electronics Lab 2 Instructor:
Combinatorial Logic Circuit
Presentation transcript:

Gates and Logic Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell Universty See: P&H Appendix C.0, C.1, C.2

Gates and Logic See: P&H Appendix C.0, C.1, C.2

3 Announcements Class newsgroup created Posted on web-page Use it for partner finding First assignment is to find partners Sections start next week Use this weeks section to find a partner Note about class No Verilog or VHDL Clickers not required, but will use them from time-to-time

4 A switch Acts as a conductor or insulator Can be used to build amazing things…

5 Better Switch One current controls another (larger) current Static Power: – Keeps consuming power when in the ON state Dynamic Power: – Jump in power consumption when switching

6 e N P N P N P N P N P N P NP e e e e e e e e e e e e e hole Atoms

7 B e e e e Si e e e SiliconPhosphorusBoron e P e e e e Elements

8 e Si e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e ee e e ee e e ee e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e ee e e ee e e e e e e e e e e e e e e e e e e e e e e e Silicon Silicon Crystal

9 e e e e e e e e e e e e e e e e e e e e e e e ee e e ee e e ee e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e ee e e e e e e e N-Type: Silicon + Phosphorus e P e e e e e P e e e e e P e e e e e P e e e e Phosphorus Doping

10 B e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e ee e e ee e e e e e e e e e e e e e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e e e e e e e e e ee e e e e e e e e e e ee e e e e e e e e e e e e e e e e e e ee e e e e e e e P-Type: Silicon + Boron B e e e B e e e B e e e Boron Doping

11 Semiconductors Insulator n-type (Si+Phosphorus) has mobile electrons: p-type (Si+Boron) has mobile holes: low voltage (mobile electrons) → conductor high voltage (depleted) → insulator low voltage (depleted) → insulator high voltage (mobile holes) → conductor

12 P-TypeN-Type e e e e e e e e e e e e e e Bipolar Junction low v → conductor high v → insulator low v → insulator high v → conductor

13 P-TypeN-Type e e e e e e e e e e e e e + – Reverse Bias low v → conductor high v → insulator low v → insulator high v → conductor e

14 P-TypeN-Type e e e e e e e e e e e e e ee e e e e e e e e e e e e e – + Forward Bias low v → conductor high v → insulator low v → insulator high v → conductor

15 Diodes p-typen-type PN Junction “Diode” Conventions: vdd = vcc = +1.2v = +5v = hi vss = vee = 0v = gnd

16 PNP Junction p-type n-type

17 Bipolar Junction Transistors Solid-state switch: The most amazing invention of the 1900s Emitter = “input”, Base = “switch”, Collector = “output” pnp C E=vdd B E C B vdd pn vss=E C B C E B vss n PNP TransistorNPN Transistor

18 Field Effect Transistors P-type FET Connect Source to Drain when Gate = lo Drain must be vdd, or connected to source of another P-type transistor N-type FET Connect Source to Drain when Gate = hi Source must be vss, or connected to drain of another N-type transistor Drain = vdd Source Gate Drain Source = vss Gate

19 Multiple Transistors InOut voltage Gate delay transistor switching time voltage, propagation, fanout, temperature, … CMOS design (complementary-symmetry metal–oxide – semiconductor) Power consumption = dynamic + leakage inout Vdd Vss t 0v +5v

20 Digital Logic InOut +5v 0v +5v voltage inout Vdd Vss t 0v +5v +2v +0.5v InOut truth table Conventions: vdd = vcc = +1.2v = +5v = hi = true = 1 vss = vee = 0v = gnd = false = 0

21 NOT Gate (Inverter) InOut inout Truth table Function: NOT Symbol: inout Vdd Vss

22 NAND Gate ABout b a A Vdd Vss B B A Vdd Function: NAND Symbol:

23 NOR Gate b a out A Vss Vdd B B A Vss Function: NOR Symbol: ABout

24 Building Functions AND: OR: NOT:

25 Universal Gates NAND is universal (so is NOR) Can implement any function with just NAND gates – De Morgan’s laws are helpful (pushing bubbles) useful for manufacturing E.g.: XOR (A, B) = A or B but not both (“exclusive or”) Proof: ?

26 Logic Equations Some notation: constants: true = 1, false = 0 variables: a, b, out, … operators: AND(a, b) = a b = a & b = a  b OR(a, b) = a + b = a | b = a  b NOT(a) = ā = !a =  a

27 Identities Identities useful for manipulating logic equations – For optimization & ease of implementation a + 0 = a + 1 = a + ā = a 0 = a 1 = a ā = (a + b) = (a b) = a + a b = a(b+c) = a 1 0 a 0 a b a + b a ab + ac a + bc

28 Logic Manipulation functions: gates ↔ truth tables ↔ equations Example: (a+b)(a+c) = a + bc abc

29 Logic Manipulation functions: gates ↔ truth tables ↔ equations Example: (a+b)(a+c) = a + bc abc a+ba+cLHS bcRHS

30

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 (or K maps) abcminterm 000abc for all outputs that are 1, take the corresponding minterm Obtain the result in “sum of products” form

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

Multiplexer Implementation abdout Build a truth table = abd + abd + a bd + a b d = ad + bd a b d 0

Multiplexer Implementation abdout Draw the circuit –out = ad + bd a b d 0 d out b a

Logic Gates One can buy gates separately –ex. 74xxx series of integrated circuits –cost ~$1 per chip, mostly for packaging and testing Cumbersome, but possible to build devices using gates put together manually

Integrated Circuits Or one can manufacture a complete design using a custom mask Intel Nehalem has approximately 731 million transistors

Voting machine Build something interesting A voting machine Assume: –A vote is recorded on a piece of paper, –by punching out a hole, –there are at most 7 choices –we will not worry about “hanging chads” or “invalids”

Voting machine For now, let’s just display the numerical identifier to the ballot supervisor –we won’t do counting yet, just decoding –we can use four photo-sensitive transistors to find out which hole is punched out A photo-sensitive transistor detects the presence of light Photo-sensitive material triggers the gate

Ballot Reading –Input: paper with a hole in it –Out: number the ballot supervisor can record Ballots The 3410 vote recording machine

Encoders N sensors in a row Want to distinguish which of the N sensors has fired Want to represent the firing sensor number in compact form –N might be large –Only one wire is on at any time –Silly to route N wires everywhere, better to encode in log N wires a b o0o0 1 c d o1o1 A 3-bit encoder (7-to-3) (5 inputs shown) o2o2 e 5....

Number Representations Decimal numbers are written in base 10 –3 x x 10 0 = 37 Just as easily use other bases –Base 2 - “Binary” –Base 8 - “Octal” –Base 16 – “Hexadecimal”

Number Representations Base conversion via repetitive division –Divide by base, write remainder, move left with quotient –Sanity check with 37 and base

Binary Representation Check 37 and base 2 37 =

Hexadecimal Representation 37 decimal = (25) 16 Convention –Base 16 is written with a leading 0x –37 = 0x25 Need extra digits! –0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F Binary to hexadecimal is easy –Divide into groups of 4, translate groupwise into hex digits

Encoder Truth Table a b 1 c d o1o1 A 3-bit encoder with 4 inputs for simplicity abcdo2o1o o0o0 o1o1 o2o2 o2 = abcd o1 = abcd + abcd o0 = abcd + abcd

Ballot Reading Ok, we built first half of the machine Need to display the result Ballots The 3410 voting machine

7-Segment LED Decoder 4 inputs encoded in binary 8 outputs, each driving an independent, rectangular LED Can display numbers Just a simple logic circuit Write the truth table

7-Segment LED Decoder 4 inputs encoded in binary 8 outputs, each driving an independent, rectangular LED Can display numbers

7-Segment LED Decoder 4 inputs encoded in binary 8 outputs, each driving an independent, rectangular LED Can display numbers

7-Segment Decoder Truth Table i3i3 i2i2 i1i1 i0i0 o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 Exercise: find the error(s) in this truth table

7-Segment Decoder Truth Table i3i3 i2i2 i1i1 i0i0 o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o o0o0 o1o1 o2o2 o3o3 o4o4 o5o5 o6o6 Exercise: find the error(s) in this truth table

Ballot Reading Done! Ballots The 3410 voting machine

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