# Chapter 12: Analog-to-Digital-to-Analog Conversion¶

## Example 12.1, Page 445¶

In [3]:
import math

#Variable declaration
V=2.;            #in V
Bits=12;

#Calculations&Results
levels=2**Bits;       #12 bit words
step=V/levels*10**6;
print "The system can resolve = %.f uV\n"%step;
Drange=20*math.log10(levels);
print "The Dynamic Range is = %.0f dB\n"%Drange;

DR=6*Bits;
print "The Dynamic Range is approx (6dB * no.of bits),i.e. = %.0f dB\n"%DR;

The system can resolve = 488 uV

The Dynamic Range is = 72 dB

The Dynamic Range is approx (6dB * no.of bits),i.e. = 72 dB



## Example 12.2, Page 446¶

In [6]:
#Variable declaration
Bits=16;
V=0.775;            #in V
Vp=1.550;            #in Vp_p

#Calculations&Results
levels=2**Bits;       #12 bit words
DR=6*Bits;
print "The Dynamic Range is  = %.0f dB\n"%DR; #
step=Vp/levels*10**6;
print "The system can resolve = %.2f uV\n"%step;

The Dynamic Range is  = 96 dB

The system can resolve = 23.65 uV



## Example 12.3, Page 448¶

In [7]:
#Variable declaration
DR=50.;              #in dB

#Calculations
Bits=DR/6;

#Results
print "The Bits required are = %.1f \n"%Bits;
#we cannot  have fractional bit so,
print "we cannot  have fractional bit so, Bits required are = %.0f \n"%(Bits+1);

The Bits required are = 8.3

we cannot  have fractional bit so, Bits required are = 9