from __future__ import division
tsu=20*10**(-9)
print "tsu= %0.2e"%(tsu)," seconds" # Input set-up time of second flip flop
tpd=30*10**(-9)
print "tpd= %0.2e"%(tpd)," seconds" # Input set-up time of first flip flop
Tmin=tpd+tsu
print "Tmin=tpd+tsu= %0.2e"%(Tmin)," seconds" # Minimum allowed time interval b/w threshold levels of two consecutive triggering clock edges activating two flip-flops
fCkmax=1/Tmin # formulae
print "fCkmax=1/Tmin = %0.2e"%(fCkmax)," Hz"# Maximum clock frequency at which flip-flop can operate reliably
from __future__ import division
tphL=40*10**(-9)
print "tphL= %0.2e"%(tphL)," seconds" # Time taken from Clear to output
n=3
print "n= %0.2f"%(n) # Number of bits in counter i.e no. of flip-flops used
fmax=1/(n*tphL) # Using formulae fmax<= 1/(n*tphL)
print "fmax=1/(n*tphL) = %0.2e"%(fmax)," Hz"# Maximum counting rate at which flip-flop can operate reliably
from __future__ import division
fs=2*10**(3)
print "fs= %0.2f"%(fs)," Hz"# sine wave input signal frequency
fB=1*10**(6)
print "fB= %0.2f"%(fB)," Hz"# input Time-Base clock frequency
print "part(i)"# part(i)of question
fb=fB/(10**5)
print "fb= fB/(10**5)=%0.2f"%(fb)," Hz"# Time-Base frequency for 5 decade counter
delta_t=1/fb
print "delta_t=1/fb= %0.2f"%(delta_t)," seconds" # Gate Time interval
DISP1=fs*delta_t
print "fs*delta_t= %0.2f"%(DISP1)# Display indication for 5 decade counter
print "Display indication=0200"# Display indication as 4-bit
print "part(ii)"# part(ii)of question
fb=fB/(10**3)
print "fb=fB/(10**3)= %0.2f"%(fb)," Hz"# Time-Base frequency for 3 decade counter
delta_t=1/fb
print "delta_t=1/fb= %0.2f"%(delta_t)," seconds" # Gate Time interval for 3 decade counter
DISP2=fs*delta_t
print "fs*delta_t= %0.2f"%(DISP2)# Display indication for 3 decade counter
print "Display indication=0002"# Display indication as 4-bit