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)

Slides:



Advertisements
Similar presentations
Switching circuits Composed of switching elements called “gates” that implement logical blocks or switching expressions Positive logic convention (active.
Advertisements

L14: Boolean Logic and Basic Gates
Digital Circuits.
ECE 238L Computer Logic Design Spring 2010
Kevin Walsh CS 3410, Spring 2010 Computer Science Cornell University Gates and Logic See: P&H Appendix C.2, C.3 xkcd.com/74/
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.
Relationship Between Basic Operation of Boolean and Basic Logic Gate The basic construction of a logical circuit is gates Gate is an electronic circuit.
Lecture 14 Today we will Learn how to implement mathematical logical functions using logic gate circuitry, using Sum-of-products formulation NAND-NAND.
Contemporary Logic Design Two-Level Logic © R.H. Katz Transparency No. 4-1 Chapter #2: Two-Level Combinational Logic Section 2.3, Switches and Tools.
Boolean Algebra and Truth Table The mathematics associated with binary number system (or logic) is call Boolean: –“0” and “1”, or “False” and “True” –Calculation.
Gates and Logic Hakim Weatherspoon CS 3410, Spring 2011 Computer Science Cornell Universty See: P&H Appendix C.0, C.1, C.2.
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.
Chapter 2: Boolean Algebra and Logic Functions
Unit 7, Chapter 24 CPO Science Foundations of Physics.
Gates and Logic: From switches to Transistors, Logic Gates and Logic Circuits Hakim Weatherspoon CS 3410, Spring 2013 Computer Science Cornell University.
ECE 331 – Digital System Design Transistor Technologies, and Realizing Logic Gates using CMOS Circuits (Lecture #23)
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.
1 Fundamentals of Computer Science Propositional Logic (Boolean Algebra)
Lecture 17: Digital Design Today’s topic –Intro to Boolean functions Reminders –HW 4 due Wednesday 10/8/2014 (extended) –HW 5 due Wednesday 10/15/2014.
BOOLEAN ALGEBRA Saras M. Srivastava PGT (Computer Science)
Logic Design A Review. Binary numbers Binary numbers to decimal  Binary 2 decimal  Decimal 2 binary.
Digital Logic Basics Chapter 2 S. Dandamudi To be used with S. Dandamudi, “Fundamentals of Computer Organization and Design,” Springer, 
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.
Digital Circuits. Review – Getting the truth table The first step in designing a digital circuit usually is to get the truth table. That is, for every.
Numbers & Arithmetic Hakim Weatherspoon CS 3410, Spring 2012 Computer Science Cornell University See: P&H Chapter , 3.2, C.5 – C.6.
Review: Most semiconductors are made of a poor conductor that has had impurities (atoms of another material) added to it. The process of adding impurities.
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)
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
Lecture 22: 11/19/2002CS170 Fall CS170 Computer Organization and Architecture I Ayman Abdel-Hamid Department of Computer Science Old Dominion University.
Week 6: Gates and Circuits: PART I READING: Chapter 4.
Chapter 3: Digital Logic Dr Mohamed Menacer Taibah University
ENG241 Digital Design Week #2 Combinational Logic Circuits.
Prof. Hakim Weatherspoon CS 3410, Spring 2015 Computer Science Cornell University See: P&H Appendix B.2 and B.3 (Also, see B.1)
Transistors, Logic Gates and Karnaugh Maps References: Lecture 4 from last.
From Switches to Transistors and Gates Prof. Sirer CS 316 Cornell University.
Announcements Assignment 6 due tomorrow No Assignment 7 yet.
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
The First lesson on Digital Logic Rachaen M. Huq1 Rachaen Huq. Dept. of EEE, BRACU.
©2010 Cengage Learning SLIDES FOR CHAPTER 8 COMBINATIONAL CIRCUIT DESIGN AND SIMULATION USING GATES Click the mouse to move to the next page. Use the ESC.
K-maps and Decoders Prof. Sin-Min Lee Department of Computer Science.
Winter 2016CISC101 - Prof. McLeod1 Today Take some of the “MAGIC” out of how computers work: How did the technology get to where it is today? –ENIAC movie.
Introduction Semiconductors are materials whose electrical properties lie between Conductors and Insulators. Ex : Silicon and Germanium.
Hoda Roodaki Boolean Algebra Hoda Roodaki
Assembly Lab1 - Review.
Boolean Algebra & Logic Gates
From Switches to Transistors and Gates
Department of Preparatory Year, Umm Al Qura University
Logic Gates and Logic Circuits
Chapter 2: Boolean Algebra and Logic Functions
Digital Logic.
Basics Combinational Circuits Sequential Circuits
4. Transistors and logic gates
Gates and Logic: From Transistors to Logic Gates and Logic Circuits
Hakim Weatherspoon CS 3410, Spring 2013 Computer Science
Digital Circuits.
BASIC & COMBINATIONAL LOGIC CIRCUIT
EECS 465: Digital Systems Lecture Notes # 2
Combinatorial Logic Circuit
Dr. Clincy Professor of CS
Gates and Logic: From Transistors to Logic Gates and Logic Circuits
Chapter 5 Combinational Logic Analysis
Chapter 2 Digital Design and Computer Architecture, 2nd Edition
Gates and Logic: From Transistors to Logic Gates and Logic Circuits
Digital Circuits.
Computer Architecture
Digital Circuits.
Presentation transcript:

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)

