Vous êtes sur la page 1sur 48

SEE 3263: ELECTRONIC SYSTEMS

Chapter 6:
A/D And D/A Converters

1
SEE 3263 A/D & D/A CONVERTERS

INTRODUCTION
„ In real world, most signal processing involves analog
quantity
quantity.
„ Analog quantity can take on any value over a continuous
range of values and most important its exact value is
significant.
significant
„ A digital quantity will have a value that is specified as
one of two possibilities such as 0 or 1, LOW or HIGH,
TRUE or FALSE and so on on.
„ Actual value is not important but must falls within the
specified ranges. For example:

ƒ 0 V to 0.8 V ⇒ logic 0
ƒ 2 V to 5 V ⇒ logic 1

2
SEE 3263 A/D & D/A CONVERTERS

INTRODUCTION
„ Digital logic circuits require special interfacing
techniques to input and output analog data data.
„ Physical quantities with an infinite range of values, such
as temperature,
p p
pressure, fluid flow, velocity,
y
acceleration and voltage are analog quantities.
„ Analog-to-digital (A/D) conversion is the process of
converting analog values to digital codes representing
the analog value.
„ Digital-to-analog
g g ((D/A)) conversion is the p
process of
converting digital codes to proportional analog values.
„ Digital audio, digital sampling and music synthesis
equipment are some exciting examples of A/D and D/A
applications.
3
SEE 3263 A/D & D/A CONVERTERS
The diagram below shows the elements used in the digital
technique to monitor and control the analog physical
variable.

Transducer : A device used to convert the physical variable to an


electrical
l t i l variable.
i bl For
F example l a thermistor,
th i t photocell
h t ll and
d
tachometer.
Analog to digital converter : To convert an analog input to equivalent
digital
g output.
p
Digital System : The digital information is process according to a program
instructions.
Digital to analog converter : To convert a digital information to a
proportional analog quantity (voltage or
current).
Actuator : A device that control the physical variable. 4
SEE 3263 A/D & D/A CONVERTERS

Digital--To
Digital To--Analog Conversion
„ Is the process of taking a
value represented in digital
code (such as straight binary
or BCD) and converting it to
a voltage or current which is
proportional to the digital
value.

Fro the diagram, there are 4 digital inputs means that


it is a 4
4-bit
bit DAC. D3 is the MSB and D0 is the LSB.
Analog output voltage VO is proportional to the input
value. The digital input D3 to D0 will produce 24 = 16
of 4-bit
4 bit binary number.
number

5
SEE 3263 A/D & D/A CONVERTERS

Graph plot of VO((analog)g) versus


Vin(digital) for 4 bit DAC
15
14
age. VO

13
12
Analog Output Volta

11
10
9
8
7
6
5
4
3
2
1

Digital Input
0001

0010
0011
0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110
1111
0000

6
SEE 3263 A/D & D/A CONVERTERS

In general,
general
Analog output = R x digital input

where R is the resolution.


Analog output can be voltage or current.
current
Therefore R can either be in unit volt or ampere.

If R = 0.25 V,
Then VO = (0.25V) x digital input

For digital input of 10002 = 810


VO = 0.25 V x 8 = 2.0 V

7
SEE 3263 A/D & D/A CONVERTERS
A 4-bit DAC produce an output current. For a
di it l input
digital i t off 10102, the
th output
t t currentt is
i
5mA. What is the value of IO for a digital input
01012 ?

IO 5 mA
A
R= = = 0.5 mA
Digital Input 10

For a digital input of 01012 = 510


IO = R x digital input
= 0.5mA x 5
=22.5mA
5mA
8
SEE 3263 A/D & D/A CONVERTERS
What is the maximum output voltage for the
8 bit DAC th
8-bit thatt produce
d 1V output
t t ffor di
digital
it l
input of 001100102?

00110010 2 = 5010
VO 1V
R= = = 0.02 V
Di it l Input
Digital I t 50

For digital input of 111111112 = 255100

VO = R x digital input
= 0.02 V x 255
= 5.1 V
9
SEE 3263 A/D & D/A CONVERTERS

RESOLUTION (Step Size)


„ The Resolution of a DAC is defined as the smallest
change that can occur in the analog output as a
result of a change in the digital input.

