Sunteți pe pagina 1din 24

10/28/2008

SEE 3263: ELECTRONIC SYSTEMS

Chapter 6:
A/D And D/A Converters

SEE 3263 A/D & D/A CONVERTERS

INTRODUCTION
„ In real world, most signal processing involves analog
quantity.
„ A l quantity
Analog tit can take
t k on any value
l over a continuous
ti
range of values and most important its exact value is
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.
„ Actual value is not important but must falls within the
specified ranges
ranges. For example:

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

1
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

INTRODUCTION
„ Digital logic circuits require special interfacing
techniques to input and output analog data.
„ Physical quantities with an infinite range of values, such
as temperature, pressure, fluid flow, velocity,
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 (D/A) conversion is the 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 variable. For example a thermistor, photocell and
tachometer.
Analog to digital converter : To convert an analog input to equivalent
digital output.
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

2
10/28/2008

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,


g there are 4 digital
g inputs
p means that
it is a 4-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 binary number.

SEE 3263 A/D & D/A CONVERTERS

Graph plot of VO(analog) versus


Vin(digital) for 4 bit DAC
15
14
Analog Output Voltage. VO

13

12
11
10
9

8
7

6
5
4

3
2

Digital Input
0001
0010
0011

0100
0101
0110
0111
1000
1001
1010
1011
1100
1101
1110

1111
0000

3
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

In general,
Analog output = R x digital input

where R is the resolution.


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

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

For digital input of 10002 = 810


VO = 0.25 V x 8 = 2.0 V

SEE 3263 A/D & D/A CONVERTERS


A 4-bit DAC produce an output current. For a
digital input of 10102, the output current is
5mA. What is the value of IO for a digital input
01012 ?

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

For a digital
g input
p of 01012 = 510
IO = R x digital input
= 0.5mA x 5
= 2.5mA
8

4
10/28/2008

SEE 3263 A/D & D/A CONVERTERS


What is the maximum output voltage for the
8-bit DAC that produce 1V output for digital
input of 001100102?

00110010 2 = 5010
VO 1V
R= = = 0.02 V
Digital Input 50

For di
digital
i l input
i off 111111112 = 255
2 10
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.

10

5
10/28/2008

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

Note that there are 16 Generally for N


N-bit
bit DAC,
levels equivalent to 16 No of levels = 2N
input state but there are 15
steps between level 0 and No of steps = 2N -1
the full scale.
11

SEE 3263 A/D & D/A CONVERTERS

PERCENTAGE RESOLUTION

„ Resolution can also be defined as 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

