DAC and Diodes
DAC and Diodes
2
What is Digital-to-Analog Converter
(DAC) ?
A DAC converts a binary digital signal into an
analog representation of the same signal
Typically the analog signal is a voltage
3
DAC vs. ADC
ADCs are used in systems to capture “real world”
signals and convert them to “digital” signals.
4
Significance of Reference Voltage in DACs
DACs rely on an input reference voltage to
generate analog output from digital signals.
DAC
5
Analog Levels For Sampled Digital Values
Each binary number sampled by a DAC corresponds
to a different output analog level between 0 and Vref
for Unipolar and Vref and –Vref for Bipolar.
6
Sampling Frequency
Sampling frequency is the number of data
points sampled per unit time
7
Output is a Piecewise Function
This is due to finite sampling frequency
The analog value is calculated and “held” over
DAC
nth bit
9
Types of DAC Implementations
There can be several types of DAC
implementations. Some of them are:
1. Binary-weighted resistor
2. R-2R ladder
3. Pulse-width modulation
4. Oversampling DAC (in EVB used in lab)
5. Thermometer-coded DAC
6. Hybrid DAC
10
1. Binary-weighted resistor DAC
• • Details
Assumptions:
o o Use Vref as input voltage
Virtual Ground at Inverting Input
o Use transistors to switch between
o Vout = -IRf
high and ground
o Use resistors scaled by two to
divide voltage on each branch by a
power of two
o V1 is MSB, V4 LSB in this circuit
11
1. Binary-weighted resistor DAC
𝑅𝑓 𝐵 𝑛 −1 𝐵 𝑛 −2 𝐵1 𝐵0
𝑉 𝑜𝑢𝑡 =−
𝑅𝑒𝑞 (
𝑉 𝑟𝑒 𝑓 =− 𝑅 𝑓 𝑉 𝑟𝑒 𝑓
𝑅
+
2𝑅
+ …+ 𝑛 − 2 + 𝑛 −1
2 𝑅 2 𝑅 )
Rf n 1
Bi
Vout Vref
R
2
i 0
( n 1) i
12
1. Binary-weighted resistor DAC
• Example: take a 4-bit converter,
• Rf /R= a; a = gain.
B3 B2 B1 B0
Vout aVref
1 2 4 8
• Input parameters:
▫ Input voltage Vref = -2V
▫ Binary input = 1011
▫ Coefficient a = ½
1 1 0 1 1 11
Vout 2 1.375V
2 1 2 4 8 8
13
1. Binary-weighted resistor DAC
• Resolution: Making LSB as 1 and all other inputs
as 0,
Rf Vref
Vmin
R 2n-1
Vref
• If Rf = R/2 then resolution is
2n
• Max Vout can be obtained making all input bits
equal to 1 and it can be obtained solving
geometric series in equation (1) as
1
Vmax Vref 1 n
2
14
1. Binary-weighted resistor DAC
• Advantages:
▫ Simple
▫ Fast
• Disadvantages
▫ Need large range of resistor values
(2048:1 for 12-bit) with high precision in
low resistor values.
▫ Need very small switch resistances.
15
2. R-2R Ladder DAC
B2
B1 Ladder of 2 Resistor Values
B0 R and 2R at Input of Inverting Op-Amp
• All the inputs are Vref followed by switches. Output of switches is B2, B1
and B0 in above circuit.
• Similar to binary weighted DAC, status of switches would define if input
bits to DAC are Vref or 0.
16
2. R-2R Ladder DAC
By adding resistance in series and in parallel we can
derive an equation for the R-2R ladder.
MSB
1 1 1
LSB
Req 2R 2R
Req R
1 0 1 1 0 1
Vout (5.5)(1) 1 2 3 4 5 6
2 2 2 2 2 2
Vout 3.867
19
2. R-2R Ladder DAC
• Resolution: Making LSB as 1 and all other inputs as
0,
Rf Vref
Vmin
R 2n
Vref
• If Rf = R then resolution is
2n
• Disadvantages
▫ Slower conversion rate
21
Outline:
What is digital to analog converter (DAC)?
Types of DAC
◦ Binary Weighted Resistor
◦ R-2R Ladder
Discuss Specifications:
◦ Reference Voltages
◦ Resolution
◦ Speed
◦ Settling Time
◦ Linearity
◦ Errors
Applications
Diodes: Theory and applications
◦ Ideal vs. real
◦ Types: Junction and Zener
22
Reference Voltage (
The reference voltage determines the range of
outputs from the DAC
Non-Multiplying DAC
◦ Vref is internally set by the manufacturer and is a
constant (fixed) value
◦ Sometimes Vref is external from manufacturer
Multiplying DAC
◦ Vref is externally set and can be varied during
operation
◦ Most DACs use this type
23
Full Scale Voltage and Resolution
Full Scale Voltage (Vfs) is the output voltage when all bits
are set high
𝑓 𝑠 ≥ 2 𝑓 𝑚𝑎𝑥
26
Linearity
The linearity is the difference between the
desired analog output and the actual output
over the full range of expected values
Ideally, a DAC should produce a linear
28
Offset Error
An offset error will cause all the output
voltages to be different from the ideal output
by the error
◦ It can be determined by measuring the output
voltage for a digital input of zero.
29
Gain Error
The gain error is how well the slope of the
actual transfer function matches the slope of
the ideal transfer function
◦ It can be determined by measuring the output
voltage for a digital input of all 1’s
30
Full Scale Error
Full Scale error is the combination of the Gain
Error and the Offset Error
31
Resolution Error
The resolution will determine how close your
output will match the desired signal
32
Differential Nonlinearity Error (DNL)
The difference between two successive digital
output codes is ideally 1 VLSB
The deviation from a step of 1 VLSB is the DNL
error
◦ Manufacturers will specify the maximum DNL error
33
Integral Linearity Error (INL)
The INL is the difference in the ideal linear
voltage and the actual output voltage for a
given digital code
◦ Manufactures will specify the max INL error
34
Non-Monotonic
Monotonic Function
◦ A monotonically increasing function will always increase or remain
constant (non-decreasing)
◦ A monotonically decreasing function will always decrease or remain
constant (non-increasing)
35
Applications
Audio/Video Signal Generators
◦ MP3 Players ◦ Sine Wave generation
◦ CD Players ◦ Square Wave
◦ Cellphones generation
◦ USB Speakers ◦ Random Noise
◦ Analog Monitors generation
36
Outline:
What is digital to analog converter (DAC)?
Types of DAC
◦ Binary Weighted Resistor
◦ R-2R Ladder
Discuss Specifications:
◦ Reference Voltages
◦ Resolution
◦ Speed
◦ Settling Time
◦ Linearity
◦ Errors
Applications
Diodes: Theory and applications
◦ Ideal vs. real
◦ Types: Junction and Zener
37
Diodes
Review of semiconductors
Ideal Diode Characteristics
Types of Diodes
◦ Semiconductor Diodes
P-n Junction Diode
Zener Diode
Light Emitting Diode (LED)
Photodiode
38
Semiconductors
Conductors
◦ Material which allows flow of electric
charge (current). Ex) Copper wiring,
silver (contactor for electric motor)
Insulators
◦ Material does not allow flow of electric
charge (current). In theory have an
infinite resistivity. Ex) ceramic, glass,
Teflon
Semiconductors
◦ A material whose electrical conductivity
is poor at low temperatures but is
improved by the application of heat,
light, or voltage.
◦ Electrical conductivity can be increased
and precisely controlled by adding small
impurities in a process called doping
39
What is a diode?
A diode is a two-terminal electronic component
with asymmetric conductance
It has low (ideally zero) resistance to current
flow in one direction (forward), and high (ideally
infinite) resistance in the other (reverse)
40
Solid State Diode
A diode is created when a p-type semiconductor is joined with and
n-type semiconductor by the addition of thermal energy.
When both materials are joined, the thermal energy causes positive
carriers in the p-type material to diffuse into the n-type region and
negative carriers in the n-type material to diffuse into the p-type
region.
This creates the depletion region within the diode
Majority carriers
p n
Depletion Region
41
Forward and Reverse Bias
A diode is forward biased if the positive terminal of the battery is connected
to the p-type material.
◦ Current is sustained by the majority carriers.
A diode is reverse biased if the positive terminal of the battery
is connected to the n-type material.
◦ There is a small reverse current or leakage current sustained by
the minority carriers
If reverse bias is sufficiently increased, a sudden increase in
reverse current is observed.
DepletionThis Depletion
is known as the Zener or Avalanche
Region Region
effect
Original Size Original Size
p n p n
if
42
Diode Characteristic Curve
Ideal Diode - no resistance to current flow in the
forward direction and infinite resistance in the reverse
direction
Actual Diode – forward resistance not quite zero and
reverse resistance not infinite
I
conduction
region
V
non-conduction
region
Ideal Curve
43
Zener Diode
A diode which allows current to flow in the forward direction in the same manner as an
ideal diode
But also permits it to flow in the reverse direction when the voltage is above a certain
value known as the breakdown voltage
Zener diodes have a specified voltage drop when they are used in reverse bias.
Every p-n junction (i.e. diode) will break down in reverse bias if enough voltage is
applied.
Able to maintain a nearly constant voltage under conditions of widely varying current.
Zener diodes are operated in reverse bias for normal voltage regulation.
44
Light Emitting Diode (LED)
Semiconductor device with a p-n junction
When a forward bias is applied, electrons are able to recombine
45
Photodiode
Converts light into voltage or current
Ex) a solar cell is a large area photodiode operating in zero
bias
Designed to operate in reverse bias
Many use a P-I-N junction rather than a P-N junction
46
? ?
? ? ?
? ?
?
47
References
Previous student presentations.
http://en.wikipedia.org/wiki/Digital_to_analog
http://www.allaboutcircuits.com/vol_4/chpt_13/index.html
Alicatore, David G. and Michael B Histand. Introduction to Mechatronics and
Measurement Systems, 2nd ed. McGraw-Hill, 2003.
Walt Kester, “What the Nyquist Criterion Means to Your Sampled Data System
Design”, MT 002 Tutorial, Analog Devices.
http://www.maxim-ic.com/app-notes/index.mvp/id/641
48