„ The resolution is always equal to the weight of the


LSB and is also referred to as the step size since it
is the amount that output will change as the digital
input value is changed from one step to next
next.

10
SEE 3263 A/D & D/A CONVERTERS
For the given 4-
4-bit DAC, each digital input depends on
its weight. Therefore the resolution = LSB = 0.5 V

D C B A VO(V)

0 0 0 1 0.5

0 0 1 0 1

0 1 0 0 2.0

1 0 0 0 4.0
40

Note that there are 16 Generally for N-bit DAC,


l
levels
l equivalent
i l t to
t 16 No of levels = 2N
input state but there are 15
p between level 0 and
steps No of steps = 2N -1
the full scale.
11
SEE 3263 A/D & D/A CONVERTERS

PERCENTAGE RESOLUTION

„ Resolution
R l ti can also
l b be d
defined
fi d as th
the
percentage of the full-scale(F.S) output.
step size
% resolution = x 100 %
full scale (F.S)

• Or it can also be calculated from:

1
% resolution = x 100 %
total number of steps

12
SEE 3263 A/D & D/A CONVERTERS
An 8-bit DAC has a step size of 10 mV.
Determine the full scale output voltage and
the percentage resolution.

No of steps = 28 – 1 = 256 –1 = 255

Full-scale voltage = 10 mV x 255 = 2.55 V

10 mV
% resolution = x 100% = 0.39 %
2.55 V

This shows that the percentage resolution


becomes smaller as the number of input bits is
increased.
13
SEE 3263 A/D & D/A CONVERTERS

WHAT DOES RESOLUTION MEAN?


„ A DAC cannot produce a continuous range of output
values,, and so its output
p is not trulyy analog.
g
„ A DAC produces a finite set of output values.
„ The DAC’s resolution (number of bits) determines how
many possible voltage values.
„ If a 6-bit DAC is used, there will be 63 possible steps of
0.159V between 0 and 10V.
„ When an 8 8-bit
bit DAC is used,
used there will be 255 possible
steps of 0.039 V between 0 and 10V.
„ The greater the number of bits, the finer the resolution
(the smaller the step size).
size)
„ The resolution limits how close the DAC output can
come to a given analog value.
„ Generally the cost of DACs increases with the number
Generally,
of bits, and so the designer will use as few bits as
necessary. 14
SEE 3263 A/D & D/A CONVERTERS

BCD INPUT CODE


„ The DACs we have considered thus far have used a
binary input code
code.
„ Many DACs use a BCD input code where 4-bit code
groups
g p are used for each decimal digit.
g

D1 80
BCD for C1 40
MSD B1 20
A1 10 DAC Vout 100 possible values since input
ranges from 00 to 99
D0 8
BCD for C0 4
LSD B0 2
A0 1 Step size = weight of A0

15
SEE 3263 A/D & D/A CONVERTERS
If weight of AO is 0.2 V, determine the following:
(a) Step size.
(b) Full-Scale output and percentage resolution.
(c) Vout for D1C1B1A1 = 01012 and D0C0B0A0 =
00112.

(a) Step size = weight of AO = 0.2


02V
(b) There are 99 steps from 00 to 99. 0.2V
FS = 99 x 0.2 = 19.8 V thus % resolution = x 100% = 1 %
19.8 V
(c) 01012 = 510 and 00112 = 310, then
Vout = step size x digital input
= 0.2 V x 53
= 10.6 V
16
SEE 3263 A/D & D/A CONVERTERS

DIGITAL--TO
DIGITAL TO-- ANALOG CONVERTER

„ There are 2 types of typical DAC converter


circuit:

… DAC binary weighted

… DAC R – 2R ladder network

17
SEE 3263 A/D & D/A CONVERTERS

Binary Weighted DAC


