summaryrefslogtreecommitdiff
path: root/sample_notebooks/DeepTrambadia/sc223.ipynb
blob: 319edd950044c8471c90a335936fda21d31707d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#example 2.23 page no.81
#Repeated example with silicon diode
import math

#initialization of variables

v=4                #v in Volt
Vi=[16,-16]        #peak voltage in Volt
VT=0.7             #thresold voltage

#calculation


print "+16V dc supply is pressuring the diode to stay in the short circuit state"
print "But for any Vi < v,it will result in short circuted diode"
print "But for any Vi > v,it will result in open circuted diode"
print "If the diode voltage is 0.7V"

v = v-VT
print "resulting battery input voltage = %.1fV" %(v)
print "For open circuit state"
if (Vi[0] >= v):
	V0=Vi[0]
	print "V0 =%dV " %(V0)

print "for the negative region of the input signal,the diode will be in the 'on' state"

if [Vi[1]==-16]:
    V0 = v
    print "V0 = %.2fV" %(V0)