6
10/28/2008

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
2.55

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 is not truly analog.
„ 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-bit DAC is used, there will be 255 possible
steps of 0.039 V between 0 and 10V.
„ The greater the number of bits,
bits the finer the resolution
(the smaller the step 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
of bits, and so the designer will use as few bits as
necessary. 14

7
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

BCD INPUT CODE


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

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 V


(b) There are 99 steps from 00 to 99. 0.2V
FS = 99 x 0
0.2
2 = 19
19.8
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

8
10/28/2008

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
type of 4-bit DAC. The inputs are
bi
binary iinputt which
hi h are assumedd to
t
have values of either 0V or 5V.
The op-amp is employed as a
summing amplifier, which
produces the weighted sum of
these input voltages. VA V V V
IO = , I1 = B , I 2 = C , I 3 = D
The output
p is evaluated for any y 8R 4R 2R R
input condition by setting the
R, 2R, 4R, 8R refer to the weighted of 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

9
10/28/2008

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


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
I F= I O

CMOS transmission
gate

-
Switch closed IO VO
when input 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

10
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

R-2R LADDER NETWORK


4-bit R-2R is
constructed with 3
resistors R and 5
resistors 2R.
Normally R = 10 kΩ
and 2R = 20 kΩ.
4 current switches
will
ill be
b activated
ti t d
depends on the
digital input. I out = current LSB × D(digital input)
I V 1
= O = ( REF )( 4 ) × D(digital input)
16 R 2
21

SEE 3263 A/D & D/A CONVERTERS

DAC OUTPUT VOLTAGE


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

VO = -IIoutRF = -(current
( t LSB) x RF x D
⎛ VREF ⎞⎛ 1 ⎞
Voltage Resolution = voltage LSB =⎜ ⎟⎜ n ⎟ RF
⎝ R ⎠⎝ 2 ⎠
Therefore VO = -(voltage resolution) x D
22

11
10/28/2008

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 ⎞
l i = I O ( LSB ) = ⎜ REF ⎜ n = ⎜
resolution ⎜ 4 = 0.0625
0 0625 mA
A
⎝ 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

12
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

„ DAC 0808/ MC 1408 is an 8-bit DAC.


„ Pin 13 and 3 are the power supply terminal +ve and –ve
respectively.
„ Pin 14 and 15 allow the +ve and –ve reference 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 internal switch is at position ‘1’, the ladder current
will
ill flow
fl through
h h bus
b Iout andd if the
h switch
i h iis at position
i i ‘0’
‘0’,
the ladder current will flow through bus IOUT
„ Resolution (current )= LSB = ⎛⎜ VREF ⎞⎟⎛⎜ 1 ⎞⎟
n
„ Iout = (LSB) x D ⎝ R ⎠⎝ 2 ⎠
„ IFS = (LSB) x (2n–1) = (LSB) x 255
„ Total branch current in DAC 08 = IFS

„ Iout = IFS − IOUT

26

13
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

UNIPOLAR ANALOG OUTPUT


VOLTAGE
-15 V +15 V
01 F
0.1 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
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

14
10/28/2008

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, determine VO for


an input of 011111112

⎛ V ⎞⎛ 1 ⎞ ⎛ 10.24V ⎞⎛ 1 ⎞
Current resolution = ⎜ REF ⎟⎜ 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.016mA - 1.024mA)x5kΩ = - 0.04 V


30

15
10/28/2008

I out
SEE 3263 A/D & D/A CONVERTERS
„ For bipolar DAC-08 determine Vo for the
following inputs:
(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Ω = -10.2 V

N t that
Note th t the
th –ve full-scale
f ll l voltage
lt h
happen when
h ththe iinputt iis 0 and
d
the +ve full-scale voltage happen when all inputs are 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 of


2 mA and a full scale error ± 0.5 %.
What are the possible output range for
an input of 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

16
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

ANALOG-TO
ANALOG-TO--DIGITAL
CONVERTER (ADC)
„ An ADC takes an analog input voltage and after a
certain
t i amountt off ti
time produces
d a di
digital
it l output
t t code
d
which represents the analog input.

33

SEE 3263 A/D & D/A CONVERTERS

Digital Ramp ADC

34

17
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

„ For a digital ramp ADC,


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

35

SEE 3263 A/D & D/A CONVERTERS

„ Total possible steps = 210 – 1 = 102310


„ p size = 10.23 = 10mV
Step
1023

„ Since VA = 3.728 V and VT = 0.1 mV


„ VAX must reach 3.7281 V
This needs 3.7281 V
„ = 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

18
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

SUCCESSIVE APPROXIMATION
ADC (SAC)

37

SEE 3263 A/D & D/A CONVERTERS

Assume a 4-bit
START

SAC with a step Clear all

size of 1V. bits

Let assume the Start at

analog
l input,
i t 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

19
10/28/2008

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
20mV
Step 108 would produce VAX = 2.16 V
Step 109 would produce VAX = 2.18 V
The SAC always produces a final VAX that is at the
step below VA
Thus, for VA = 2.17 V, the digital result would be
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

20
10/28/2008

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 method.
„ It has two analog inputs: VIN(+) and VIN(-) to allow
differential inputs.
„ The actual analog input, VIN = VIN(+) - VIN(-).
„ In single-ended measurements, the analog input is
applied
li d tto VIN(+)
( ) while
hil VIN(-)
( ) iis connected
t d tto analog
l
ground.
„ During normal operation, the converter uses VCC = + 5V
as its reference voltage, and the analog input can range
from 0 to 5V full scale.
41

SEE 3263 A/D & D/A CONVERTERS

5V
„ With 8-bits, the resolution is = = 19.6 mV
255
„ It has an internal clock generator circuit that produces a
frequency of 1
f=
1.1 RC
where R and C are values of externally connected
components.
„ A typical clock frequency is 606 kHz using R = 10 kΩ
and C = 150 pF. If desired, an external clock frequency
can be used by connecting it to the CLK IN pin.
„ With 606kHz clock frequency, TC = 13.2µs.
„ It has separate ground connections for digital and analog
voltages at pin 10 and pin 8 respectively.
42

21
10/28/2008

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

22
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

„ Referring to the figure above, 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 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 ref = 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 Vin = 2.26 V
2.26
Total steps = = 225.1
10.04 mV
Thus total steps = 22510 = 111000012=D7D6D5D4D3D2D1D0
LED that will light up: LED4, LED3, LED2, LED1
Vin = 8710 x 10.04mV = 0.8735V although actual Vin
should be slightly greater than 0.8735V.
46

23
10/28/2008

SEE 3263 A/D & D/A CONVERTERS

THE FLASH ADC


„ Flash ADC is the
A l i highest
Analog inhighest-speedC speed
Comparator  Outputs
t O t t ADC,Di it l O but
Digital Outputs
t t
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.
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
0         1        1
3 – 4 V 0       0       0      1       1       1       1

4 – 5 V
analog comparators,
0        0       0      0       1       1       1 1         0        0

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

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

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

47

SEE 3263 A/D & D/A CONVERTERS

THE END

48

24

S-ar putea să vă placă și