This is the basic circuit for one
t
type off 4-bit
4 bit DAC.
DAC The
Th inputs
i t are
binary input which are assumed to
have values of either 0V or 5V.
The op-amp is employed as a
summing amplifier, which
produces the weighted sum of
these input
i voltages. VA V V V
IO = , I1 = B , I 2 = C , I 3 = D
The output is evaluated for any 8R 4R 2R R
input
p condition by y setting
g the
R, 2R,
R 2R 4R
4R, 8R refer f tot the
th weighted
i ht d off 23,
appropriate inputs to either 0V or 2 1
2 , 2 and 20. Thus
5V. For example, if the digital
input is 10102, then VD = VB = 5V VO = − I F R F
and VC = VA = 0V. Thus VOUT = - ⎛ RF
= −⎜ VA +
RF
VB +
RF
VC +
RF ⎞
VD ⎟
(V+0+1/4V+0) = 6.25V ⎝ 8R 4R 2R R ⎠
18
SEE 3263 A/D & D/A CONVERTERS

„ How close the circuit comes to producing an


accurate values depends primarily on two
factors:

… The precision of the input and feedback


resistors.

… The precision of the input voltage levels.

19
SEE 3263 A/D & D/A CONVERTERS

PRECISION REFERENCE
SUPPLY
VRef

Use semiconductor IO IO/2 IO/4 IO/8


4R
switch like the R 2R 8R
RF
IF= IO

CMOS transmission
gate
t

-
Switch closed IO VO
when
h iinputt bit = 1 +

B3 B2 B1 B0
MSB LSB

IO I I
I O = B3 × I O + B 2 × + B1 × O + B0 × O
2 4 8
VREF
Where IO =
R 20
SEE 3263 A/D & D/A CONVERTERS

R-2R LADDER NETWORK


4 bit R
4-bit R-2R
2R is
constructed with 3
resistors R and 5
resistors 2R
2R.
Normally R = 10 kΩ
and 2R = 20 kΩ.
4 current switches
will be activated
d
depends d on ththe
digital input. I out = current LSB × D(digital input)
IO VREF 1
= =( )( 4 ) × D(digital input)
16 R 2
21
SEE 3263 A/D & D/A CONVERTERS

DAC OUTPUT VOLTAGE


⎛ VREF ⎞⎛ 1 ⎞
I =
In general, for n-bit, O ( LSB) ⎜ ⎟⎜ n ⎟
⎝ R ⎠⎝ 2 ⎠

VO = -IoutRF = -(current LSB) x RF x D


⎛ VREF ⎞⎛ 1 ⎞
Voltage Resolution = voltage LSB =⎜ ⎟⎜ n ⎟ RF
⎝ R ⎠⎝ 2 ⎠
Therefore VO = -(voltage resolution) x D
22
SEE 3263 A/D & D/A CONVERTERS
Assume VREF = 10 V for 4-bit R-2R with
R = 10kΩ. Determine:
(a) Current resolution.
(b) IO when the digital input is 11112

(a) n = 4
⎛ V ⎞⎛ 1 ⎞ ⎛ 10 V ⎞⎛ 1 ⎞
resolution = I O ( LSB ) = ⎜ REF ⎟⎜ n ⎟ = ⎜ ⎟⎜ 4 ⎟ = 0.0625 mA
⎝ R ⎠⎝ 2 ⎠ ⎝ 10 kΩ ⎠⎝ 2 ⎠

(b) IO = 1O(LSB) x D = (0.0625 mA) (15) = 0.9375 mA

23
SEE 3263 A/D & D/A CONVERTERS

DAC INTEGRATED CIRCUIT


(DAC 0808/ MC1408)

24
SEE 3263 A/D & D/A CONVERTERS

„ DAC 0808/ MC 1408 is an 8-bit


8 bit DAC.
DAC
„ Pin 13 and 3 are the power supply terminal +ve and –ve
respectively.
„ Pin 14 and 15 allow the +ve and –ve
ve reference voltages
voltages.

I out

25
SEE 3263 A/D & D/A CONVERTERS

„ It provides two output current terminals that can be used


to increase the capability of the DAC-08.
„ If the
th internal
i t l switch
it h iis att position
iti ‘1’
‘1’, th
the lladder
dd currentt
will flow through bus Iout and if the switch is at position ‘0’,
the ladder current will flow through bus IOUT
„ Resolution (current )= LSB = ⎛⎜ VREF ⎞⎟⎛⎜ 1 ⎞⎟
⎝ R ⎠⎝ 2 n ⎠
„ Iout = (LSB) x D
„ IFS = (LSB) x (2n–1) = (LSB) x 255
„ Total branch current in DAC 08 = IFS

