52
Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Embed Size (px)

Citation preview

Page 1: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Introduction to Digital ElectronicsWelcome to MIT!

Instructor: Alex Hanson

Page 2: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

About the Instructor

Alex HansonFrom: Salt Lake City, UTCollege: Dartmouth College – Electrical Engineering, Engineering Sciences, and PhysicsNow: Graduate student in Electrical Engineering and Computer Science at [email protected]

Page 3: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

About the Class

Professions

Engineering

Mechanical

Chemical

Civil

Electrical

Analog Circuits

Digital Circuits

Power Electronics

Signal Processing

Medicine

Law

Business

Page 4: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

About the Class

• Before this class: Prerequisites– Algebra I is required – if you feel that you do not

meet this requirement, don’t worry. Talk to me after class.

• After this class: Majors and Careers– All electrical engineers know digital electronics– Digital integrated circuits, embedded systems– Medical devices are almost all electronic– Med schools, law schools, and finance industry love

engineering majors

Page 5: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Syllabus

• Required participation– Attendance, good-faith effort, good behavior

• Homework– Will give for practice, will evaluate if desired– Optional Textbook: • Digital Design by Frank Vahid

• Lab-based class…– 30-60 min “class time” – 60+ min “lab time”

Page 6: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Labs – Respect and Safety

• Don’t break things• Don’t stab yourself• Don’t shock yourself• Don’t “short” batteries

• Clean up

Page 7: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Course Objectives

• By the end of this course, you will be able to:– Build a breadboard prototype from a schematic– Install integrated circuits from info on datasheets– Design combinational logic blocks (decision

making)– Design sequential logic blocks (sequential

thinking)– Implement an idea into a custom digital circuit

Page 8: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today

• Introduction to Analog/Digital Information• Introduction to Electricity • Introduction to Lab Practice• Lab – Analog to Digital Converter

Page 9: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today

Page 10: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Electricity – Information and Energy

• We encode information in the form of electrical signals and use those signals to communicate

• We transfer energy in the form of electricity to do useful work

Page 11: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Analog and Digital Codes

• Information that uses an analog code is one which can represent any value

• “An analog signal is continuous”– Example – we want to communicate information about a

force, so we make an electrical “code” where the voltage is a constant times the force

– Just like the “real-world” value , the coded value can take on any value

Page 12: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Analog and Digital Codes

Page 13: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Analog and Digital Codes

• Information that uses a digital code is one which can only represent values in steps

• “A digital signal is discrete”– Example – we want to have information about a force, so

we make a code where “1” means 1 Newton, “2” means 2 Newtons, etc.

– If the real force is 5.8 Newtons, that information is encoded as “6” (depending on the conversion)

– Unlike the “real-world” value , the coded value can only take discrete values.

– We “throw away” information when digitizing, always an approximation

Page 14: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Analog and Digital Codes

Page 15: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

What is voltage anyway?

• The amount of potential energy per charge in a configuration is the configuration’s voltage

• Since voltage and energy are so closely related, people often refer to places in a circuit with high voltage as being “energized”

• “Electric Potential” = “Voltage”

• Like charges (++ or --) repel each other, so it takes energy to push them together

Page 16: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

What is voltage anyway?• In a conductor (metal) electrons can move about

freely, and will spread out on the surface.• It turns out that this configuration causes the

voltage to be the same everywhere on the metal.• We can sensibly talk about “the voltage on a wire”

without specifying where on the wire.

Page 17: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Voltage

• How many voltages are in this circuit?

Page 18: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Voltage

• There are 4 voltages

Page 19: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Voltage, Force, and Current

• An electron experiences a force which will try to move the electron toward higher voltage. In metals, there very little “friction.”

• Some things “get in the way” and slow down the flow of electrons, like resistors

• The flow of electrons is called “current”

Page 20: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

A note on signs

• Electrons (negative charges) flow in a circuit, and they flow “backward” from low voltage to high voltage

• To avoid confusion with the double negative, we usually think about positive charges moving from high voltage to low voltage (“conventional current”).

• We know this isn’t true, but it’s a convention that helps us keep everyone on the same page.

Page 21: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Current• What direction will electrons flow?• What direction does “conventional current” flow?

𝟓𝑽 3

20

Page 22: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Current• What direction will electrons flow?• What direction does “conventional current” flow?

𝟓𝑽 3

20

Page 23: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Current• Conventional current follows purple arrows• Electrons move the opposite direction

𝟓𝑽 3

20

Page 24: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Voltage and Current

• Electric potential (voltage) is a property of a location. We talk about voltage at a node.

• The voltage difference between two points is the voltage across a component.

• Electric current is a property that goes through a path. We talk about current through a component.

Page 25: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today’s ProjectA “Flash” Analog to Digital Converter

Page 26: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today’s ProjectA “Flash” Analog to Digital Converter

Components

Page 27: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Analog to Digital Conversion

Page 28: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Unary or “Thermometer” Code

Page 29: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Component 1 – Resistor String

Current is same through all resistors => so is the voltage drop across each resistor.

4.8 V

3.6 V

2.4 V

1.2 V

6.0 V

0.0 V

Page 30: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Component 2 - Comparator

Page 31: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Component 3 – Light Emitting Diode• Diodes allow current in only one direction• Diodes will only turn on with at least 0.5 V

