summaryrefslogtreecommitdiff
path: root/Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb')
-rw-r--r--Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb985
1 files changed, 985 insertions, 0 deletions
diff --git a/Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb b/Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb
new file mode 100644
index 0000000..7caf218
--- /dev/null
+++ b/Integrated_Circuits_by_S_Sharma/4-Linear_Applications_of_IC_Op_Amps.ipynb
@@ -0,0 +1,985 @@
+{
+"cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Linear Applications of IC Op Amps"
+ ]
+ },
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10: Safe_frequency_and_dc_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.10\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R_F = 1.2;// in M ohm\n",
+"R_F = R_F * 10^6;// in ohm\n",
+"C_F = 10;// in nF\n",
+"C_F = C_F * 10^-9;// in F\n",
+"f_a = 1/(2*%pi*R_F*C_F);// in Hz\n",
+"disp(f_a,'The safe frequency in Hz is');\n",
+"R1 = 120;// in k ohm\n",
+"R1 = R1 * 10^3;// in ohm\n",
+"A = R_F/R1;\n",
+"AindB= 20*log10(A);// in dB\n",
+"disp(AindB,'The d.c gain in dB is');\n",
+"f = 10;// in kHz\n",
+"f = f * 10^3;// in Hz\n",
+"A = (R_F/R1)/(sqrt( 1+ ((f/f_a)^2) ));\n",
+"V_in_peak = 5;// in V\n",
+"V_out_peak = V_in_peak*A;// in V\n",
+"disp(V_out_peak*10^3,'The peak of output voltage in mV is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.11: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.11\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"Vrms= 10;// in mV\n",
+"f= 2*10^3;// in kHz\n",
+"C= 2*10^-6;// in F\n",
+"R= 50*10^3;// in ohm\n",
+"SF= -1/(C*R);// scale factor\n",
+"//Vout= -1/(R*C)*sqrt(2)*Vrms*integrate('sind(2*%pi*f*t)','t',0,t);// in mV\n",
+"//Vout= 1/(R*C)*sqrt(2)*Vrms/(2*%pi*f)*(cos(4000*t)-1);// in mV\n",
+"V= 1/(R*C)*sqrt(2)*Vrms/(2*%pi*f);// (assumed)\n",
+"disp('Output voltage in mV is : '+string(V)+'*(cos(4000 *t)-1)) mV')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.12: Closed_loop_time_constant.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.12\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"Vin=10;// in V\n",
+"R= 2.2;// in kΩ\n",
+"R= R*10^3;// in Ω\n",
+"T= 1;// in ms\n",
+"T= T*10^-3;// in sec\n",
+"C= 1;// in µF\n",
+"C= C*10^-6;// in F\n",
+"gain= 10^5;// differential voltage gain\n",
+"I= Vin/R;// in A\n",
+"V= I*T/C;// in V\n",
+"disp(V,'The capacitor voltage at the end of the pulse in volts is : ')\n",
+"RC_desh= R*C*gain;// in sec\n",
+"disp(RC_desh,'The closed loop time constant in sec is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.13: Values_of_R1_and_RF.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.13\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"omega= 10000;// in rad/sec\n",
+"GaindB= 20;// peak gain in dB\n",
+"Gain= 10^(GaindB/20);\n",
+"C= 0.01;// in µF\n",
+"C= C*10^-6;// in F\n",
+"// Formula omega= 1/(C*RF)\n",
+"RF= 1/(C*omega);// in Ω\n",
+"R1= RF/Gain;// in Ω\n",
+"disp(RF*10^-3,'The value of RF in kΩ is : ')\n",
+"disp(R1*10^-3,'The value of R1 in kΩ is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14: Sketch_of_output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.14\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R= 40*10^3;// in Ω\n",
+"C= 0.2*10^-6;// in F\n",
+"Vin= 5;// in V\n",
+"V1=3;// in V\n",
+"V2= V1;// in V\n",
+"Vout= V2;// in V\n",
+"t= 0:0.1:50;// in ms\n",
+"Vout= -1/(R*C)*integrate('Vin-V1','t',0,t)/10^3+Vout;// in volts\n",
+"plot(t,Vout);\n",
+"xlabel('Time in milliseconds')\n",
+"ylabel('Output voltage in volts')\n",
+"title('Vout Graph')\n",
+"disp('The Vout graph shown in figure')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15: Time_duration_for_saturation.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.15\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R = 500;// in k ohm\n",
+"R = R * 10^3;// in ohm\n",
+"C = 10;// in µF\n",
+"C = C * 10^-6;// in F\n",
+"V= -0.5;// in V\n",
+"Vout= 12;// in V\n",
+"// Vout= -1/RC*integrate('V*t','t',0,t)= -1/(R*C)*V*t\n",
+"t= Vout/(-1/(R*C)*V);// in sec\n",
+"disp(t,'Time duration required for saturation of output voltage in second is : ')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.16: Values_of_resistors.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.16\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"C_F = 10;// in µF\n",
+"C_F = C_F * 10^-6;// in F\n",
+"R1 = 1/C_F;// in ohm\n",
+"R1 = R1 * 10^-3;// in k ohm\n",
+"disp(R1,'The value of R1 in kΩ is');\n",
+"R2 = 1/(C_F*2);// in ohm\n",
+"R2 = R2 * 10^-3;// in k ohm\n",
+"disp(R2,'The value of R2 in kΩ is');\n",
+"R3 = 1/(C_F*5);// in ohm\n",
+"R3 = R3 * 10^-3;;// in k ohm\n",
+"disp(R3,'The value of R3 in kΩ is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.17: Practical_differentiator_circuit.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.17\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"f_max = 150;// in Hz\n",
+"f_a = f_max;// in Hz\n",
+"disp(f_a,'The value of f_a in Hz is : ')\n",
+"C1 = 1;// in µF\n",
+"C1 = C1 * 10^-6;// in F\n",
+"R_F = 1/(2*%pi*f_a*C1);// in ohm\n",
+"disp(R_F*10^-3,'The value of R_F in kΩ is');\n",
+"f_b = 10*f_a;// in Hz\n",
+"R1 = 1/(2*%pi*f_b*C1);// in ohm\n",
+"C_F = (R1*C1)/R_F;// in F\n",
+"disp(C_F*10^6,'The value of C_F in µF is');\n",
+"R_comp = (R1*R_F)/(R1+(R_F));// in ohm\n",
+"disp(R_comp,'The value of R_comp in Ω is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.18: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.18\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"Vmax= 10;// in µV\n",
+"f= 2*10^3;// in kHz\n",
+"//Vin= Vmax*sin(2*%pi*f*t);// in µV\n",
+"disp('The input voltage is '+string(Vmax)+'*sin ('+string(2*f)+'%pi*t) µV')\n",
+""
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.19: Values_of_ROM_and_Vout.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.19\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"Vp= 1.5;// in V\n",
+"f= 200;// in Hz\n",
+"f_a= 1*10^3;// in Hz\n",
+"C= 0.1*10^-6;// in F\n",
+"// Formula f_a= 1/(2*%pi*f_a*C)\n",
+"R= 1/(2*%pi*f_a*C);// in ohm\n",
+"R= 1.5;// in kΩ (standard value)\n",
+"f_b= 20*f_a;// in Hz\n",
+"// Formula f_b= 1/(2*%pi*R_desh*C)\n",
+"R_desh= 1/(2*%pi*f_b*C);// in ohm\n",
+"R_desh= 82;// in ohm (standard value)\n",
+"R_OM= R;// in kohm\n",
+"disp(R_OM,'The value of R_OM in kΩ is : ')\n",
+"omega= 2*%pi*f;// in radian\n",
+"// Vin= Vp*sin(omega*t) and Vout= -R*C*dv_in/dt\n",
+"// Vout= -R*C*Vp*omega*cos(400*%pi*t)\n",
+"V= -R*10^3*C*Vp*omega;// (assumed)\n",
+"//Vout= V*cos(400*%pi*t)\n",
+"disp('Output voltage is '+string(V)+' *cos(400*%pi*t) volts')\n",
+"disp('Output voltage waveforms shown in figure')\n",
+"x= -%pi/2:0.1:2*%pi;\n",
+"plot(x,V*cos(x));\n",
+"title('Output Voltage waveforms')\n",
+"xlabel('Time')\n",
+"ylabel('Vout')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.1\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R1= 1;// in kΩ\n",
+"R2= 1;// in kΩ\n",
+"R3= 1;// in kΩ\n",
+"RF= 1;// in kΩ\n",
+"Vin1= 2;// in volt\n",
+"Vin2= 1;// in volt\n",
+"Vin3= 4;// in volt\n",
+"Vout= -(RF/R1*Vin1+RF/R2*Vin2+RF/R3*Vin3)\n",
+"disp(Vout,'The output voltage in volts is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.20: Range_of_gain.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.20\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R2 = 100;// in ohm\n",
+"R1 = 200;// in ohm\n",
+"R_F = 100;// in k ohm\n",
+"R_F = R_F * 10^3;// in ohm\n",
+"R_G = 100;// in ohm\n",
+"Gain_max = ( 1+((2*R_F)/R_G) ) * (R2/R1);\n",
+"R = 100;// in k ohm\n",
+"R_G1 = 0.01+R;// in k ohm\n",
+"R_G1 = R_G1 * 10^3;// in ohm\n",
+"Gain_min = ( 1+((2*R_F)/R_G1) ) * (R2/R1);\n",
+"disp('The gain can be varied from '+string(Gain_min)+' to '+string(Gain_max))"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.21: Value_of_RG.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// EXa 4.21\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R1 = 100;// in k ohm\n",
+"R2 = 100;// in k ohm\n",
+"R_F = 470;// in k ohm\n",
+"Gain = 100;\n",
+"R_G = (2*R_F)/(Gain-1);// in ohm\n",
+"disp(R_G,'The value of R_G in ohm is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.22: Transconductance_resistance.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.22\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R = 100;// in ohm\n",
+"T = 25;// in degree C\n",
+"alpha = 0.00392;\n",
+"R1 = R*(1+(alpha*T));// in ohm\n",
+"expression= 'R_T= Ro*[1+alpha*T]';\n",
+"disp(expression,'The expression for the resistance at T°C is : ')\n",
+"disp(R1,'The transducer resistance at 25°C in Ω is');\n",
+"T = 100;// in degree C\n",
+"R2 = R*(1+(alpha*T));// in ohm\n",
+"disp(R2,'The transducer resistance at 100°C in Ω is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.23: Instrumentation_amplifier.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.23\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R3 = 1;// in k ohm\n",
+"R4 = 1;// in k ohm\n",
+"R_min = R4/R3;\n",
+"R_4 = 50;// in k ohm\n",
+"R_max = (R_4+R4)/R3;\n",
+"R2 = 10;// in k ohm\n",
+"A_F = 5;\n",
+"R1 = (((A_F/R_min)-1)*R2)/2;// in k ohm\n",
+"disp(R1,'The value of R1 in kΩ is');\n",
+"disp(R2,'The value of R2 in kΩ is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.24: Expression_for_output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.24\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R1= 100;// in kΩ\n",
+"R2=200;// in kΩ\n",
+"R3= 20;// in kΩ\n",
+"R4=40;// in kΩ\n",
+"//Vout= [1+R2/R1]*[R4/(R3+R4)]*Vin1-R2/R1*Vin2\n",
+"A=[1+R2/R1]*[R4/(R3+R4)];// (assumed)\n",
+"disp('Output voltage is '+string(A)+'*(Vin1-Vin2)')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.25: Gain_of_instrumentation_amplifier.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.25\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R_F = 5;// in k ohm\n",
+"R_G = 1;// in k ohm\n",
+"R1 = 10;// in k ohm\n",
+"R2 = 20;// in k ohm\n",
+"A = (1 + ((2*R_F)/R_G))*(R2/R1);\n",
+"disp(A,'The gain of instrumentaion amplifier is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.27: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// EXa 4.27\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R_F = 10;// in k ohm\n",
+"R_G = 5;// in k ohm\n",
+"R1 = 1;// in k ohm\n",
+"R2 = 2;// in k ohm\n",
+"A = (1+ ((2*R_F)/R_G))*(R2/R1);\n",
+"V_in2 = 2;// in mV\n",
+"V_in1 = 1;// in mV\n",
+"V_out = A*(V_in2-V_in1);// in mV\n",
+"disp(V_out,'The output voltage in mV is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.28: Value_of_RG.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"// Exa 4.28\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"V_out = 3;// in V\n",
+"V_in2 = 5;// in mV\n",
+"V_in1 = 2;// in mV\n",
+"V1 = V_in2-V_in1;// in mV\n",
+"V1 = V1 * 10^-3;// in V\n",
+"A = V_out/V1;\n",
+"R_F = 15;// in k ohm\n",
+"R1 = 1;// in k ohm\n",
+"R2 = 2;// in k ohm\n",
+"R = R2/R1;// in k ohm\n",
+"R_G = (2*R_F)/((A/R)-1);//in k ohm\n",
+"R_G = R_G * 10^3;// in ohm\n",
+"disp(R_G,'The value of R_G in Ω is');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.2: Design_an_adder_circuit.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.2\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"RF= 100;// in kΩ\n",
+"Vout= '-(V1+10*V2+100*V3)';// given expression\n",
+"// Vout= -(RF/R1*V1+RF/R2*V2+RF/R3*V3)\n",
+"// Comparing the Vout with the given expression\n",
+"R1= RF;// in kΩ\n",
+"R2= RF/10;// in kΩ\n",
+"R3= RF/100;// in kΩ\n",
+"disp(R1,'The value of R1 in kΩ is : ');\n",
+"disp(R2,'The value of R2 in kΩ is : ');\n",
+"disp(R3,'The value of R3 in kΩ is : ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.31: Three_op_amp_instrumentation_amplifier.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.31\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"A=10000;\n",
+"R1= 100;// in kΩ\n",
+"A2= 1/5;// (assumed value)\n",
+"R2= R1/A2;// in kΩ\n",
+"// A= A1*A2 and A1= 1+2*RF/R_GB\n",
+"RFbyR_GB= (A/A2-1)/2;\n",
+"// [1+2*RF/RG]*A2= 1 and RG= RGB+100 kΩ\n",
+"R_G= (1-1/A2)/2*100/[(1/A2-1)/2-RFbyR_GB];// in kΩ\n",
+"R_F= RFbyR_GB*R_G;// in kΩ\n",
+"disp(R_F,'The value of R_F in kΩ is : ')\n",
+"disp(R_G*10^3,'The value of R_G in Ω is : ')\n",
+"disp('This is the base resistance required in series with the pot of 100 kΩ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.3\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R1= 12;// in kΩ\n",
+"R2= 2;// in kΩ\n",
+"R3= 3;// in kΩ\n",
+"RF= 12;// in kΩ\n",
+"V1= 9;// in volt\n",
+"V2= -3;// in volt\n",
+"V3= -1;// in volt\n",
+"Vout= -(RF/R1*V1+RF/R2*V2+RF/R3*V3)\n",
+"disp(Vout,'The output voltage in volts is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4: Summing_amplifier.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.4\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"RF= 6;// in kΩ\n",
+"Vout= '-V1+2*V2-3*V3';// given expression or\n",
+"Vout= '-(V1-2*V2+3*V3)';\n",
+"// Vout= -(RF/R1*V1+RF/R2*V2+RF/R3*V3)\n",
+"// Comparing the Vout with the given expression\n",
+"R1= RF;// in kΩ\n",
+"R2= RF/2;// in kΩ\n",
+"R3= RF/3;// in kΩ\n",
+"disp(R1,'The value of R1 in kΩ is : ');\n",
+"disp(R2,'The value of R2 in kΩ is : ');\n",
+"disp(R3,'The value of R3 in kΩ is : ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5: Values_of_resistances.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.5\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R3= 10;// in kΩ\n",
+"Vout= '-2*V1+3*V2+4*V3';// given expression or\n",
+"Vout= '-(2*V1-3*V2-4*V3)';\n",
+"// Vout= -(RF/R1*V1+RF/R2*V2+RF/R3*V3)\n",
+"// Comparing the Vout with the given expression, we get\n",
+"RF= 4*R3;// in kΩ\n",
+"R2= RF/3;// in kΩ\n",
+"R1= RF/2;// in kΩ\n",
+"disp(RF,'The value of RF in kΩ is : ');\n",
+"disp(R2,'The value of R2 in kΩ is : ');\n",
+"disp(R1,'The value of R1 in kΩ is : ');"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6: Output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.6\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"V1= 2;// in V\n",
+"V2= -1;// in V\n",
+"R=10;// assuming value in kΩ\n",
+"R1=R;// in kΩ\n",
+"R2= R;// in kΩ\n",
+"R3= R;// in kΩ\n",
+"R4= R;// in kΩ\n",
+"RF= 2*R;// in kΩ\n",
+"Vin1= V1*(R1*R2/(R1+R2))/(R1+(R2*R3/(R2+R3)));// in V\n",
+"Vout1= Vin1*(1+RF/R1);// in V\n",
+"Vin2= V2*(R3*R4/(R3+R4))/(R2+(R3*R4/(R3+R4)));// in V\n",
+"Vout2= Vin2*(1+RF/R2);// in V\n",
+"Vout= Vout1+Vout2;// in V\n",
+"disp(Vout,'The output voltage in volts is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.7: Limiting_frequency.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.7\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"R1= 10;// in kΩ\n",
+"CF= 0.1;// in micro F\n",
+"CF= CF*10^-6;// in F\n",
+"RF= 10*R1;// in kΩ\n",
+"RF= RF*10^3;// in Ω\n",
+"fa= 1/(2*%pi*RF*CF);// in Hz\n",
+"disp(fa,'Limiting frequency in Hz is : ')"
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8: Practical_integrator_circuit.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.8\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"f=10;// in kHz\n",
+"f=f*10^3;// in Hz\n",
+"dcGain= 10;\n",
+"fa= f/10;// in Hz\n",
+"R1= 10;// in kΩ\n",
+"// Formula dcGain= RF/R1\n",
+"RF= R1*dcGain;// in kΩ\n",
+"RF=RF*10^3;// in Ω\n",
+"R1= R1*10^3;// in Ω\n",
+"// Formula fa= 1/(2*%pi*RF*CF)\n",
+"CF= 1/(2*%pi*RF*fa);// in F\n",
+"CF=CF*10^9;// in nF\n",
+"Rcomp= R1*RF/(R1+RF);// in Ω\n",
+"disp(CF,'The value of CF in nF is : ')\n",
+"disp(Rcomp*10^-3,'The value of Rcomp in kΩ is : ');\n",
+"\n",
+"// Note: There is calculation error in evaluating the value of CF in the book. So The value of CF in the book is wrong."
+ ]
+ }
+,
+{
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.9: Maximum_change_in_output_voltage.sce"
+ ]
+ },
+ {
+"cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+"source": [
+"//Exa 4.9\n",
+"clc;\n",
+"clear;\n",
+"close;\n",
+"// Given data\n",
+"Vin=5;// in V\n",
+"R1= 1;// in kΩ\n",
+"R1= R1*10^3;// in Ω\n",
+"CF= 0.1;// in µF\n",
+"CF= CF*10^-6;// in F\n",
+"f= 1;// in kHz\n",
+"f= f *10^3;// in Hz\n",
+"T= 1/f;// in sec\n",
+"delta_Vout= Vin*T/(2*R1*CF);// in V\n",
+"disp(delta_Vout,'The maximum change in output voltage in volts is : ')\n",
+"S= 2*%pi*f*Vin;// in V/sec\n",
+"disp(S*10^-6,'The minimum slew rate required in V/micro-sec is : ')"
+ ]
+ }
+],
+"metadata": {
+ "kernelspec": {
+ "display_name": "Scilab",
+ "language": "scilab",
+ "name": "scilab"
+ },
+ "language_info": {
+ "file_extension": ".sce",
+ "help_links": [
+ {
+ "text": "MetaKernel Magics",
+ "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md"
+ }
+ ],
+ "mimetype": "text/x-octave",
+ "name": "scilab",
+ "version": "0.7.1"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}