Chapter 21 - Integrated Circits

Example E1 - Pg 1067

In [1]:
#Ex21_1 Pg-1067
#calculate Pulse width
print'%s'%("Refer to figure 21.10")
R=5000. #resistor R in ohm
C=0.1*10.**(-6.) #capacitance in farad
tau=1.1 #time constant
tON=tau*R*C #pulse width in sec
print'%s %.2f'%("Pulse width = msec",tON*1e3)
Refer to figure 21.10
Pulse width = msec 0.55

Example E2 - Pg 1068

In [2]:
#Ex21_2 Pg-1068
#calculate time output
print '%s' %("Refer to figure 21.12")
R1=20000. #timing resistor R1 in ohm
R2=R1 #timing resistor R2 in ohm
C=0.1*10.**(-6.) #capacitance in farad
tau=0.69 #time constant
tHIGH=tau*(R1+R2)*C #time output that will remain high
print '%s %.2f' %("Time output = msec",tHIGH*1e3)
Refer to figure 21.12
Time output = msec 2.76

Example E3 - Pg 1069

In [3]:
#Ex21_3 Pg-1069
#calculate time output
print '%s' %("Refer to figure 21.12")
R2=20000. #timing resistor R2 in ohm
C=0.1*10.**(-6.) #capacitance in farad
tau=0.69 #time constant
tLOW=tau*(R2)*C #time output that will remain high
print '%s %.2f' %("Time output = msec",tLOW*1e3)
Refer to figure 21.12
Time output = msec 1.38

Example E4 - Pg 1069

In [4]:
#Ex21_4 Pg-1069
#calculate output frequency
R1=20000. #timing resistor R1 in ohm
R2=R1 #timing resistor R2 in ohm
C=0.1*10.**(-6.) #capacitance in farad
f0=1.45/((R1+2.*R2)*C) #output frequency
print '%s %.2f' %("Output frequency = Hz",f0)
Output frequency = Hz 241.67

Example E5 - Pg 1069

In [5]:
#Ex21_5 Pg-1069
#calculate duty cycle
print '%s' %("Refer to figure 21.12")
R1=20000. #timing resistor R1 in ohm
R2=R1 #timing resistor R2 in ohm
D=(R1+R2)/(R1+2.*R2)*100. #duty cylce
print '%s %.1f' %("Duty cycle =",D)
Refer to figure 21.12
Duty cycle = 66.7

Example E6 - Pg 1070

In [6]:
#Ex21_6 Pg-1070
#calculate R1 and R2
C=0.01*10.**(-6.) #capacitance in farad
f0=2000. #frequency in Hz
Req=1.45/(f0*C) #equivalent resistance or R1+R2
print '%s' %("Because a square wave has duty cycle of 50% each resistor must be the same")
R1=Req/2. 
R2=R1
print'%s %.2f' %("R1 = R2 = kohm",R2*1e-3)
Because a square wave has duty cycle of 50% each resistor must be the same
R1 = R2 = kohm 36.25

Example E7 - Pg 1073

In [7]:
#Ex21_7 Pg-1073
#calculate pulse width
R=260000. #resistor R in ohm
C=25*10.**(-6.) #capacitance in farad
tau=1.1 #time constant
t_delay=tau*R*C #pulse width in sec
print '%s %.2f' %("Pulse width = sec",t_delay)
Pulse width = sec 7.15

Example E8 - Pg 1076

In [8]:
#Ex21_8 Pg-1076
#calculate Binary value of 253
dec=253 #decimal number
bina=bin(dec) #binary value of 253
print bina
0b11111101