From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 135/CH2/EX2.1/EX1.sce | 26 ++++++++++++++++++++++++++ 135/CH2/EX2.11/EX11.sce | 35 +++++++++++++++++++++++++++++++++++ 135/CH2/EX2.12/EX12.sce | 28 ++++++++++++++++++++++++++++ 135/CH2/EX2.13/EX13.sce | 9 +++++++++ 135/CH2/EX2.14/EX14.sce | 20 ++++++++++++++++++++ 135/CH2/EX2.18/EX18.sce | 10 ++++++++++ 135/CH2/EX2.19/EX19.sce | 21 +++++++++++++++++++++ 135/CH2/EX2.2/EX2.sce | 13 +++++++++++++ 135/CH2/EX2.3/EX3.sce | 33 +++++++++++++++++++++++++++++++++ 135/CH2/EX2.4/EX4.sce | 24 ++++++++++++++++++++++++ 135/CH2/EX2.5/EX5.sce | 14 ++++++++++++++ 135/CH2/EX2.6/EX6.sce | 12 ++++++++++++ 135/CH2/EX2.7/EX7.sce | 14 ++++++++++++++ 135/CH2/EX2.8/EX8.sce | 23 +++++++++++++++++++++++ 135/CH2/EX2.9/EX9.sce | 29 +++++++++++++++++++++++++++++ 15 files changed, 311 insertions(+) create mode 100755 135/CH2/EX2.1/EX1.sce create mode 100755 135/CH2/EX2.11/EX11.sce create mode 100755 135/CH2/EX2.12/EX12.sce create mode 100755 135/CH2/EX2.13/EX13.sce create mode 100755 135/CH2/EX2.14/EX14.sce create mode 100755 135/CH2/EX2.18/EX18.sce create mode 100755 135/CH2/EX2.19/EX19.sce create mode 100755 135/CH2/EX2.2/EX2.sce create mode 100755 135/CH2/EX2.3/EX3.sce create mode 100755 135/CH2/EX2.4/EX4.sce create mode 100755 135/CH2/EX2.5/EX5.sce create mode 100755 135/CH2/EX2.6/EX6.sce create mode 100755 135/CH2/EX2.7/EX7.sce create mode 100755 135/CH2/EX2.8/EX8.sce create mode 100755 135/CH2/EX2.9/EX9.sce (limited to '135/CH2') diff --git a/135/CH2/EX2.1/EX1.sce b/135/CH2/EX2.1/EX1.sce new file mode 100755 index 000000000..4432eba66 --- /dev/null +++ b/135/CH2/EX2.1/EX1.sce @@ -0,0 +1,26 @@ +// Example 2.1: (a) I,Vo +// (b) I,Vo +clc, clear + +disp("Part (a)"); +// Applying Thevnin's theorem at XX', in Fig. 2.5(a) +Vth=15*20e3/(10e3+20e3); // Thevnin equivalent voltage in volts +Zth=10e3*20e3/(10e3+20e3); // Thevnin equivalent resistance in ohms +// From the figure 2.5(c) +I=Vth/(Zth+20e3); // Labelled current in amperes +Vo=I*20e3; // Labelled voltage in volts +I=I*1e3; // Labelled current in miliamperes +disp(I,"Labelled current I (mA) = "); +disp(Vo,"Labelled voltage Vo (V) = "); + +disp("Part (b)"); +// Applying Thevnin's theorem at XX' and YY', in Fig. 2.5(b) +Vth1=15*10e3/(10e3+10e3); // Thevnin equivalent voltage at XX' in volts +Zth1=10e3*10e3/(10e3+10e3); // Thevnin equivalent resistance at YY' in ohms +Vth2=5; // Thevnin equivalent voltage at YY' in volts +Zth2=5e3; // Thevnin equivalent resistance at YY' in ohms +// From the figure 2.5(d) +I=0; // Labelled current in amperes +Vo=5-7.5; // Labelled voltage in volts +disp(I,"Labelled current I = "); +disp(Vo,"Labelled voltage Vo (V) = "); \ No newline at end of file diff --git a/135/CH2/EX2.11/EX11.sce b/135/CH2/EX2.11/EX11.sce new file mode 100755 index 000000000..bd7b1e556 --- /dev/null +++ b/135/CH2/EX2.11/EX11.sce @@ -0,0 +1,35 @@ +// Example 2.11 (a) Alternating component of voltage acroos load resistance +// (b) Total voltage across load resistance +// (c) Total current +clc, clear +T=293; // Operating temperature in kelvins +VT=T/11600; // Voltage equivalent to temperatue at room temperature in volts +// In the Fig. 2.21(a) +VAA=9; // in volts +Vm=0.2; // in volts +RL=2e3; // Load resistance in ohms +Vy=0.6; // Cut-in voltage in volts +Rf=10; // Forward resistance of diode in ohms +eta=2; + +disp("Part (a)") +// From DC model in Fig. 2.21(b) +IDQ=(VAA-Vy)/(RL+Rf); // DC current through diode or load resistance in amperes +rd=eta*VT/IDQ; // Dynamic resistance in ohms +// This dynamic resistance is used in AC model in Fig. 2.21(c) +Vom=Vm*RL/(RL+rd); // Amplitude of alternating component of the voltage across load resistance in volts +disp(Vom,"Amplitude of alternating component of the voltage across load resistance (V) ="); +disp("Therefore, the alternating component of the voltage across load resistance is 0.199 sin ωt V"); + +disp("Part (b)"); +VDQ=IDQ*RL; // DC component of voltage across load resistance in volts +disp(VDQ,"DC component of voltage across load resistance (V) ="); +disp("Therefore, total voltage across load resistance is (8.36 + 0.199 sin ωt) V"); + +disp("Part (C)"); +IDQ=IDQ*1e3; // DC current through load resistance in miliamperes +idm=Vm/(RL+rd); // Amplitude of alternating component of the current across load resistance in amperes +idm=idm*1e3; // Amplitude of alternating component of the current across load resistance in miliamperes +disp(IDQ,"DC component of current across load resistance (mA) ="); +disp(idm,"Amplitude of alternating component of the current across load resistance (mA) ="); +disp("Therefore, total current across load resistance is (4.18 + 0.099 sin ωt) mA"); \ No newline at end of file diff --git a/135/CH2/EX2.12/EX12.sce b/135/CH2/EX2.12/EX12.sce new file mode 100755 index 000000000..7ea2f17b3 --- /dev/null +++ b/135/CH2/EX2.12/EX12.sce @@ -0,0 +1,28 @@ +//Example 2.12: (b) Vo +// (c) I +clc, clear + +disp("Part (b)"); +// In the Fig. 2.22 (a) +vs=10e-3; // in volts +Rs=1e3; // in ohms +eta=2; +VT=25e-3; // Voltage equivalent to temperatue at room temperature in volts +I=1e-3; // in amperes +Vo=vs*eta*VT/(eta*VT+I*Rs); // in volts +Vo=Vo*1e3; // in milivolts +disp(Vo,"Vo for I= 1 mA (mV) ="); +I=0.1e-3; // in amperes +Vo=vs*eta*VT/(eta*VT+I*Rs); // in volts +Vo=Vo*1e3; // in milivolts +disp(Vo,"Vo for I= 0.1 mA (mV) ="); +I=1e-6; // in amperes +Vo=vs*eta*VT/(eta*VT+I*Rs); // in volts +Vo=Vo*1e3; // in milivolts +disp(Vo,"Vo for I= 1 μA (mV) ="); + +disp("Part (c)"); +Vo=vs/2; // in volts +I=eta*VT*(vs-Vo)/(Vo*Rs); // in amperes +I=I*1e6; // in micro-amperes +disp(I,"I (μA) ="); \ No newline at end of file diff --git a/135/CH2/EX2.13/EX13.sce b/135/CH2/EX2.13/EX13.sce new file mode 100755 index 000000000..99eee91f9 --- /dev/null +++ b/135/CH2/EX2.13/EX13.sce @@ -0,0 +1,9 @@ +// Example 2.13: Barrier capacitance +clc, clear +A=1e-3*1e-3; // Area of p-n junction in metres square +W=2e-6; // Space charge thickness in metres +E=16; // Dielectric constant of Ge +Eo=1/(36*%pi*1e9); // Absolute permittivity of air +C=E*Eo*A/W; // Barrier capacitance in farads +C=C*1e12; // Barrier capacitance in pico-farads +disp(C,"Barrier capacitance (pF) ="); \ No newline at end of file diff --git a/135/CH2/EX2.14/EX14.sce b/135/CH2/EX2.14/EX14.sce new file mode 100755 index 000000000..ade81eeec --- /dev/null +++ b/135/CH2/EX2.14/EX14.sce @@ -0,0 +1,20 @@ +// Example 2.14: (a) Change in capacitance +// (b) Change in capacitance +clc, clear +C=4e-12; // Depletion capacitance in farads +V=4; // in volts +K=C*sqrt(V); // a constant + +disp("Part (a)"); +V=4+0.5; // in volts +C_new=K/sqrt(V); // in farads +deltaC=C_new-C; // Change in capacitande in farads +deltaC=deltaC*1e12; // Change in capacitande in pico-farads +disp(deltaC,"Change in capacitance (pF) ="); + +disp("Part (b)"); +V=4-0.5; // in volts +C_new=K/sqrt(V); // in farads +deltaC=C_new-C; // Change in capacitande in farads +deltaC=deltaC*1e12; // Change in capacitande in pico-farads +disp(deltaC,"Change in capacitance (pF) ="); \ No newline at end of file diff --git a/135/CH2/EX2.18/EX18.sce b/135/CH2/EX2.18/EX18.sce new file mode 100755 index 000000000..2a5e56cb6 --- /dev/null +++ b/135/CH2/EX2.18/EX18.sce @@ -0,0 +1,10 @@ +// Example 2.18: Diffusion length +clc, clear +I=1e-3; // Forward bias current in amperes +C=1e-6; // Diffusion capacitance in farads +Dp=13; // Diffusion constant for Si +eta=2; // for Si +VT=26e-3; // Voltage equivalent to temperatue at room temperature in volts +Lp=sqrt(C*Dp*eta*VT/I); // Diffusion length in metres +Lp=Lp*1e2; // Diffusion length in centimetres +disp(Lp,"Diffusion length (cm) ="); \ No newline at end of file diff --git a/135/CH2/EX2.19/EX19.sce b/135/CH2/EX2.19/EX19.sce new file mode 100755 index 000000000..97d0a5988 --- /dev/null +++ b/135/CH2/EX2.19/EX19.sce @@ -0,0 +1,21 @@ +// Example 2.19 (a) Vd1 and Vd2 +// (b) Current in the circuit +clc, clear +eta_VT=0.026; // Product of η and VT + +disp("Part (a)"); +// From the Fig. 2.19(a) +Is=5e-6; // Reverse saturation current through diode D2 in amperes +Id1=Is; // Forward current through diode D1 in amperes +Vd1=eta_VT*log(1+(Id1/Is)); // in volts +Vd2=5-Vd1; // in volts +disp(Vd1,"Vd1 (V) ="); +disp(Vd2,"Vd2 (V) ="); + +disp("Part (b)"); +// From the Fig. 2.19(b) +Vz=4.9; // Zener voltage in volts +Vd1=5-Vz; // in volts +I=Is*(%e^(Vd1/eta_VT)-1); // Current in the circuit in amperes +I=I*1e6; // Current in the circuit in micro-amperes +disp(I,"Current in the circuit (μA) ="); \ No newline at end of file diff --git a/135/CH2/EX2.2/EX2.sce b/135/CH2/EX2.2/EX2.sce new file mode 100755 index 000000000..ec101240e --- /dev/null +++ b/135/CH2/EX2.2/EX2.sce @@ -0,0 +1,13 @@ +// Example 2.2: Change in diode voltage +clc, clear +ID1=1; // Let the initial diode current be 1 A +ID2=15*ID1; // Final diode current +VT=25e-3; // Voltage equivalent to temperatue at room temperature in volts +eta=1; // for Ge +deltaVD=eta*VT*log(ID2/ID1); // Change in diode voltage in volts +deltaVD=deltaVD*1e3; // Change in diode voltage in milivolts +disp(deltaVD,"Change in diode voltage (for Ge) (mV) = "); +eta=2; // for Si +deltaVD=eta*VT*log(ID2/ID1); // Change in diode voltage in volts +deltaVD=deltaVD*1e3; // Change in diode voltage in milivolts +disp(deltaVD,"Change in diode voltage (for Si) (mV) = "); \ No newline at end of file diff --git a/135/CH2/EX2.3/EX3.sce b/135/CH2/EX2.3/EX3.sce new file mode 100755 index 000000000..e75846455 --- /dev/null +++ b/135/CH2/EX2.3/EX3.sce @@ -0,0 +1,33 @@ +// Example 2.3: (a) Voltage +// (b) Ratio of current in forward bias to that in reverse bias +// (c) Forward current +clc, clear + +disp("Part (a)"); +eta=1; // for Ge +T=300; // Room temperature in kelvins +VT=T/11600; // Voltage equivalent to temperatue at room temperature in volts +IS=1; // Let reverse saturation current be 1 A +I=-0.9*IS; // Reverse current +V=eta*VT*log(1+(I/IS)); // Voltagei in volts +V=V*1e3; // Voltage in milivolts +disp(V,"Voltage (mV) = "); + +disp("Part (b)"); +V=0.05; // Voltage in volts +If_Ir=(%e^(V/(eta*VT))-1)/(%e^(-V/(eta*VT))-1); // Ratio of current in forward bias to that in reverse bias +disp(If_Ir,"Ratio of current in forward bias to that in reverse bias = "); + +disp("Part (c)"); +IS=10e-6; // Reverse saturation current in amperes +V=0.1; // Voltage in volts +ID=IS*(%e^(V/(eta*VT))-1); // Forward current for 0.1 V in amperes +ID=ID*1e6; // Forward current for 0.1 V in micro-amperes +disp(ID,"Forward current for 0.1 V (μA) = "); +V=0.2; // Voltage in volts +ID=IS*(%e^(V/(eta*VT))-1); // Forward current for 0.1 V in amperes +ID=ID*1e3; // Forward current for 0.1 V in miliamperes +disp(ID,"Forward current for 0.1 V (mA) = "); +V=0.3; // Voltage in volts +ID=IS*(%e^(V/(eta*VT))-1); // Forward current for 0.1 V in amperes +disp(ID,"Forward current for 0.1 V (A) = "); \ No newline at end of file diff --git a/135/CH2/EX2.4/EX4.sce b/135/CH2/EX2.4/EX4.sce new file mode 100755 index 000000000..198f83e2c --- /dev/null +++ b/135/CH2/EX2.4/EX4.sce @@ -0,0 +1,24 @@ +// Example 2.4 (a) Current +// (b) Current +// (C) Current +clc, clear +IS=10e-6; // Reverse saturation current in amperes +eta=1; // for Ge +VT=25e-3; // Voltage equivalent to temperatue at room temperature in volts + +disp("Part (a)"); +VD=-24; // Reverse bias in volts +ID=IS*(%e^(VD/(eta*VT))-1); // Current in amperes +ID=ID*1e6; // Current in micro-amperes +disp(ID,"Current (μA) = "); + +disp("Part (b)"); +VD=-0.02; // Reverse bias in volts +ID=IS*(%e^(VD/(eta*VT))-1); // Current in amperes +ID=ID*1e6; // Current in micro-amperes +disp(ID,"Current (μA) = "); + +disp("Part (c)"); +VD=0.3; // Forward bias in volts +ID=IS*(%e^(VD/(eta*VT))-1); // Current in amperes +disp(ID,"Current (A) = "); \ No newline at end of file diff --git a/135/CH2/EX2.5/EX5.sce b/135/CH2/EX2.5/EX5.sce new file mode 100755 index 000000000..014068f15 --- /dev/null +++ b/135/CH2/EX2.5/EX5.sce @@ -0,0 +1,14 @@ +// Example 2.2: Change in diode voltage +clc, clear +T=300; // Operating temperature in kelvins +VT=T/11600; // Voltage equivalent to temperatue at room temperature in volts +ID1=1; // Let the initial diode current be 1 A +ID2=10*ID1; // Final diode current +eta=1; // for Ge +deltaVD=eta*VT*log(ID2/ID1); // Change in diode voltage in volts +deltaVD=deltaVD*1e3; // Change in diode voltage in milivolts +disp(deltaVD,"Change in diode voltage (for Ge) (mV) = "); +eta=2; // for Si +deltaVD=eta*VT*log(ID2/ID1); // Change in diode voltage in volts +deltaVD=deltaVD*1e3; // Change in diode voltage in milivolts +disp(deltaVD,"Change in diode voltage (for Si) (mV) = "); \ No newline at end of file diff --git a/135/CH2/EX2.6/EX6.sce b/135/CH2/EX2.6/EX6.sce new file mode 100755 index 000000000..2c674eef8 --- /dev/null +++ b/135/CH2/EX2.6/EX6.sce @@ -0,0 +1,12 @@ +// Example 2.6: R +clc, clear +// In the circuit given in Fig. 2.7 +V=50e-3; // Output voltage +VD1=0.7; // Voltage across diode 1 in volts +I1=10e-3; // Current through diode 1 at 0.7 V in amperes +VD2=0.8; // Voltage across diode 2 in volts +I2=100e-3; // Current through diode 2 at 0.8 V in amperes +eta_VT=(VD2-VD1)/log(I2/I1); // Product of η and VT +I=10e-3/(%e^(V/eta_VT)+1); // Current through diode 1 in amperes +R=V/I; +disp(R,"R (Ω) = "); \ No newline at end of file diff --git a/135/CH2/EX2.7/EX7.sce b/135/CH2/EX2.7/EX7.sce new file mode 100755 index 000000000..ea6ac1f4f --- /dev/null +++ b/135/CH2/EX2.7/EX7.sce @@ -0,0 +1,14 @@ +// Example 2.7: Current, Diode voltage +clc, clear +VDD=5; // Applied voltage in volts +VD=0.7; // Diode voltage in volts +I1=1e-3; // Current in amperes at diode voltage = 0.7 V +R=1000; // R in ohms +deltaVD=0.1; // Change in diode voltage in volts for every decade change in current +ratioI=10; // Decade change in current +eta_VT=deltaVD/log(ratioI); // Product of η and VT +ID=(VDD-VD)/R; // Diode current in amperes +VD2=VD+eta_VT*log(ID/I1); // Diode voltage in volts +ID=ID*1e3; // Diode current in miliamperes +disp(ID,"Diode current (mA) = "); +disp(VD2,"Diode voltage (v) = "); \ No newline at end of file diff --git a/135/CH2/EX2.8/EX8.sce b/135/CH2/EX2.8/EX8.sce new file mode 100755 index 000000000..c3338ffcb --- /dev/null +++ b/135/CH2/EX2.8/EX8.sce @@ -0,0 +1,23 @@ +// Example 2.8: (a) Output voltage +// (b) Output voltage +// (c) Output voltage +clc, clear + +disp("Part (a)"); +// Since both the diodes are in OFF state +Vo=5; // Output voltage in volts +disp(Vo,"Output voltage (V) = "); + +disp("Part (b)"); +//Since diode D1 is in OFF state and diode D2 is in ON state +// From Fig. 2.16(C) +I=(5-0.6)/(4.7e3+300); // Current flowing through the diode D2 in amperes +Vo=5-I*4.7e3; // Output voltage in volts +disp(Vo,"Output voltage (V) = "); + +disp("Part (c)"); +// Since both diodes are in ON state +// Applying KVL in Fig. 2.16(d) +I=(5-0.6)/(2*4.7e3+300); // Current flowing through diode D1 or diode D2 in amperes +Vo=5-2*I*4.7e3; // Output voltage in volts +disp(Vo,"Output voltage (V) = "); \ No newline at end of file diff --git a/135/CH2/EX2.9/EX9.sce b/135/CH2/EX2.9/EX9.sce new file mode 100755 index 000000000..720dfd87f --- /dev/null +++ b/135/CH2/EX2.9/EX9.sce @@ -0,0 +1,29 @@ +// Example 2.9 (a) Output voltage, Diode currents +// (b) Output voltage, Diode currents +clc, clear +Vy=0.7; // Cut-in voltage in volts +// In the Fig. 2.17 +R1=5e3; +R2=10e3; + +disp("Part (a)"); +// Since diode D1 is OFF and diode D2 is ON +ID2=(5-Vy-(-5))/(R1+R2); // Current through diode D2 in amperes +Vo=5-ID2*R1; // Output voltage +ID2=ID2*1e3; // Current through diode D2 in miliamperes +disp(Vo,"Output voltage (V) ="); +disp(0,"Current through diode D1 ="); +disp(ID2,"Current through diode D2 (mA) ="); + +disp("Part (b)"); +// Since both the diodes are ON +VA=4-Vy; // In the fig. +Vo=VA+Vy; // Output voltage +ID2=(5-Vo)/R1; // Current through diode D2 in amperes +IR2=(VA-(-5))/R2; // Current through diode R2 in amperes +ID1=IR2-ID2; // Current through diode D1 in amperes +ID1=ID1*1e3; // Current through diode D1 in miliamperes +ID2=ID2*1e3; // Current through diode D2 in miliamperes +disp(Vo,"Output voltage (V) ="); +disp(ID1,"Current through diode D1 (mA) ="); +disp(ID2,"Current through diode D2 (mA) ="); \ No newline at end of file -- cgit