„ Iout = IFS − IOUT

26
SEE 3263 A/D & D/A CONVERTERS

UNIPOLAR ANALOG OUTPUT


VOLTAGE
-15 V +15 V
0.1 F RF
0.1 F 0.1 F

5K

Rref IOUT
3 16 13 +15 V
Iref 14 4
2
-
5K
DAC -08 Vo= IoutRF
I out 3
6
Vref
+10 V
15 MSB LSB 2 +
5 6 7 8 9 10 11 12 1
-15 V
5K

D7 D6 D5 D4 D3 D2 D1 D0

⎛ V ⎞⎛ 1 ⎞
Voltage resolution = ⎜ REF ⎜ n × R F
⎝ R ⎠⎝ 2 ⎠
VO = voltage resulotion × D
27
SEE 3263 A/D & D/A CONVERTERS
-15 V +15 V
0.1 F RF
0.1 F 0.1 F

5K

Rref IOUT
3 16 13 +15 V
Iref 14 4
2
-
5K
DAC -08 Vo= IoutRF
I out 3
6
Vref
+10 V
15 MSB LSB 2 +
5 6 7 8 9 10 11 12 1
-15 V
5K

D7 D6 D5 D4 D3 D2 D1 D0

„ For unipolar DAC-08, determine VO for the


following inputs:
(a) 000000012 (b) 111111112

⎛V ⎞⎛ 1 ⎞ ⎛ 10 V ⎞ ⎛ 1 ⎞
V LSB = ⎜ REF ⎟ ⎜ n ⎟ × R F = ⎜ ⎟ ⎜ 8 ⎟ × 5 k Ω = 39 mV
⎝ R ⎠⎝ 2 ⎠ ⎝ 5 k Ω ⎠⎝ 2 ⎠

(a) VO = VLSB x D = 39 mV x 1 = 39 mV
(b) VO = VLSB x D = 39 mV x 255 = 9.961 V 28
SEE 3263 A/D & D/A CONVERTERS

BIPOLAR ANALOG OUTPUT


VOLTAGE

VO = (Iout − Iout )RF


I out

VO = (Iout − Iout )RF Iout = (IFS − Iout )

29
SEE 3263 A/D & D/A CONVERTERS

„ For bipolar DAC-08,


DAC 08, determine VO for
an input of 011111112

⎛ VREF ⎞⎛ 1 ⎞ ⎛ 10.24V ⎞⎛ 1 ⎞
Current resolution = ⎜ ⎟⎜ n ⎟ = ⎜ ⎟⎜ 8 ⎟ = 8 µA
⎝ R ⎠⎝ 2 ⎠ ⎝ 5kΩ ⎠⎝ 2 ⎠

IFS = 8µA x 255 = 2.04mA


Iout = 8µA x 12710 = 1.016mA , I out = 2.04mA − 1.016mA
= 1.024mA

VO = (1
(1.016mA
016mA - 1.024mA)x5kΩ
1 024mA)x5kΩ = - 0.04
0 04 V
30
I out
SEE 3263 A/D & D/A CONVERTERS
„ For bipolar DAC-08 determine Vo for the
f ll i iinputs:
following t
(a) 000000002 (b) 011111112
(c) 100000002 (d) 111111112

Current resolution = ⎛⎜⎝ VR ⎞⎟⎠⎛⎜⎝ 21 ⎞⎟⎠ = ⎜⎛⎝ 5K


10.24 ⎞⎛ 1 ⎞
„ REF
n
⎟⎜ ⎟
⎠⎝ 256 ⎠
µ
= 8µA
„ IFS = 8µA X 255 = 2.04mA
„ Iout = 8µA x 0 = 0,
„ Vo = (0 - 2.04mA)5KΩ
2 04mA)5KΩ = -10.2 -10 2 V