across them

Page 32: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Current Limiting in LEDs

• What would the current be without the resistor?

• What would happen if we made this circuit in real life?

Page 33: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Current Limiting in LEDs

• ALWAYS use a resistor in series with an LED• Always use a resistor that’s BIG ENOUGH to

limit the current– How big is big enough? Depends on the current

limit of the LED. Usually 330 Ohm is sufficient.

OTHERWISE YOU WILL DESTROY YOUR LED, OR WORSE, YOUR BATTERY

Page 34: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Component 4:Force Sensing Resistor (FSR)

“Piezoresistance”

Page 35: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Component 5 – Op Amp• An Op-Amp amplifies the difference between two inputs,

usually operated in feedback (an advanced topic). We will use an op-amp in our force-measurement circuit.

“Unity Gain Buffer” Configuration

Page 36: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today’s ProjectA “Flash” Analog to Digital Converter

Sub-Systems

Page 37: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Sub-System 1: Transduction• “Transduction” is the conversion of real-world

information (force, altitude, speed, etc.) into an electrical signal, usually analog

Page 38: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Sub-System 2: “Flash” ADC

Digital code representing the analog input

Real-world information encoded as an analog signal

Page 39: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Sub-System 3: Display• We would like an easy way to see the output

of our converter. For this project, we will use an LED bar.

• The output of each comparator will turn on/off an LED

Page 40: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

System 3 Modification• Our comparators can’t push current; they can

pull or turn off (“open circuit”)

Page 41: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

System 3 Modification• Our comparators can’t push current; they can

pull or turn off (“open circuit”)

Page 42: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

System 3: Option 1

Page 43: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

System 3: Option 2

Page 44: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Final Diagram

Page 45: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Today’s ProjectA “Flash” Analog to Digital Converter

Assembly

Page 46: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

BreadBoards

Page 47: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Integrated Circuits

Page 48: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Integrated Circuits

• Always remember to connect all power pins and ground pins, in addition to inputs/outputs

• Align integrated circuits in the same way (usually notch to the left)

• Pins can be sharp – be careful!• You may have to bend the pins in slightly to

get them to fit in the breadboard – be gentle

Page 49: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Resistors

Page 50: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

LEDs

Page 51: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Have at it!

• Teams of 3-6 (limited supplies)• EVERYTHING is to be kept. THROW NOTHING

AWAY.• Keep your breadboard neat, try to color code

your signals, USE RED FOR +6V and BLACK FOR GROUND.

• See my example project as a reference.• The room must be SPOTLESS before we leave.

Page 52: Introduction to Digital Electronics Welcome to MIT! Instructor: Alex Hanson

Image References• http://www.1epoxyflooring.com/wp-content/gallery/flooring-salt-lake-city/saltlakecityflooring.jpg• http://m-static.flikie.com/ImageData/WallPapers/1a351f9b3c0244bdafbf54c4cc3cb2f6.jpg• http://drleonardcoldwell.com/wp-content/uploads/2014/03/cell-phones.jpg• http://hacks.mit.edu/by_year/1991/fire_hydrant/full_large.gif• https://upload.wikimedia.org/wikipedia/commons/d/d4/Electric_car_charging_Amsterdam.jpg• http://screaminfx.com/images/tech-images/what-is-analog-verse-digital-explanation.jpg• https://learn.sparkfun.com/tutorials/what-is-electricity• http://www.physicsclassroom.com/Class/estatics/u8l1d1.gif• http://wikieducator.org/images/c/c3/Simple_circuit.gif• "CPT-Sound-ADC-DAC" by A-D-A_Flow.svg: Teeks99derivative work: Pluke (talk) - This file was derived from: A-D-A Flow.svg:. Licensed under CC BY-SA 3.0 via Wikimedia

Commons - https://commons.wikimedia.org/wiki/File:CPT-Sound-ADC-DAC.svg#/media/File:CPT-Sound-ADC-DAC.svg• http://cdn.instructables.com/F15/4TZ5/HQKY9IMI/F154TZ5HQKY9IMI.LARGE.jpg• http://www.piclist.com/images/www/hobby_elec/gif/dance2321.gif• http://www.electro-labs.com/wp-content/uploads/LED-circuit-symbol.jpg• https://cdn.sparkfun.com/assets/4/6/2/1/4/515f3293ce395f4a25000000.png• https://ccrma.stanford.edu/wiki/Images/e/e4/FSR_diagram.gif• http://learn.parallax.com/sites/default/files/content/shield/Bargraph-Arduino-Demo/Bargraph4.png• http://www.adafruit.com/images/1200x900/1815-04.jpg• http://www.ibiblio.org/kuphaldt/electricCircuits/Semi/03033.png• http://i.stack.imgur.com/C0ztU.png• http://obrazki.elektroda.pl/4858974200_1353737433.png• http://www.electronicshub.org/wp-content/uploads/2013/06/Breadboard-Connections.png• http://www.crazybutable.com/stella/images/full/full_stella-8663.jpg• http://cdn.instructables.com/FU0/11AZ/GYGF8IV4/FU011AZGYGF8IV4.LARGE.jpg• http://www.sci-spot.com/images/Accel/resistorboard.jpg• http://wyxs.net/web/wiimote/digital_whiteboard/symbol_led.jpg