"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vi2 = 2.45;# in Volts\n",
"Vi1 = 2.35;# in Volts\n",
"A0 = 120;# open-loop voltage gain\n",
"\n",
"#calculation:\n",
"Vo = A0*(Vi2 - Vi1)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the output voltage is \",round(Vo,2),\" V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the output voltage is 12.0 V"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 2, page no. 281
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vg = 150E3;# differential voltage gain \n",
"CMRR = 90;# in dB\n",
"\n",
"#calculation:\n",
"CMG = Vg/(10**(CMRR/20))\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n common-mode gain is \",round(CMG,2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" common-mode gain is 4.74"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 3, page no. 282
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vg = 120;# differential voltage gain \n",
"Vi = 3;# in Volts\n",
"Vo = 0.024;# in Volts\n",
"\n",
"#calculation:\n",
"CMG = Vo/Vi\n",
"CMRR = 20*(1/2.303)*math.log(Vg/CMG)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n common-mode gain is \",round(CMG,3),\" and CMRR is \",round(CMRR,2),\" dB\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" common-mode gain is 0.008 and CMRR is 83.51 dB"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 4, page no. 283
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Rf = 2000;# in ohms\n",
"Ri = 1000;# in ohms\n",
"Vi1 = 0.4;# in Volts\n",
"Vi2 = -1.2;# in Volts\n",
"\n",
"#calculation:\n",
"Vo1 = -1*Rf*Vi1/Ri\n",
"Vo2 = -1*Rf*Vi2/Ri\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n output voltage when the input voltage is 0.4V is \",round(Vo1,2),\" V \"\n",
"print \" and when the input voltage is -1.2V is \",round(Vo2,2),\" V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" output voltage when the input voltage is 0.4V is -0.8 V \n",
" and when the input voltage is -1.2V is 2.4 V\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 5, page no. 283
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Ii = 100E-9;# in Amperes\n",
"T = 20;# in \u00b0C\n",
"Rf = 1E6;# in ohms\n",
"Ri = 10000;# in ohms\n",
"\n",
"#calculation:\n",
"A = -1*Rf/Ri\n",
"Vos = Ii*Ri*Rf/(Ri+Rf)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)the voltage gain is \",round(A,2),\"\"\n",
"print \"\\n (b)output offset voltage is \",round(Vos*1000,2),\" mV\"\n",
"print \"\\n (c)The effect of input bias current can be minimised by ensuring \"\n",
"print \"that both inputs have the same driving resistance.\" \n",
"print \"This means that a resistance of value of 9.9 kohm (from part (b)) \"\n",
"print \"should be placed between the non-inverting (+) terminal and earth.\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)the voltage gain is -100.0 \n",
"\n",
" (b)output offset voltage is 0.99 mV\n",
"\n",
" (c)The effect of input bias current can be minimised by ensuring \n",
"that both inputs have the same driving resistance.\n",
"This means that a resistance of value of 9.9 kohm (from part (b)) \n",
"should be placed between the non-inverting (+) terminal and earth.\n"
]
}
],
"prompt_number": 2
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 6, page no. 284
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vg = 40;# in dB\n",
"bf = 5000;# in Hz\n",
"Ri = 10000;# in ohms\n",
"\n",
"#calculation:\n",
"A = 10**(Vg/20)\n",
"Rf = A*Ri\n",
"f = A*bf\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n the voltage gain is \",round(A,2),\", Rf = \",round(Rf/1000,2),\"kohm and frequency = \",round(f/1000,2),\" kHz\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" the voltage gain is 100.0 , Rf = 1000.0 kohm and frequency = 500.0 kHz"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 7, page no. 286
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vi = -0.4;# in Volts\n",
"R1 = 4700;# in ohms\n",
"R2 = 10000;# in ohms\n",
"\n",
"#calculation:\n",
"A = 1 + (R2/R1)\n",
"Vo = A*Vi\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n(a) the voltage gain is \",round(A,2),\"\"\n",
"print \"\\n(b) output voltageis \",round(Vo,2),\" V\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
"(a) the voltage gain is 3.13 \n",
"\n",
"(b) output voltageis -1.25 V"
]
}
],
"prompt_number": 7
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"