2 What came was Von Neumann Architecture? a) The calculator b) The Bombe c) The Colossus d) The ENIAC e) All of the above

3 What came was Von Neumann Architecture?

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

5 Goals for today To understand how to program, we will build a processor (i.e. a logic circuit) Logic circuits Use P- and N-transistors to implement NAND or NOR gates Use NAND or NOR gates to implement the logic circuits Build efficient logic circuits

6 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

7 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

8 B e e e e Si e e e SiliconPhosphorusBoron e P e e e e Elements

9 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

10 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

11 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

12 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

13 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

14 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

15 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

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

17 PNP Junction p-type n-type

18 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

19 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

20 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

21 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

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

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

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

25 Building Functions AND: OR: NOT:

26 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: ?

27 Administrivia Make sure you have access to CMS and Piazza.com Lab Sections started this week Lab0 turned in during Section Bring laptop to section, if possible (not required) Lab1 available Monday next week (due following Monday) Group projects start in week 4 (partner in same section) Homework1 available Monday Due following Monday Office hours start next week More information available on website by this weekend Clickers not required, bring to every lecture Participation, not attendance

28 Example: Big Picture Computer System Organization and Programming platform from 10 years ago P- and N-transistors -> NAND and NOR gates -> logic circuit -> processor -> software -> applications (computers, cell phones, TVs, cars, airplanes, buildings, etc).

29 Big Picture: Abstraction Hide complexity through simple abstractions Simplicity –Box diagram represents inputs and outputs Complexity –Hides underlying P- and N-transistors and atomic interactions in out Vdd Vss inout a d b a b d

30 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

31 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

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

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

34

Predictive – logic minimization How to standardize minimizing logic circuits?

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

Karnaugh maps Encoding of the truth table where adjacent cells differ in only one bit about truth table for AND Corresponding Karnaugh map ab

Bigger Karnaugh Maps 3-input func a b c y ab c 4-input func a b c y ab cd d 11 10

abcout Sum of minterms yields abc + abc + abc + abc Minimization with Karnaugh maps (1)

abcout Sum of minterms yields abc + abc + abc + abc Karnaugh maps identify which inputs are (ir)relevant to the output c ab Minimization with Karnaugh maps (2)

abcout 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 c ab Minimization with Karnaugh maps (2)

Karnaugh Minimization Tricks (1) c ab c ab

Karnaugh Minimization Tricks (1) Minterms can overlap out = bc + ac + ab Minterms can span 2, 4, 8 or more cells out = c + ab c ab c ab

Karnaugh Minimization Tricks (2) ab cd ab cd 11 10

Karnaugh Minimization Tricks (2) The map wraps around –out = bd ab cd ab cd 11 10

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 0xx ab cd xxx 1xx ab cd 11 10

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

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

Multiplexer Implementation abdout Build the Karnaugh map a b d d ab

Multiplexer Implementation abdout Derive Minimal Logic Equation out = ad + bd a b d d ab

Multiplexer Implementation d out b a d ab Derive Minimal Logic Equation out = ad + bd abdout a b d

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