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;
#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;
#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);