You are on page 1of 19

Chapter 2

D/A and A/D


Converter

1. D/A Converter
2. A/D Converter
D/A Converter
MSB
b1
b2
b3
B DAC
. B bits Analog
inpu
. output
t bits
. xq

bB
LSB

uni-polar mode ⇒ xq ∈ [0 ; R]
Full-scale R
bi-polar mode ⇒ xq ∈ [-R/2 ; R/2]
D/A Converter

There ways to convert B bits [b1, b2, ….., bB]


into analog

Uni-polar natural binary


Bi-polar offset binary
Bi-polar 2’s complement
Uni-polar natural binary

xq = R(b1.2-1 + b2.2-2 + … + bB.2-B)

= R.2-B(b1.2B-1 + b2.2B-2 + … + bB)


= ∆.m
where
m = b1.2B-1 + b2.2B-2 + … + bB ,
m = 0, 1, 2, …, 2B-1
Bi-polar offset binary

Shift the output equation xq of uni-polar natural


binary down to a half of scale
xq = R(b1.2-1 + b2.2-2 + … + bB.2-B) – R/2
= R(b1.2-1 + b2.2-2 + … + bB.2-B – 0.5)
= R.2-B(b1.2B-1 + b2.2B-2 + … + bB - 0.5/2-B)
= ∆.m’
where
m = m – ½ .2B = m – 2B-1 ,
m’ = -2B-1, …, -2, -1, 0, 1, 2, …, 2B-1-1
Bi-polar 2’s complement

Replace MSB b1 of the bi-polar offset binary by b1

xq = R( b.2
1
-1
+ b 2.2 -2
+ … + b B.2 -B
– 0.5)
Bi-polar 2’s complement

Kind of conversion Input/Output relationship


Uni-polar natural binary xq= R(b1.2-1 + b2.2-2 + … + bB.2-B)

Bi-polar offset binary xq=R(b1.2-1 + b2.2-2 + … + bB.2-B – 0.5)

Bi-polar 2’s complement xq = R(b1 .2-1 + b2.2-2 + … + bB.2-B – 0.5)

In the case B = 4 and R = 10V, the quantization step is:


R 10
∆ = B = 4 = 0,625
2 2
D/A Converter

atural binary: xq are always positive, equidistant


d belong to the range [0 ; 10]V. The maximum
lue is R - ∆ = 10 - 0,625 = 9,375V.
Offset binary: the range is divided by 2 and the
values of xq are equidistant in the range of [-5 ;
5]V. The maximum value is R/2 - ∆ = 5 - 0,625
= 4,375V.
s complement: complement b1 of offset binary
Bi-polar 2’s complement
0100 = 4
0101 = 5 0011 = 3
0110 = 6 0010 = 2
0111 = 7 0001 = 1

1000 = -8 0000 = 0

1001 = -7 1111 = -1

1010 = -6
1110 = -2
1011 = -5
1100 = -4
1101 = -3 m2 c = m + 1
A/D Converter
LSB
bB
Analo
g .
input . B
ADC . output
x b3 bits
b2
b1
MSB

uccessive approximation method

main component is a DAC in a feedback circle


A/D Converter
x Comparat SAR
Analog or
input C = 1/0 b1 b2 b3 … bB
xq MSB

B
output
bits

LSB
xq b1 b2 b3 … bB

DAC
Successive approximation
algorithm

. B bits in the successive approximation register


SAR are cancelled to be [0, 0, …, 0].
. From the MSB b1, every bit in the sequence is
turned on and there is a comparison to decide
whether this bit will be hold or turned off.
If the quantized value xq of bit b1 at the outpu
of DAC is less than x, b1 is hold.
If the quantized value xq of bit b1 at the output
of DAC is greater than x, b1 is turned off.
Successive approximation
algorithm

3. The control logic puts the right logic of bit in th


right position in the SAR.

Repeat until the LSB is checked.

After B times, B bits in SAR are right bits and


sent to the output of ADC.
Successive approximation
algorithm

Example:
Convert the analog value x = 3,5 into the offset
binary code, assume that B = 4 and R = 10V.
Solution:
+ B = 4 and R = 10V, we use the table 2.1.
With every bit is turned on, the input/output val
of DAC is referenced at the fifth column in the
table 2.1.
Successive approximation
algorithm

Test b1b2-b3b4 xq The output of


the Coparator
b1 1000 0,000 1
b2 1100 2,500 1
b3 1110 3,750 0
b4 1101 3,125 1
1101 3,125

4 bits in SAR are 1101 and the correspondin


quantized value is xq = 3,125. ⇒ Truncation.
Successive approximation
algorithm

To quantize a value by rounding:

x has to be shifted a half of quantization step


⇒ replace x by y = x + ∆/2

If y belongs to the upper half of the quantizatio


step, y will be shifted to the higher level and cu
down to that level.
Successive approximation
algorithm

x: To quantize xq = 3,5 by rounding, this value is


eplaced by y = x + ∆/2 = 3,5 + 0,625/2 = 3,8125
The testing table is:
Test b1b2-b3b4 yq The output of
the Coparator
b1 1000 0,000 1
b2 1100 2,500 1
b3 1110 3,750 1
b4 1111 4,375 0
1110 3,750
Successive approximation
algorithm
The successive approximation algorithm for
2’complement has a little difference:
b1 decides the sign “-” or “+” of x.
If x ≥ 0 ⇒ b1 = 0.
If x < 0 ⇒ b1 = 1.
xample: Find the 2’complement and rounding
4-bit code of x = 3,5.
From offset binary and rounding code of x = 3,5
⇒ xq = 3,750 ⇒ 0 1 1 0
Successive approximation
algorithm
Or we have the other testing table.
Test b1b2-b3b4 xq

b1 1000 -5,000 0 b1 = 1 - The


output of the
Coparator
b2 0100 2,500 1
The output of
b3 0110 3,750 1
the Coparator.
b4 0111 4,375 0
0110 3,750

You might also like