Note that the –ve full-scale voltage happen when the input is 0 and
the +ve full
full-scale
scale voltage happen when all inputs are 1
1.
Digital Input Analog Output
D7 D6 D5 D4 D3 D2 D1 D0 Iout(mA) I out (mA) Vo(V)
-ve full-scale 0 0 0 0 0 0 0 0 0 2.04 -10.2
Negative zero 0 1 1 1 1 1 1 1 1.016 1.024 -0.040
Positive zero 1 0 0 0 0 0 0 0 1.024 1.016 0.040
+ve full-scale 1 1 1 1 1 1 1 1 2.04 0 10.2
31
SEE 3263 A/D & D/A CONVERTERS

„ An 8-bit DAC has a full scale output


p of
2 mA and a full scale error ± 0.5 %.
What are the possible output range for
an input
i t off 100000002.

Step size= 2 mA/255 = 7.84 µA


Input 100000002 = 12810
Ideal output current = ILSB x D = 7.84 µA x 128 = 1004 µA
Maximum error = ± 0.5 % x 2 mA = ± 10 µA µ
Thus an ideal output current range = 1004 µA ± 10 µA
= 994 µA to 1014 µA

32
SEE 3263 A/D & D/A CONVERTERS

ANALOG-TO
ANALOG-TO--DIGITAL
CONVERTER (ADC)
„ An ADC ttakes
A k an analogl iinputt voltage
lt andd after
ft a
certain amount of time produces a digital output code
which represents the analog input.

33
SEE 3263 A/D & D/A CONVERTERS

Digital Ramp ADC

34
SEE 3263 A/D & D/A CONVERTERS

„ For a digital ramp ADC, if fclk = 1 MHz, VT =


0.1 mV,, full-scale output
p = 10.23 V and a 10-
bit input, determine:
… The digital equivalent obtained for VA =
3.728 V.
… The conversion time
time.
… The resolution of this converter.

35
SEE 3263 A/D & D/A CONVERTERS

„ Total possible steps = 210 – 1 = 102310


„ Step size = 10.23 = 10mV
1023

„ Since VA = 3.728
Si 3 728 V and d VT = 0.1
0 1 mV V
„ VAX must reach 3.7281 V
This needs 3.7281 V
„ = 372.81
372 81 = 373 steps
10 mV

„ 37310 = 01011101012
„ Require 373 steps to complete the conversion, so need
373 clock pulses = 373 µs = tc
„ resolution = step size = 10 mV
36
SEE 3263 A/D & D/A CONVERTERS

SUCCESSIVE APPROXIMATION
ADC (SAC)

37
SEE 3263 A/D & D/A CONVERTERS

Assume a 4 4-bit
bit
START

SAC with a step Clear all

size of 1V. bits

L t assume the
Let th Start at

analog input, MSB

VA=10.4V
Set bit = 1

IS Yes Clear bit back


VAX > VA ? to 0

No

No Have
Go to next all bits been
lowest bit checked?

Yes

Conversion
is complete
and result is
in REGISTER

END
38
SEE 3263 A/D & D/A CONVERTERS

„ An 8-bit SAC has a resolution of 20mV.


What will its digital output be for an
analog input of 2.17 V.

2.17V
No of Steps = = 108.5
20mVV
Step 108 would produce VAX = 2.16 V
Step 109 would produce VAX = 2.18
2 18 V
The SAC always produces a final VAX that is at the
step below VA
Th
Thus, for
f VA = 2.17
2 17 V,
V the
th digital
di it l result
lt would
ld be
b
10810 = 011011002
39
SEE 3263 A/D & D/A CONVERTERS

CONVERSION TIME
„ TC for SAC = N x 1 clock cycle.
„ This conversion time will be the same regardless of the
value of VA because the control logic has to process
each bit to see whether a 1 is needed or not.

Compare the maximum conversion times of


a 10-bit digital-ramp ADC and a 10-bit SAC if
both utilizes a 500 kHz clock frequency.

For digital-ramp ADC, tC =1023 x 2µs = 2046µs.

For SAC, tC = 10 x 2µs = 20µs.


40
SEE 3263 A/D & D/A CONVERTERS

THE ADC0804 INTEGRATED


