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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
|
{
"metadata": {
"name": "",
"signature": "sha256:80f88a972947f3f07c0690a368a00c796fad1cccb9df59741b4a8c03cd1e434e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"CHAPTER 1- FUNDAMENTAL CONCEPTS"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.1- PG NO:4"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.1#\n",
"#clears the screen#\n",
"#clears the existing variables#\n",
"print('the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation')\n",
"print('Y=A*B')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"the locker door (Y) can be opened using one key (A) which is with you and the other key (B) which is with the bank executive. When both the keys are used, the locker door opens, i.e. the locker door can be opened (Y=1) only when both the keys are applied(A=B=1).Thus, this can be expressed as an AND operation\n",
"Y=A*B\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.3 - PG NO.6"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.3#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.')\n",
"print('Y=T or P')\n",
"print('Y=T+P')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Let the temperature and pressure be converted into electrical signals and T=1 if temperature exceeds the specified limit and P=1 if pressure exceeds the specified limit. If T=1 or P=1 or both T and P are 1 then the alarm is required to be activated, i.e., the signal applied to the alarm Y=1. This operation can be expressed as an or operation.\n",
"Y=T or P\n",
"Y=T+P\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.7.a - PG NO:10"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.7(a)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0')\n",
"print('Y=1')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"when one of the logic input of 2-input NAND gate is 0, then irrespective of the other input, the output comes out to be 1. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 0\n",
"Y=1\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.7.b - PG NO:11"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.7(b)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1')\n",
"print('Y= ~A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"when one of the logic input of 2-input NAND gate is 1, then when A=1, Y=0 and if A=0, Y=1\n",
"Y= ~A\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.9.a - PG NO:12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.9(a)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1')\n",
"print('Y= ~A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"when one of the logic input of 2-input NOR gate is 0, then when A=1, Y=0 and if A=0, Y=1\n",
"Y= ~A\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.9.b - PG NO:12"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.9(b)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1')\n",
"print('Y=0')\n",
"print('here the output of Y is 0 irrespective of input of A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"when one of the logic input of 2-input NOR gate is 1, then irrespective of the other input, the output comes out to be 0. In fact, a NAND gate is disabled or inhibited if one of its inputs is connected to logic 1\n",
"Y=0\n",
"here the output of Y is 0 irrespective of input of A\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.11.a - PG NO:14"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.11(a)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0')\n",
"print('thus, Y=A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"If we connect one input of EX-OR gate to 0 permanently, we observe that Y=A*0+A*0\n",
"thus, Y=A\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.11.b- PG NO:14"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.11(b)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1')\n",
"print('thus, Y= ~A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"If we connect one input of EX-OR gate to 1 permanently, we observe that Y=A*1+A*1\n",
"thus, Y= ~A\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.13.a - PG NO:15"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.13(a)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0')\n",
"print('thus, Y= ~A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"If we connect one input of EX-NOR gate to 0 permanently, we observe that Y=A*0+A*0\n",
"thus, Y= ~A\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"EXAMPLE 1.13.b- PG NO:15"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#example 1.13(b)#\n",
"#clears the screen#\n",
"#clears already existing variables#\n",
"print('If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1')\n",
"print('thus, Y=A')"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"If we connect one input of EX-NOR gate to 1 permanently, we observe that Y=A*1+A*1\n",
"thus, Y=A\n"
]
}
],
"prompt_number": 10
}
],
"metadata": {}
}
]
}
|