summaryrefslogtreecommitdiff
path: root/testing_by_test/muktesh.ipynb
blob: 1b9503fc9851aa0ec8ebbd58404e17e6f8935c06 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 5: Sequential Circuits, Flip flops & Multivibrators"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 1, Page 183"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Required time=1.1 milli-seconds\n"
     ]
    }
   ],
   "source": [
    "#Variable declaration\n",
    "R=10*10**3;#external resistance ohm#\n",
    "C=0.1*10**-6;#timing capacitor Farad#\n",
    "\n",
    "#Calculations\n",
    "T=1.1*R*C;#time for which output remains high in monostable multivibrator using IC 555 timer#\n",
    "\n",
    "#Result\n",
    "print \"Required time=%.1f milli-seconds\"%(T*10**3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 2, Page 183"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "frequency=48.10 KH\n",
      "duty cycle=33.33 percent\n"
     ]
    }
   ],
   "source": [
    "#Variable declaration\n",
    "Ra=10*10**3  #ohms\n",
    "Rb=10*10**3  #ohms\n",
    "C=.001*10**-6 #F\n",
    "\n",
    "#Calculations&Results\n",
    "T1=.693*(Ra+Rb)*C;#charging time constant#\n",
    "T2=.693*Rb*C;#discharging time constant#\n",
    "T=T1+T2;#total time#\n",
    "f=1./T;#frequency#\n",
    "print 'frequency=%.2f KH'%(f*10**-3);\n",
    "D=T2/T;#duty cycle#\n",
    "D=D*100\n",
    "print 'duty cycle=%.2f percent'%D\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 3, Page 184"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "frequency=1.077 KH\n",
      "duty cycle=24.63 percent\n"
     ]
    }
   ],
   "source": [
    "#Variable declaration\n",
    "Ra=6.8*10**3  #ohms\n",
    "Rb=3.3*10**3  #ohms\n",
    "C=.1*10**-6   #F\n",
    "\n",
    "#Calculations&Results\n",
    "T1=.693*(Ra+Rb)*C;#charging time constant#\n",
    "T2= .693*Rb*C;#discharging time constant#\n",
    "T=T1+T2;#total time#\n",
    "f=1/T#frequency#\n",
    "print 'frequency=%.3f KH'%(f*10**-3)\n",
    "D=T2/T;#duty cycle#\n",
    "D=D*100\n",
    "print 'duty cycle=%.2f percent'%D"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}