import math
#Variable Declaration
f=1.5*10**6 #Clock frequency in Hz
N=1999 #Maximum count
#Calculations
clock_time_period=1/f #Clock time period in s
t1=N*clock_time_period #Maximum time in s
t2=0.25*t1 #Select t2=0.25*t1
t=t1+t2 #in s
fr=1/t #in Hz
#Results
print "Maximum time t1 for the digital voltmeter is",round(t1*10**3,2),"ms"
print "Ramp Generator Frequency can be",int(fr),"Hz"
import math
#Variable Declaration
V=20 #Voltage to be measured in V
analog_range=25 #Range of analog meter in V
analog_accuracy=2.0/100 #Accuracy of analog meter at FSD
#Calculations
#Analog Instrument:
voltage_error=analog_accuracy*analog_range #in V
error=voltage_error*100/V #in percentage
print "For the analog meter,"
print "Voltage Error=±",round(voltage_error,1),"V"
print "Error=±",round(error,1),"%"
#Digital Instrument:
#For 20 V displayed on a 3 1/2 digit display
digit=0.1 #in V
digital_accuracy=0.6/100
voltage_error=digital_accuracy*V+digit #in V
error=voltage_error*100/V #in percentage
print
print "For the digital meter,"
print "Voltage Error=±",round(voltage_error,2),"V"
print "Error=±",round(error,1),"%"
import math
#Variable Declaration
ft=1.0*10**6 #Clock generator frequency in Hz
fi=1.512*10**3 #Input frequency in Hz
#Calculations
#Using 6 decade counters
d=6 #No. of decade counters used
f1=ft/10**d #Time base frequency in Hz
t1=1/f1 #Time period in s
n1=fi*t1 #No. of cycles counted
f=n1/t1
print "When 6 decade counters are used,f=",round(f/1000,3),"kHz"
#Using 4 decade counters
d=4 #No.of decade counters used
f2=ft/10**d #Time base frequency in Hz
t2=1/f2 #Time period in s
n2=fi*t2 #No. of cycles counted
f=n2/t2
print "When 4 decade counters are used,f=",round(f/1000,1),"kHz"
import math
#Variable Declaration
accuracy=10**-6 #Accuracy
#At f=100 Hz
f=100 #Frequency in Hz
error=1+f*accuracy #in terms of counts
percentage_error=error*100/f #in percentage
print "At f=100 Hz,"
print "error=±",round(error),"count"
print "%error=±",round(percentage_error),"%"
print
#At f=1 MHz,
f=1*10**6 #Frequency in Hz
error=1+f*accuracy #in terms of counts
percentage_error=error*100/f #in percentage
print "At f=1 MHz"
print "error=±",round(error),"count"
print "%error=± ",'%.1e' % percentage_error,"%"
print
#At f=100 MHz
f=100*10**6 #Frequency in Hz
error=1+f*accuracy #in terms of counts
percentage_error=error*100/f #in percentage
print "At f=100 MHz,"
print "error=±",round(error),"count"
print "%error=±",'%.2e' % percentage_error,"%"
print