Chapter 12 : D to A and A to D Converters

Example 12.1, Page 563

In [1]:
from array import array

#Variable Declaration

k=["000","001","010","011","100","101","110","111"]
vo=[0,1.0/8,2.0/8,3.0/8,4.0/8,5.0/8,6.0/8,7.0/8]
voact=[0,1.0/8,3.0/16,7.0/16,3.0/8,11.0/16,11.0/16,7.0/8]
INL=[0,0,0,0,0,0,0,0]
DNL=[0,0,0,0,0,0,0,0]

#Calculation

for i in range(0,8):
    INL[i]=(voact[i] -vo[i])*8
for i in range(1,8):
    DNL[i]=INL[i]-INL[i-1]
DNL[0]=INL[0]

#answer

print "INL =",INL
print "DNL =",DNL
print "The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe"
print "a nonmonotonicity as the code changes from 011 and 100 , where the step size is"
print "(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB."
print "The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity ."
INL = [0, 0.0, -0.5, 0.5, -1.0, 0.5, -0.5, 0.0]
DNL = [0, 0.0, -0.5, 1.0, -1.5, 1.5, -1.0, 0.5]
The maxima of INL and DNL are , respectively , INL=1 LSB and DNL=(3/2) LSB.We observe
a nonmonotonicity as the code changes from 011 and 100 , where the step size is
(−1/2) LSB instead of (+1 LSB) ; hence , DNL (100) =−(1/2)−(+1)=(−3/2) LSB<−1 LSB.
The fact that DNL(101) =(3/2) LSB>1 LSB, though undesirable , does not cause nonmonotocity .

Example 12.2, Page 567

In [2]:
import math

#Variable Declaration

n=10.0            
Vfsr=10.24         #v
StoNDsumdB=56.0    # dB

#Calculation

Eq=Vfsr/((2**n)*math.sqrt(12))
SNRdB=(6.02*n)+1.76
ENOB=(StoNDsumdB -1.76)/6.02

#answer

print "Eq =",round(Eq*10**3,2),"mV"
print "SNR(max) =",round(SNRdB+0.01,2),"dB"
print "ENOB =",round(ENOB,2)
Eq = 2.89 mV
SNR(max) = 61.97 dB
ENOB = 9.01

Example 12.3, Page 581

In [3]:
import math

#Variable declaration

n=12.0
Vref=10.0       # V
Troom=25.0      # degCelsius
Tmin=0          # degCelsius
Tmax=70.0       # degCelsius

#Calculation

erfa=1.0/4
er=Vref/(2**14)
Temax=Tmax -Troom
ida=er/Temax
TCmaxVref=ida/Vref
ng=2                    # Noise Gain
TCmaxVos=ida/ng

#answer

print "TCmax( Vref ) = (+−)",round(TCmaxVref *10**6,2),"ppm/degC"
print "TCmax(Vos) = (+−)",round(TCmaxVos *10**6,1)," micro volt/degC"
TCmax( Vref ) = (+−) 1.36 ppm/degC
TCmax(Vos) = (+−) 6.8  micro volt/degC

Example 12.4, Page 583

In [4]:
import numpy as np
import math

#Variable Declaration

Q=1.0/math.sqrt(2)         
H0bp=-1.0           #V/V
f0step=10.0        #Hz
n=10.0

#Calculation

R4=R2=10*10**3                    #Assumed
C=1*10**(-9)                      #Assumed 
f0FSR=(2**n)*f0step
R5=1.0/(2*np.pi*f0FSR*C)
R3=Q*math.sqrt(R2*R4)
R1=-R3/H0bp

#answer

print "Designed Digitally Programmable filter : "
print "R1 =",round(R1*10**(-3),2),"kilo ohm"
print "R2 =",round(R2*10**(-3),2),"kilo ohm"
print "R3 =",round(R3*10**(-3),2),"kilo ohm"
print "R4 =",round(R4*10**(-3),2),"kilo ohm"
print "R5 =",round(R5*10**(-3),2),"kilo ohm"
print "C =",round(C*10**9),"nF"
Designed Digitally Programmable filter : 
R1 = 7.07 kilo ohm
R2 = 10.0 kilo ohm
R3 = 7.07 kilo ohm
R4 = 10.0 kilo ohm
R5 = 15.54 kilo ohm
C = 1.0 nF

Example 12.5, Page 584

In [5]:
import math

#Variable Declaration

Vclamp=5.0       #V
n=12.0
f0step=1.0      #Hz
Vz5=3.6         #V
R1=20*10**3      #ohm
R2=R1
R3=6.2*10**3     #ohm

#Calculation

f0FSR=(2**n)*f0step
iO=100*10**(-6)
C=(iO*(R2/R1))/(4*Vclamp*f0FSR)

#answer

print "Designed Digitally Programmable triangular or square wave oscillator :"
print "R1 =",round(R1*10**(-3),2),"kilo ohm"
print "R2 =",round(R2*10**(-3),2),"kilo ohm"
print "R3 =",round(R3*10**(-3),2),"kilo ohm"
print "C =",round(C*10**9,2),"nF"
print "Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent "
Designed Digitally Programmable triangular or square wave oscillator :
R1 = 20.0 kilo ohm
R2 = 20.0 kilo ohm
R3 = 6.2 kilo ohm
C = 1.22 nF
Use 1.0 nF, which is more easily available , and raise R1 to 24.3 kohms ,1 percent 

Example 12.6, Page 599

In [6]:
import math

#Variable Declaration

n=12.0
nreqd=16.0

#Calculation

resbits=nreqd -n
m=resbits/(1.0/2)
fS=44.1*10**3
fovers=(2**m)*fS
SNRmax=(6.02*(n+(0.5*m)))+1.76

#answer

print "Oversampling Frequency =",round(fovers *10**(-6),2),"MHz"
print "SNRmax =",round(SNRmax,2),"dB" 
Oversampling Frequency = 11.29 MHz
SNRmax = 98.08 dB

Example 12.7, Page 602

In [7]:
import math

#Variable Declaration

SNRmaxmindB=96    #dB
SNRmaxminb=16     #dB
n=1.0

#Calculation

m1=((((SNRmaxmindB+3.41)/6.02)-n)/1.5)
m1app=m1 -0.042193           #Approximation for m1 
k1=2**m1app
m2=((((SNRmaxmindB+11.14)/6.02)-n)/2.5) 
k2=2**m2

#answer

print "k for first order Integrate Difference ADC : k =",round(k1)
print "k for second order Integrate Difference ADC : k=",round(k2)
k for first order Integrate Difference ADC : k = 1261.0
k for second order Integrate Difference ADC : k= 105.0