CIRCUIT
„ It is an 8-bit ADC that performs A/D conversion using
the successive-approximation
pp method.
„ It has two analog inputs: VIN(+) and VIN(-) to allow
differential inputs.
„ The actual analog input
input, VIN = VIN(+) - VIN(-).
()
„ In single-ended measurements, the analog input is
applied to VIN(+) while VIN(-) is connected to analog
ground.d
„ During normal operation, the converter uses VCC = + 5V
g and the analog
as its reference voltage, g input can range
g
from 0 to 5V full scale.
41
SEE 3263 A/D & D/A CONVERTERS

5V
„ With 8
8-bits,
bit ththe resolution
l ti iis = = 19.6
19 6 mV
V
255
„ It has an internal clock generator circuit that produces a
frequency of 1
f=
1.1 RC
C
where R and C are values of externally connected
components.
„ A typical
t i l clock
l k ffrequency iis 606 kHkHz using
i R = 10 kΩ
and C = 150 pF. If desired, an external clock frequency
can be used byy connecting g it to the CLK IN p
pin.
„ With 606kHz clock frequency, TC = 13.2µs.
„ It has separate ground connections for digital and analog
voltages
lt att pin
i 10 and
d pin
i 8 respectively.
ti l
42
SEE 3263 A/D & D/A CONVERTERS

TYPICAL CONNECTION OF
ADC0804

{
43
SEE 3263 A/D & D/A CONVERTERS

APPLICATION EXAMPLE
+ 5V

+ 5V
VIN(+) VCC LED 0
1K
D0
2.5 K VIN(-) 1K LED 1
D1
Vin A.GND 1K LED2
D2
1K LED 3
D3
10 K - Vref/2 1K LED 4
VZ(2.5V) D4
RP + 1K LED 5
CLK R D5
ADC 0804 1K LED6
10 K D6
1K LED7
D7
CLK in
150 pF
CS + 5V

RD WR 10 K
START
D.GND INTR

3.3 F
74HCT14

44
SEE 3263 A/D & D/A CONVERTERS

„ Referring to the fig


figure
re abo
above,
e RP is the 10 kΩ
potentiometer. If RP is set so that V+ = 1.28 V,
determine:
… The input voltage range Vin
… The voltage resolution
… The conversion time
… The LED that will light up when Vin = 2.26
2 26 V
… The input voltage when the digital output is
10101112
45
SEE 3263 A/D & D/A CONVERTERS
V ref +
= V = 1 . 28 V ⇒ V reff = 2 . 56 V
2
Input voltage range Vin = 0 V hingga 2.56 V
2.56V
voltage resolution = = 10.04mV
255
T = 1.1 RC = 1.1 x 10kΩ x 150pF = 1.65 µs
Therefore tc = N x T = 8 x 1.65 µs = 13.2 µs
When
W e Vin = 2.26
. 6V
2.26
Total steps = = 225.1
10.04mV
Thus total steps = 22510 = 111000012=D7D6D5D4D3D2D1D0
LED that will light up: LED4, LED3, LED2, LED1
Vin = 8710 x 10.04mV
10 04 V = 00.8735V
8735V although
lth h actual
t l Vin
should be slightly greater than 0.8735V.
46
SEE 3263 A/D & D/A CONVERTERS

THE FLASH ADC


„ Flash ADC is the
Analog inhighest-speedComparator  Outputs ADC, but
Digital Outputs
V it requires
A C 1 C C C Cmuch
2 3 4 5 6C C 7 more
A        B        C

0 – 1 V circuitry.


circuitry
1       1       1      1       1       1       1 0         0        0

1 – 2 V 0       1       1      1       1       1       1    0         0        1


„ For example, a 6-bit
2 – 3 V 0       0       1      1       1       1       1 0         1        0
flash ADC requires 63
3 – 4 V 0       0       0      1       1       1       1 0         1        1
analog comparators comparators, 1         0        0
4 – 5 V 0        0       0      0       1       1       1

5 – 6 V
while an 8-bit unit
0        0       0      0       0       1       1 1         0        1

6 – 7 V
requires 255
0        0       0      0       0       0       1 1         1        0

>7 V
comparators
comparators, and1         1        1
0        0       0      0       0       0       0
a 10 10-
bit converter requires
1023 comparators.

47
SEE 3263 A/D & D/A CONVERTERS

THE END

48

Vous aimerez peut-être aussi