EET 252 Unit 7 Digital-to-Analog Conversion Read Floyd, Sections 12-3 to 12-5 (through page 707). ...

19
EET 252 Unit 7 Digital-to-Analog Conversion Read Floyd, Sections 12-3 to 12- 5 (through page 707). Study Unit 7 e-Lesson. Do Lab #7. Homework #7 and Lab #7 due next week. Quiz next week.

Transcript of EET 252 Unit 7 Digital-to-Analog Conversion Read Floyd, Sections 12-3 to 12-5 (through page 707). ...

Page 1: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

EET 252 Unit 7Digital-to-Analog Conversion

Read Floyd, Sections 12-3 to 12-5 (through page 707).

Study Unit 7 e-Lesson. Do Lab #7.

Homework #7 and Lab #7 due next week.

Quiz next week.

Page 2: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• An analog-to-digital converter (ADC) takes an analog voltage or current as its input and produces a digital code as its output. This digital code is proportional to the analog input.

• A digital-to-analog converter (DAC) takes a digital code as its input and produces an analog voltage or current as its output. This analog output is proportional to the digital input.

The Big Picture

Page 3: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Review

TransducerPhysicalvariable

ADC DAC ActuatorComputerControlphysicalvariable

.

.

.

.

.

.

Analog input(voltage or current)

Digitalinputs

Digitaloutputs

Analog output(voltage or current)

Page 4: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• Just as with ADCs, there are several common ways of specifying a DAC’s resolution:

• Number of bits, n

• Number of output codes, = 2n, or number of steps in the output, = 2n − 1

• Percentage resolution, = 1 / (2n − 1), expressed as a percentage

• Step size, = Vref / 2n

Review: Resolution

Page 5: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Resolution: Examples

Formula 4-bit DAC 10-bit DAC

Number of bits nNumber of output codes

2n

Number of steps in the output

2n−1

Percentage resolution

1 / (2n−1)

Step size (assuming 5 V reference voltage)

Vref / 2n

Page 6: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

An 8-Bit DAC in Multisim

• Note 8 digital inputs, 1 analog output, and input reference voltage.

Page 7: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Calculating the Output Voltage

• For an 8-bit multiplying DAC like the one in previous slide, the output voltage is given by the following equation, where Din is the number (between 0 and 255) present on the digital inputs:

• This gives the ideal value. In practice, various factors can cause the actual value to deviate from this predicted value.

256ref

inout

VDV

Page 8: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Voltage or Current?

• Some DACs are designed to produce an output current (rather than an output voltage) that is proportional to the digital input.

• For such a DAC, we’d simply change our equation to

• The DAC chip that we’ll use in this week’s lab is a current chip.

256ref

inout

IDI

Page 9: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• Two standard ways of building a digital-to-analog converter:

1. Binary-weighted input

2. R/2R Ladder

• Both methods use operational amplifiers with negative feedback.

How to Build a DAC

Page 10: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• In many applications, the op amp’s output is connected back to its inverting input directly or through a component (resistor or capacitor). This configuration is called negative feedback. For example:

Op Amp with Negative Feedback

Page 11: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• In The Art of Electronics, Horowitz and Hill give two “golden rules” for analyzing circuits that contain op amps with negative feedback:

1. The output attempts to do whatever is necessary to make the voltage difference between the inputs zero.

2. The inputs draw no current.

• Warning: These two rules apply only if the op amp has negative feedback.

“Golden Rules” of Op Amps with Negative Feedback

Page 12: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed

Binary-weighted-input DAC

In a binary-weighted-input DAC, the input current in each resistor is proportional to the column weight in the binary numbering system. It requires very accurate resistors and identical HIGH level voltages.

The MSB is represented by the largest current, so it has the smallest resistor. To simplify analysis, assume all current goes through Rf and none into the op-amp.

MSB

LSB

+

I0

I = 0

I1

I2

I3

If

+ –

8R

4R

2R

R

Rf

Vout

Analog output

D0

D1

D2

D3

Page 13: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed

+

Binary-weighted-input DAC

A certain binary-weighted-input DAC has a binary input of 1101. If a HIGH = +3.0 V and a LOW = 0 V, what is Vout?

+3.0 V

+3.0 V

+3.0 V

0 V

120 kW

60 kW

30 kW

15 kW

10 kW

Rf

0 1 2 3( )

3.0 V 3.0 V 3.0 V0 V 0.325 mA

120 k 30 k 15 k

outI I I I I

Vout = Iout Rf = (−0.325 mA)(10 kW) =−3.25 V

Vout

Page 14: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed

+

R/R2 Ladder DAC

The R-2R ladder DAC requires only two values of resistors. By calculating a Thevenin equivalent circuit for each input, you can show that the output is proportional to the binary weight of inputs that are HIGH.

2R R R R

2R 2R 2R 2RRf = 2R

Inputs

D0 D1 D2 D3

Each input that is HIGH contributes to the output:

Vout

where VS = input HIGH level voltage n = number of bits i = bit number

R1 R3 R5 R7

R2 R4 R6 R8

For accuracy, the resistors must be precise ratios, which is easily done in integrated circuits.

Page 15: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed

R/R2 Ladder DAC

Rf = 50 kW

0 V+5.0 V

Vout

R1 R3 R5 R7

R2 R4 R6 R8

An R-2R ladder DAC has a binary input of 1011. If a HIGH = +5.0 V and a LOW = 0 V, what is Vout?

50 kW

25 kW

50 kW 50 kW 50 kW

50 kW 25 kW 25 kW

+5.0 V +5.0 V

+

D0 D1 D2 D3

Applying superposition, Vout = −6.875 V

Apply to all HIGH inputs, then sum the results.

Page 16: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Using a Reference Voltage

• In the previous circuits, the output voltage depended on the precise voltage present on the digital inputs. This is undesirable, since a digital HIGH on one of these pins could be anywhere from about 2.4 V to about 5 V.

• We’d rather have the output voltage depend only on whether the inputs are HIGH or LOW, regardless of the precise voltage.

• So most DAC chips use additional circuitry and a reference voltage that sets the full-scale output, independent of the precise voltages present on the digital inputs.

Page 17: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

Binary-Weighted DAC, Using a Reference Voltage

Page 18: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

• MC1408 8-bit DAC (Datasheet on course website.)

• It’s also known as a DAC0808.

• This chip requires a ground connection and positive (VCC) & negative (VEE) supply voltages.

• Its output current is given by

Io = Iref x Din / 256

where Iref is the current into pin 14 (typically 2 mA).

A Popular DAC Chip

Page 19: EET 252 Unit 7 Digital-to-Analog Conversion  Read Floyd, Sections 12-3 to 12-5 (through page 707).  Study Unit 7 e-Lesson.  Do Lab #7.  Homework #7.

© 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed © 2009 Pearson Education, Upper Saddle River, NJ 07458. All Rights ReservedFloyd, Digital Fundamentals, 10th ed

A digital signal processor (DSP) is optimized for speed and working in real time (as events happen). It is basically a specialized microprocessor with a reduced instruction set.

Digital Signal Processing

Analogsignal ADC DSP DAC

Reconstructionfilter

Sample-and-hold circuit

Anti-aliasingfilter

Enhancedanalogsignal

10110011010001111100

10110011010001111100

After filtering and converting the analog signal to digital, the DSP takes over. It may enhance the signal in some predetermined way (reducing noise or echoes, improving images, encrypting the signal, etc.). The signal can then be converted back to analog form if desired.