diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /275 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '275')
225 files changed, 4800 insertions, 0 deletions
diff --git a/275/CH1/EX1.1.11/Ch1_1_11.sce b/275/CH1/EX1.1.11/Ch1_1_11.sce new file mode 100755 index 000000000..1fa3f5981 --- /dev/null +++ b/275/CH1/EX1.1.11/Ch1_1_11.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 1.11")
+printf("\n")
+disp("findout resistance and cut in voltage")
+printf("Given\n")
+disp("forward current=100mA,Vr=25V,cut in voltage=0.7v,reverse current=100nA")
+//all the values are from fig 1.10
+Vf=0.35
+If=80*10^-3 //forward current
+Vr=40
+Ir=10^-6 //reverse current
+Rf=Vf/If
+Rr=Vr/Ir
+printf("static forward resistance=\n%f ohm\n",Rf)
+printf("static reverse resistance=\n%f ohm\n",Rr)
+//from the characteristic curve we can find cut in voltage
+printf("cut in voltage= 0.3V")
diff --git a/275/CH1/EX1.1.20/Ch1_1_20.sce b/275/CH1/EX1.1.20/Ch1_1_20.sce new file mode 100755 index 000000000..a0debd134 --- /dev/null +++ b/275/CH1/EX1.1.20/Ch1_1_20.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 1.20")
+printf("\n")
+disp("calculate dynamic and substrate resistance")
+printf("Given\n")
+disp("forward current=20mA,cut in voltage=0.33v")
+If=20*10^-3
+Vf=0.33
+Rf=Vf/If
+If1=If-(10^-2) //min forward current
+If2=If+(10^-2) //max forward current
+Vf1=0.31
+Vf2=0.35
+rd=(Vf2-Vf1)/(If2-If1)
+rd1=0.026/If
+rsub=rd-rd1
+printf("static forward resistance=\n%f ohm\n",Rf)
+printf("Dynamic resistance=\n%f ohm\n",rd)
+printf("Dynamic resistance using forward current=\n%f ohm\n",rd1)
+printf("substrate resistance=\n%f ohm\n",rsub)
diff --git a/275/CH1/EX1.1.24/Ch1_1_24.sce b/275/CH1/EX1.1.24/Ch1_1_24.sce new file mode 100755 index 000000000..217e12ea8 --- /dev/null +++ b/275/CH1/EX1.1.24/Ch1_1_24.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.24")
+printf("\n")
+disp("calculate the current in the circuit in fig 1.18")
+//given
+V=12
+R1=10^3
+R2=2*10^3
+//current
+I=V/(R1+R2)
+printf("current in the circuit=%f Ampere",I)
diff --git a/275/CH1/EX1.1.25/Ch1_1_25.sce b/275/CH1/EX1.1.25/Ch1_1_25.sce new file mode 100755 index 000000000..fe9ad3cdc --- /dev/null +++ b/275/CH1/EX1.1.25/Ch1_1_25.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.25")
+printf("\n")
+disp("calculate the diode current")
+//given
+V=12
+R=10^3
+Vd=0.7
+//diode current
+I=(V-Vd)/R
+printf("Diode current=%f Ampere",I)
diff --git a/275/CH1/EX1.1.26/Ch1_1_26.sce b/275/CH1/EX1.1.26/Ch1_1_26.sce new file mode 100755 index 000000000..ce18fda74 --- /dev/null +++ b/275/CH1/EX1.1.26/Ch1_1_26.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 1.26")
+printf("\n")
+disp("calculate the diode current across 2 diodes")
+//given
+V=12
+Vd1=0.7
+Vd2=0.7
+R=10^3
+//current
+I=(V-(Vd1+Vd2))/R
+printf("Diode current =%f Ampere",I)
diff --git a/275/CH1/EX1.1.27/Ch1_1_27.sce b/275/CH1/EX1.1.27/Ch1_1_27.sce new file mode 100755 index 000000000..376aeb5e7 --- /dev/null +++ b/275/CH1/EX1.1.27/Ch1_1_27.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.27")
+printf("\n")
+disp("find the forward current in circuit of fig 1.22")
+//given
+V=9
+Vd=0.3
+R=3.3*10^3
+//current
+I=(V-Vd)/R
+printf("forward current=%f Ampere",I)
diff --git a/275/CH1/EX1.1.28/Ch1_1_28.sce b/275/CH1/EX1.1.28/Ch1_1_28.sce new file mode 100755 index 000000000..e7130a77a --- /dev/null +++ b/275/CH1/EX1.1.28/Ch1_1_28.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.28")
+printf("\n")
+disp("find out battery voltage")
+//given
+R=2.7*10^3
+Vd=0.7
+I=1.96*10^-3
+//battery voltage
+V=(I*R)+Vd
+printf("battery voltage=%f volt",V)
diff --git a/275/CH1/EX1.1.29/Ch1_1_29.sce b/275/CH1/EX1.1.29/Ch1_1_29.sce new file mode 100755 index 000000000..9f9b4ce1d --- /dev/null +++ b/275/CH1/EX1.1.29/Ch1_1_29.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.29")
+printf("\n")
+disp("find out series resistance")
+//given
+V=4.5
+Vd=0.3
+I=1.25*10^-3
+//series resistance
+R=(V-Vd)/I
+printf("series resistance=%f ohm",R)
diff --git a/275/CH1/EX1.1.31/Ch1_1_31.sce b/275/CH1/EX1.1.31/Ch1_1_31.sce new file mode 100755 index 000000000..5fc380b2a --- /dev/null +++ b/275/CH1/EX1.1.31/Ch1_1_31.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 1.31")
+printf("\n")
+disp("Plot the piecewise-linear characteristic of silicon diode")
+printf("Given\n")
+//given
+Vf=[0 0.7 0.74]
+If=[0 0 0.2]
+plot2d(Vf, If)
+xlabel("Vf")
+ylabel("If")
+xtitle("Piecewise-linear characteristic of diode")
diff --git a/275/CH1/EX1.1.31/Ch1_31.png b/275/CH1/EX1.1.31/Ch1_31.png Binary files differnew file mode 100755 index 000000000..ce975c5e0 --- /dev/null +++ b/275/CH1/EX1.1.31/Ch1_31.png diff --git a/275/CH1/EX1.1.32/Ch1_1_32.sce b/275/CH1/EX1.1.32/Ch1_1_32.sce new file mode 100755 index 000000000..ea112c9c7 --- /dev/null +++ b/275/CH1/EX1.1.32/Ch1_1_32.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 1.32")
+printf("\n")
+disp("Plot the piecewise-linear characterisic of Germanium diode")
+printf("Given\n")
+//given
+Vf=[0 0.3 0.35]
+If=[0 0 0.1]
+plot2d(Vf, If)
+xlabel("Vf")
+ylabel("If")
+xtitle("Piecewise-linear characteristic of diode")
\ No newline at end of file diff --git a/275/CH1/EX1.1.32/Ch1_32.png b/275/CH1/EX1.1.32/Ch1_32.png Binary files differnew file mode 100755 index 000000000..2efe096fb --- /dev/null +++ b/275/CH1/EX1.1.32/Ch1_32.png diff --git a/275/CH1/EX1.1.34/Ch1_1_34.sce b/275/CH1/EX1.1.34/Ch1_1_34.sce new file mode 100755 index 000000000..2984e3be1 --- /dev/null +++ b/275/CH1/EX1.1.34/Ch1_1_34.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 1.34")
+printf("\n")
+disp("find out diode current")
+//given
+V=2
+Vr=0.6
+rd1=0
+rd2=0.2
+R=14
+//when rd=0
+//diode current
+I1=(V-Vr)/R
+printf("Diode current when rd=0 is \n%f ampere\n",I1)
+//when rd=0.2
+//diode current
+I2=(V-Vr)/(R+rd2)
+printf("Diode current when rd=0.2 is \n%f ampere\n",I2)
diff --git a/275/CH1/EX1.1.35/Ch1_1_35.sce b/275/CH1/EX1.1.35/Ch1_1_35.sce new file mode 100755 index 000000000..e7498ceac --- /dev/null +++ b/275/CH1/EX1.1.35/Ch1_1_35.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.35")
+printf("\n")
+disp("find out series resistance in circuit fig 1.32")
+V=3
+rd=0.5
+Vr=0.3
+IF=174*10^-3
+//resistance
+R=(V-Vr-(IF*rd))/IF
+printf("The value of resistance is \n%f ohm\n",R)
diff --git a/275/CH1/EX1.1.48/Ch1_1_48.sce b/275/CH1/EX1.1.48/Ch1_1_48.sce new file mode 100755 index 000000000..11897c26b --- /dev/null +++ b/275/CH1/EX1.1.48/Ch1_1_48.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 1.48")
+printf("\n")
+disp("Find the maximum forward current")
+T1=25 //to find maximum forward current at this temperature
+T2=65 //to find maximum forward current at this temperature
+PT1=600*10^-3 //maximum power dissipation at 25c
+D=5*10^-3 //derating factor
+VT1=0.6 //forward voltage drop(constant at all temperature)
+VT2=VT1
+IT1=PT1/VT1 //maximum forward current at T1
+PT2=PT1-((T2-T1)*D)
+IT2=PT2/VT2 //maximum forward current at T2
+printf("Forward current at temperature T1=\n%f Ampere\n",IT1)
+printf("Forward current at temperature T2=\n%f Ampere\n",IT2)
diff --git a/275/CH1/EX1.1.49/Ch1_1_49.sce b/275/CH1/EX1.1.49/Ch1_1_49.sce new file mode 100755 index 000000000..e8cac0e16 --- /dev/null +++ b/275/CH1/EX1.1.49/Ch1_1_49.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 1.49")
+printf("\n")
+disp("find the maximum forward current at 25c and 80c")
+printf("Given\n")
+T1=25 //to find maximum forward current at this temperature
+T2=80 //to find maximum forward current at this temperature
+VT1=0.65 //forward voltage drop(constant at all temperature)
+VT2=VT1
+PT1=80*10^-3 //maximum power dissipation at 80c
+PT2=30*10^-3 //maximum power dissipation at 30c
+IT1=PT1/VT1
+IT2=PT2/VT2
+T=[0 25 80 114]
+P=[80 80 30 0]
+plot2d(T,P)
+xlabel("Temperature in c")
+ylabel("Power in mW")
+xtitle("Power-Temperature curve")
+printf("Forward current at T1=\n%f Ampere\n",IT1)
+printf("Forward current at T2=\n%f Ampere\n",IT2)
diff --git a/275/CH1/EX1.1.49/Ch1_49.png b/275/CH1/EX1.1.49/Ch1_49.png Binary files differnew file mode 100755 index 000000000..a0267a449 --- /dev/null +++ b/275/CH1/EX1.1.49/Ch1_49.png diff --git a/275/CH1/EX1.1.50/Ch1_1_50.sce b/275/CH1/EX1.1.50/Ch1_1_50.sce new file mode 100755 index 000000000..5fbbe9983 --- /dev/null +++ b/275/CH1/EX1.1.50/Ch1_1_50.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 1.50")
+printf("\n")
+disp("Find the maximum power at 80c")
+T1=25
+PT1=1000*10^-3 //maximum power dissipation at 25c
+T2=80
+D=4*10^-3 //derating factor
+PT2=PT1-((T2-T1)*D) //maximum power dissipation at 80c
+printf("Maximum Power dissipated at 80c=\n%f watt\n",PT2)
diff --git a/275/CH1/EX1.1.51/Ch1_1_51.sce b/275/CH1/EX1.1.51/Ch1_1_51.sce new file mode 100755 index 000000000..80ef1b188 --- /dev/null +++ b/275/CH1/EX1.1.51/Ch1_1_51.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 1.51")
+printf("\n")
+disp("Find the maximum forward current and Draw power spectrum curve")
+printf("Given\n")
+T1=25
+PT1=1000*10^-3 //maximum power dissipation at 25c
+//Average current
+IT1=500*10^-3
+IT2=IT1
+VT2=0.8 //forward voltage drop
+D=10^-2
+PT2=VT2*IT2
+T2=((PT1-PT2)/D)+T1
+//to caculate maximum forward current at 75c
+T2!=75
+PT2!=PT1-((T2!-T1)*D)
+IT2=PT2!/VT2
+//for(T>25), to draw graph
+ vd=10^-2
+ PT=(1000-(75*10))*10^-3 //maximum power dissipation at 100c
+Temp=[0 25 100 125]
+p=[1000 1000 PT*10^3 0]
+plot2d(Temp ,p)
+xlabel("Temperature in c")
+ylabel("Power in mW")
+xtitle("Power-Temperature Curve")
+printf("Maximum forward current at 75c=\n%f Ampere\n",IT2)
diff --git a/275/CH1/EX1.1.51/Ch1_51.png b/275/CH1/EX1.1.51/Ch1_51.png Binary files differnew file mode 100755 index 000000000..331c3cb68 --- /dev/null +++ b/275/CH1/EX1.1.51/Ch1_51.png diff --git a/275/CH1/EX1.1.54/Ch1_1_54.sce b/275/CH1/EX1.1.54/Ch1_1_54.sce new file mode 100755 index 000000000..c26281a95 --- /dev/null +++ b/275/CH1/EX1.1.54/Ch1_1_54.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 1.54")
+printf("\n")
+disp("Find the forward voltage drop at 100c and dynamic resistance")
+T1=25
+T2=100
+Vft1=0.6 //forward voltage drop at 25c
+IT1=26*10^-3 //forward current(constant)
+IT2=IT1
+//for silicon diode we know that
+v=(-1.8*10^-3)
+Vft2=Vft1+((T2-T1)*v)
+IF=26*10^-3
+rd1=(26*10^-3/IF)*((T1+273)/298)
+rd2=(26*10^-3/IF)*((T2+273)/298)
+printf("Forward voltage drop at 100c=\n%f volt\n",Vft2)
+printf("Dynamic resistance at 25c and 100c=\n%f ohm\n%f ohm\n",rd1,rd2)
diff --git a/275/CH1/EX1.1.55/Ch1_1_55.sce b/275/CH1/EX1.1.55/Ch1_1_55.sce new file mode 100755 index 000000000..405e26ed1 --- /dev/null +++ b/275/CH1/EX1.1.55/Ch1_1_55.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 1.55")
+printf("\n")
+disp("Calculate maximum & minimum forward voltage drop and Junction dynamic resistance")
+T1=80
+T2=10
+T=25
+//for germanium diode
+v=(-2.2*10^-3)
+Vft1=0.3
+Vft2maximum=Vft1+((T2-T)*v) //voltage drop at 10c
+Vft2minimum=Vft1+((T1-T)*v) //voltage drop at 80c
+IF=20*10^-3
+rd1=(26*10^-3/IF)*((T2+273)/298)
+rd2=(26*10^-3/IF)*((T1+273)/298)
+printf("Maximum and Minimum Forward voltage drop at 25c and 10c=\n%f volt\n%f volt\n",Vft2maximum,Vft2minimum)
+printf("Dynamic resistance at 10c and 80c=\n%f ohm\n%f ohm\n",rd1,rd2)
diff --git a/275/CH1/EX1.1.56/Ch1_1_56.sce b/275/CH1/EX1.1.56/Ch1_1_56.sce new file mode 100755 index 000000000..7556d6790 --- /dev/null +++ b/275/CH1/EX1.1.56/Ch1_1_56.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 1.56")
+printf("\n")
+disp("To find maximum forward current at 25c & 75c and Forward voltage drop and Dynamic resistance")
+PT1=1.5
+VT1=0.9
+D=7.5*10^-3
+//for silicon diodes
+v=(-1.8*10^-3)
+IF=20*10^-3
+T1=25
+T2=75
+IT1=PT1/VT1
+PT2=PT1-((T2-T1)*D)
+IT2=PT2/VT1 //assume voltage drop remains constant at all temperature
+VF2=VT1+((T2-T1)*v)
+rd1=(26*10^-3/IF)*((T1+273)/298)
+rd2=(26*10^-3/IF)*((T2+273)/298)
+printf("Maximum forward current at 25c & 75c =\n%f Ampere\n%f Ampere\n",IT1,IT2)
+printf("Forward voltage drop at 75c=\n%f volt\n",VF2)
+printf("Dynamic resistance at 25c and 75c=\n%f ohm\n%f ohm\n",rd1,rd2)
diff --git a/275/CH1/EX1.1.57/Ch1_1_57.sce b/275/CH1/EX1.1.57/Ch1_1_57.sce new file mode 100755 index 000000000..4f7e786db --- /dev/null +++ b/275/CH1/EX1.1.57/Ch1_1_57.sce @@ -0,0 +1,23 @@ +clc
+disp("Example 1.57")
+printf("\n")
+disp("To find diode current at 25c and 75c")
+RL=150
+//both diode voltage drop as given in fig 1.47
+Vr1=0.7 //for silicon
+Vr2=0.3 //for Germanium
+Vdc=5
+//apply KVL to given circuit
+IF1=(Vdc-(Vr1+Vr2))/RL
+//for silicon diode
+v=(-1.8*10^-3)
+T1=25
+T2=75
+VFT2=Vr1+((T2-T1)*v)
+//for Germanium Diode
+v=(-2.2*10^-3)
+VFT2!=Vr2+((T2-T1)*v)
+IF2=(Vdc-(VFT2!+VFT2))/RL
+printf("Diode current at 25c and 75c =\n%f ampere\n%f ampere\n",IF1,IF2)
+
+
diff --git a/275/CH1/EX1.1.65/Ch1_1_65.sce b/275/CH1/EX1.1.65/Ch1_1_65.sce new file mode 100755 index 000000000..ac20fba8c --- /dev/null +++ b/275/CH1/EX1.1.65/Ch1_1_65.sce @@ -0,0 +1,8 @@ +clc
+disp("Example 1.65")
+printf("\n")
+disp("Find the minimal fall-time")
+//reverse-recovery time is
+trr=4*10^-9
+tfmin=10*trr
+printf("The minimal fall-time for voltage pulses applied=\n%3.2e sec\n",tfmin)
diff --git a/275/CH1/EX1.1.66/Ch1_1_66.sce b/275/CH1/EX1.1.66/Ch1_1_66.sce new file mode 100755 index 000000000..cce24b083 --- /dev/null +++ b/275/CH1/EX1.1.66/Ch1_1_66.sce @@ -0,0 +1,8 @@ +clc
+disp("Example 1.66")
+printf("\n")
+disp("Find the maximum recovery time")
+//fall-time is
+tf=0.5*10^-6
+trrmax=tf/10
+printf("The minimal fall-time for voltage pulses applied=\n%3.2e sec\n",trrmax)
diff --git a/275/CH1/EX1.1.72/Ch1_1_72.sce b/275/CH1/EX1.1.72/Ch1_1_72.sce new file mode 100755 index 000000000..9b097eea6 --- /dev/null +++ b/275/CH1/EX1.1.72/Ch1_1_72.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 1.72")
+printf("\n")
+disp("Find the maximum current flow through Zener diode")
+Vz=7.5 //zener voltage
+Pd1=400*10^-3 //maximum power dissipation at 50c
+T1=50
+T2=100
+D=3.2*10^-3
+//current at 50c
+Izm1=Pd1/Vz
+//current at 100
+Pd2=Pd1-((T2-T1)*D)
+Izm2=Pd2/Vz
+printf("maximum current flow through Zener diode at 50c & 100c=\n%f Ampere\n%f Ampere\n",Izm1,Izm2)
diff --git a/275/CH1/EX1.1.75/Ch1_1_75.sce b/275/CH1/EX1.1.75/Ch1_1_75.sce new file mode 100755 index 000000000..81407610e --- /dev/null +++ b/275/CH1/EX1.1.75/Ch1_1_75.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 1.75")
+printf("\n")
+disp("Find the current through diode at 50c & 80c")
+T1=50
+T2=80
+D=3.2*10^-3
+Pd1=400*10^-3
+Vz=6.2
+//at 50c
+Izm1=Pd1/Vz
+//at 80c
+Pd2=Pd1-((T2-T1)*D)
+Izm2=Pd2/Vz
+printf("the current through diode at 50c & 80c=\n%f ampere\n%f ampere\n",Izm1,Izm2)
diff --git a/275/CH1/EX1.1.76/Ch1_1_76.sce b/275/CH1/EX1.1.76/Ch1_1_76.sce new file mode 100755 index 000000000..363fe647d --- /dev/null +++ b/275/CH1/EX1.1.76/Ch1_1_76.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 1.76")
+printf("\n")
+disp("Find the diode current and power dissipation")
+Vdc=12
+Vz=4.3 //zener voltage
+R=820
+Iz=(Vdc-Vz)/R
+Pd=Vz*Iz
+printf("the diode current=\n%f ampere\n",Iz)
+printf("the power dissipation=\n%f watt\n",Pd)
diff --git a/275/CH1/EX1.1.8/Ch1_1_8.sce b/275/CH1/EX1.1.8/Ch1_1_8.sce new file mode 100755 index 000000000..b5a17adb1 --- /dev/null +++ b/275/CH1/EX1.1.8/Ch1_1_8.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 1.8")
+printf("\n")
+disp("find out resistance")
+printf("Given\n")
+disp("forward current=100mA,Vr=25V,cut in voltage=0.7v,reverse current=100nA")
+//all the values are from fig 1.8
+Vf=0.7
+If=100*10^-3 //forward current
+Vr=25
+Ir=100*10^-9 //reverse current
+Rf=Vf/If
+Rr=Vr/Ir
+printf("static forward resistance=\n%f ohm\n",Rf)
+printf("static reverse resistance=\n%f ohm\n",Rr)
diff --git a/275/CH1/EX1.1.9/Ch1_1_9.sce b/275/CH1/EX1.1.9/Ch1_1_9.sce new file mode 100755 index 000000000..5407f1ca2 --- /dev/null +++ b/275/CH1/EX1.1.9/Ch1_1_9.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 1.9")
+printf("\n")
+disp("find out resistance")
+printf("Given\n")
+disp("forward current=200mA,Vr=75V,cut in voltage=0.75v,reverse current=50nA")
+//all values are from fig 1.9
+Vf=0.75
+If=200*10^-3 //forward current
+Vr=75
+Ir=50*10^-9 //reverse current
+Rf=Vf/If
+Rr=Vr/Ir
+printf("static forward resistance=\n%f ohm\n",Rf)
+printf("static reverse resistance=\n%f ohm\n",Rr)
diff --git a/275/CH2/EX2.2.11/Ch2_2_11.sce b/275/CH2/EX2.2.11/Ch2_2_11.sce new file mode 100755 index 000000000..b24d10c10 --- /dev/null +++ b/275/CH2/EX2.2.11/Ch2_2_11.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 2.11")
+printf("\n")
+disp("Calculate Peak,ac,dc load current,dc diode voltage,total input power,percentage regulation of HW Rectifier")
+printf("Given\n")
+Rf=20
+RL=1000
+N1=1
+N2=N1
+V1=110
+V2=V1 //since (V1/V2)=(N1/N2)
+Vm=sqrt(2)*V2
+Im=Vm/(Rf+RL) //peak load current
+Idc=Im/%pi //DC load current
+Irms=Im/2 //AC load current
+V!dc=-Idc*RL //DC diode Voltage
+Pi=(Irms)^2*(Rf+RL) //Total power input to circuit
+%reg=(Rf/RL)*100 //percentage regulation
+printf("Peak,DC,AC load current are =\n%f ampere\n%f ampere\n%f ampere\n",Im,Idc,Irms)
+printf("DC Diode voltage =\n%f volt\n",V!dc)
+printf("Total power input to circuit =\n%f watt\n",Pi)
+printf("percentage regulation =\n%f\n",%reg)
diff --git a/275/CH2/EX2.2.12/Ch2_2_12.sce b/275/CH2/EX2.2.12/Ch2_2_12.sce new file mode 100755 index 000000000..085a58704 --- /dev/null +++ b/275/CH2/EX2.2.12/Ch2_2_12.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 2.12")
+printf("\n")
+disp("Calculate DC,RMS load voltage,PIV across diode,Rectification efficiency,DC power delivered to load,Frequency of output waveform ")
+printf("Given\n")
+Rf=50
+RL=500
+N1=10
+N2=1
+V1=230
+Vm=(N2/N1)*V1
+w=314
+f=w/(2*%pi)
+Vdc=(Vm/%pi)/(1+(Rf/RL)) //DC load voltage
+Vrms=(Vm/2)/(1+(Rf/RL)) //RMS load voltage
+PIV=Vm
+%n=40.6/(1+(Rf/RL)) //Rectification efficiency
+Pdc=(Vdc^2)/RL
+printf("DC,RMS load voltage=\n%f volt\n%f volt\n",Vdc,Vrms)
+printf("PIV across the diode =\n%f volt\n",PIV)
+printf("Rectification efficiency=\n%f\n",%n)
+printf("DC power delivered to a load=\n%f watt\n",Pdc)
diff --git a/275/CH2/EX2.2.20/Ch2_2_20.sce b/275/CH2/EX2.2.20/Ch2_2_20.sce new file mode 100755 index 000000000..60d02013a --- /dev/null +++ b/275/CH2/EX2.2.20/Ch2_2_20.sce @@ -0,0 +1,34 @@ +clc
+disp("Example 2.20")
+printf("\n")
+disp("Calculate peak,RMS,DC load current, DC in each diode,DC output voltage,% regulation,PIV,RMS current,DC load voltage")
+printf("Given\n")
+Rf=500
+RL=2000
+V2=280
+//Secondary voltage is
+Vm=sqrt(2)*V2
+//Peak load current
+Im=Vm/(Rf+RL)
+//DC load current
+Idc=2*Im/(%pi)
+//Since each diode acts as a half-wave rectifier,the dc current through each diode is
+Idc1=Im/(%pi)
+//dc output power
+Pdc=[Idc]^2*RL
+%reg=(Rf/RL)*100
+//PIV across each diode
+PIV=2*Vm
+//RMS load current
+Irms=Im/(sqrt(2))
+//RMS through each diode is
+Irms1=(Im/2)
+//Dc load voltage
+Vdc=Idc*RL
+printf("peak load, DC load current is \n%f ampere\n%f ampere\n",Im,Idc)
+printf("direct current in each diode is \n%f ampere\n",Idc1)
+printf("dc output power is \n%f watt\n",Pdc)
+printf("percentage regulation is \n%f\n",%reg)
+printf("PIV across each diode is \n%f volt\n",PIV)
+printf("rms load current and rms current through each diode is\n%f ampere\n%f ampere \n",Irms, Irms1)
+printf("DC load voltage is \n%f volt\n",Vdc)
diff --git a/275/CH2/EX2.2.21/Ch2_2_21.sce b/275/CH2/EX2.2.21/Ch2_2_21.sce new file mode 100755 index 000000000..3a98b6c2a --- /dev/null +++ b/275/CH2/EX2.2.21/Ch2_2_21.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 2.21")
+printf("\n")
+disp("Find the load current and rms value of input current")
+printf("Given\n")
+V2=100
+Rf=50
+RL=950
+//secondary voltage
+Vm=sqrt(2)*V2
+//DC load current
+Idc=(2*Vm)/(%pi*(Rf+RL))
+//RMS input current is same as RMS load current
+Im=(Idc*%pi)/2
+Irms=Im/sqrt(2)
+printf("The load current=\t%f ampere\n",Idc)
+printf("RMS load current=\t%f ampere\n",Irms)
diff --git a/275/CH2/EX2.2.22/Ch2_2_22.sce b/275/CH2/EX2.2.22/Ch2_2_22.sce new file mode 100755 index 000000000..59b5ebecf --- /dev/null +++ b/275/CH2/EX2.2.22/Ch2_2_22.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 2.22")
+printf("\n")
+disp("Calculate Average load current & voltage,Ripple voltage")
+printf("Given\n")
+RL=2000
+//diodes are ideal
+Rf=0
+C=500*10^-6
+f=50
+V2=200
+Vm=sqrt(2)*V2
+//average load current
+Idc=(2*Vm)/(%pi*(Rf+RL))
+//Average load voltage
+Vdc=Idc*RL
+//ripple factor
+V=0.483
+Vac=V*Vdc
+//with capacitor connected across RL
+V1=1/(4*sqrt(3)*RL*C*f)
+//with capacitor filter we have Vdc=Vm
+Vdc1=282.84
+Vac1=V1*Vdc1
+printf("Average load current=\t%f ampere\n",Idc)
+printf("Average load voltage=\t%f ampere\n",Vdc)
+printf("Ripple voltage=\t%f volt\n",Vac)
+printf("Ripple voltage when capacitor connected=\t%f volt\n",Vac1)
diff --git a/275/CH2/EX2.2.23/Ch2_2_23.sce b/275/CH2/EX2.2.23/Ch2_2_23.sce new file mode 100755 index 000000000..b29d15885 --- /dev/null +++ b/275/CH2/EX2.2.23/Ch2_2_23.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 2.23")
+printf("\n")
+disp("Calculate Average voltage, rectification efficiency & percentage regulation")
+printf("Given\n")
+V2=30
+RL=100
+Rf=10
+Vm=sqrt(2)*V2
+//Average output voltage
+Vdc=(((2*Vm)/(%pi))/(1+(Rf/RL)))
+//Rectification effeiciency
+nr=0.812/(1+(Rf/RL))
+//percentage regulation
+PR=(Rf/RL)*100
+printf("Average output voltage=\t%f volt\n",Vdc)
+printf("Rectification efficiency=\t%f\n",nr)
+printf("Percentage regulation=\t%f\n",PR)
diff --git a/275/CH2/EX2.2.24/Ch2_2_24.sce b/275/CH2/EX2.2.24/Ch2_2_24.sce new file mode 100755 index 000000000..bc48543ea --- /dev/null +++ b/275/CH2/EX2.2.24/Ch2_2_24.sce @@ -0,0 +1,29 @@ +clc
+disp("Example 2.24")
+printf("\n")
+disp("Calculate Average load voltage,RMS load current,PIV,DC o/p power,Frequency of output waveform")
+printf("Given\n")
+V1=220
+N1=10
+N2=1
+V2=V1*(N2/N1)
+Vm=V2
+Rf=20
+RL=1000
+w=314
+f=w/(2*%pi)
+//Average load voltage
+Vdc=(((2*Vm)/(%pi))/(1+(Rf/RL)))
+//RMS load current
+Irms=Vm/(sqrt(2)*(Rf+RL))
+//PIV across each diode
+PIV=2*Vm
+//dc output power
+Pdc=Vdc^2/RL
+//Frequency of output waveform
+Fout=2*f
+printf("average load voltage is \n%f volt\n",Vdc)
+printf("RMS load current is \n%f ampere\n",Irms)
+printf("PIV across each diode is \n %f volt\n",PIV)
+printf("DC ouput power \n%f watt\n",Pdc)
+printf("frequency of output waveform is \n%f hz\n",Fout)
diff --git a/275/CH2/EX2.2.28/Ch2_2_28.sce b/275/CH2/EX2.2.28/Ch2_2_28.sce new file mode 100755 index 000000000..8725a7419 --- /dev/null +++ b/275/CH2/EX2.2.28/Ch2_2_28.sce @@ -0,0 +1,36 @@ +clc
+disp("Example 2.28")
+printf("\n")
+disp("Calculate DC output voltage,Ripple factor,Effeciency,PIV,%regulation,Peak diode current, Dc load current, dc current,RMS current")
+printf("Given\n")
+Vm=100
+Rf=25
+RL=950
+//dc output voltage
+Vdc=(((2*Vm)/(%pi))/(1+(2*Rf/RL)))
+//Ripple factor
+Vrms=(Vm/sqrt(2))/(1+(2*Rf/RL))
+r=sqrt((Vrms/Vdc)^2-1)
+//Efficiency of rectification
+Rr=0.812/(1+(2*Rf/RL))
+//PIV across the non-conducting diode
+PIV=Vm
+//Percentage regulation
+%reg=(2*Rf/RL)*100
+//Peak load current
+Im=Vm/(2*Rf+RL)
+//DC load current
+Idc=2*Im/%pi
+//Dc current through each diode
+Idc1=Idc/2
+//RMS current through each diode
+Irms1=Im/2
+printf("dc output voltage \n%f volt\n",Vdc)
+printf("Ripple factor \n%f\n",r)
+printf("Efficiency of rectification \n%f\n",Rr)
+printf("PIV across non-conducting diode \n%f volt \n",PIV)
+printf("percentage regulation \n%f\n",%reg)
+printf("Peak diode current \n%f ampere\n",Im)
+printf("dc load current \n%f ampere\n",Idc)
+printf("dc current through each diode \n %f ampere\n",Idc1)
+printf("RMS current through each diode \n %f ampere\n",Irms1)
diff --git a/275/CH2/EX2.2.29/Ch2_2_29.sce b/275/CH2/EX2.2.29/Ch2_2_29.sce new file mode 100755 index 000000000..0c08b8c41 --- /dev/null +++ b/275/CH2/EX2.2.29/Ch2_2_29.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 2.29")
+printf("\n")
+disp("Calculate Average output voltage,avg load current,frequency of output waveform,dc power output")
+printf("Given\n")
+Vm=141.42
+Rf=0 //Ideal diodes
+RL=100
+f=50
+//Average output voltage
+Vdc=(((2*Vm)/(%pi))/(1+(2*Rf/RL)))
+//Average load current
+Idc=Vdc/RL
+//frequency of output waveform
+Fout=2*f
+//dc power output
+Pdc=Idc^2*RL
+printf("average output voltage \n%f volt\n",Vdc)
+printf("average load current \n%f ampere\n",Idc)
+printf("frequency of output waveform \n%f hz\n",Fout)
+printf("dc output power \n %f watt\n",Pdc)
diff --git a/275/CH2/EX2.2.34/Ch2_2_34.sce b/275/CH2/EX2.2.34/Ch2_2_34.sce new file mode 100755 index 000000000..5e0f5fb63 --- /dev/null +++ b/275/CH2/EX2.2.34/Ch2_2_34.sce @@ -0,0 +1,24 @@ +clc
+disp("Example 2.34")
+printf("\n")
+disp("Calculate Ripple factor,DC output voltage,DC load current,PIV,RMS output ripple voltage")
+printf("Given\n")
+Vm=311.13
+f=50
+c=200*10^-6
+RL=1000
+//Ripple factor
+r=1/(2*sqrt(3)*RL*f*c)
+//dc output voltage
+Vdc=Vm/(1+(1/(2*f*c*RL)))
+//DC load current
+Idc=Vdc/RL
+//peak inverse voltage
+PIV=Vm
+//RMS ripple voltage on capacitor
+Vac=r*Vdc
+printf("ripple factor \n%f\n",r)
+printf("dc output voltage \n%f volt\n",Vdc)
+printf(" DC load current \n%f ampere\n",Idc)
+printf("PIV across the diode \n%f volt\n",PIV)
+printf("RMS ripple voltage on capacitor \n%f volt \n",Vac)
diff --git a/275/CH2/EX2.2.35/Ch2_2_35.sce b/275/CH2/EX2.2.35/Ch2_2_35.sce new file mode 100755 index 000000000..a5e1c0c5e --- /dev/null +++ b/275/CH2/EX2.2.35/Ch2_2_35.sce @@ -0,0 +1,9 @@ +clc
+disp("Example 2.35")
+printf("\n")
+disp("Calculate the capacitance")
+f=50
+RL=500
+r=0.1
+C=1/(2*sqrt(3)*f*RL*0.1)
+printf("Capacitance value=\t%f Farad\n",C)
diff --git a/275/CH2/EX2.2.40/Ch2_2_40.sce b/275/CH2/EX2.2.40/Ch2_2_40.sce new file mode 100755 index 000000000..8aaa93009 --- /dev/null +++ b/275/CH2/EX2.2.40/Ch2_2_40.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 2.40")
+printf("\n")
+disp("Estimate the value of capacitor required to keep ripple factor less than 1%")
+Vm=325.27
+f=50
+Idc=10*10^-3
+r=0.01
+RL=Vm/Idc
+C=(1/r)/(4*sqrt(3)*f*RL)
+printf("capacitor required >\t%e Farad\n",C)
diff --git a/275/CH2/EX2.2.41/Ch2_2_41.sce b/275/CH2/EX2.2.41/Ch2_2_41.sce new file mode 100755 index 000000000..aff562693 --- /dev/null +++ b/275/CH2/EX2.2.41/Ch2_2_41.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 2.41")
+printf("\n")
+disp("Calculate minimum value of capacitance used in the filter to keep ripple voltage below 2%")
+Vm=282.84
+f=50
+Idc=12*10^-3
+r=0.02
+RL=Vm/Idc
+C=(1/r)/(4*sqrt(3)*f*RL)
+printf("capacitor required >\t%e Farad\n",C)
diff --git a/275/CH2/EX2.2.42/Ch2_2_42.sce b/275/CH2/EX2.2.42/Ch2_2_42.sce new file mode 100755 index 000000000..1cdf7d648 --- /dev/null +++ b/275/CH2/EX2.2.42/Ch2_2_42.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 2.42")
+printf("\n")
+disp("Find Ripple factor,Dc output voltage,Ripple voltage,DC load current")
+printf("Given\n")
+Vm=282.84
+f=50
+C=500*10^-6
+RL=2*10^3
+//Ripple factor
+r=1/(4*sqrt(3)*RL*f*C)
+//Dc output voltage
+Vdc=Vm/(1+(1/(4*f*C*RL)))
+//Ripple voltage on capacitor
+Vac=r*Vdc
+//DC load current
+Idc=Vdc/RL
+printf("Ripple factor \n%f\n",r)
+printf("dc ouput voltage \n%f volt\n",Vdc)
+printf("Ripple voltage on capacitor \n%f volt\n",Vac)
+printf("DC load current \n %f ampere\n",Idc)
diff --git a/275/CH2/EX2.2.43/Ch2_2_43.sce b/275/CH2/EX2.2.43/Ch2_2_43.sce new file mode 100755 index 000000000..768aaf956 --- /dev/null +++ b/275/CH2/EX2.2.43/Ch2_2_43.sce @@ -0,0 +1,14 @@ +clc
+disp("Example 2.43")
+printf("\n")
+disp("Find the ripple factor & output voltage if a capacitor of 160uf is connected in parallel with load")
+RL=250
+C=160*10^-6
+f=50
+Vm=49.497
+//ripple factor
+r=1/(4*sqrt(3)*f*RL*C)
+//Dc output voltage
+Vdc=Vm/(1+(1/(4*f*C*RL)))
+printf("ripple factor \n %f\n",r)
+printf("DC output voltage \n%f volt\n",Vdc)
diff --git a/275/CH2/EX2.2.44/Ch2_2_44.sce b/275/CH2/EX2.2.44/Ch2_2_44.sce new file mode 100755 index 000000000..e952d47c1 --- /dev/null +++ b/275/CH2/EX2.2.44/Ch2_2_44.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 2.44")
+printf("\n")
+disp("Find the ripple factor & DC load current")
+printf("Given\n")
+Vm=230
+f=(314/(2*%pi))
+RL=400
+C=500*10^-6
+//ripple factor
+r=1/(4*sqrt(3)*f*RL*C)
+//DC load current
+Vdc=Vm/(1+(1/(4*f*C*RL)))
+Idc=Vdc/RL
+printf("ripple factor \n %f\n",r)
+printf("DC laod current \n%f ampere\n",Idc)
diff --git a/275/CH2/EX2.2.45/Ch2_2_45.sce b/275/CH2/EX2.2.45/Ch2_2_45.sce new file mode 100755 index 000000000..d75df8624 --- /dev/null +++ b/275/CH2/EX2.2.45/Ch2_2_45.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 2.45")
+printf("\n")
+disp("Find the capacitor value for half wave rectifier")
+Vdc=20
+f=60
+RL=500
+r=0.1/(2*sqrt(3))
+c=1/(2*sqrt(3)*r*f*RL)
+printf("Capacitor value =\t%e farad\n",c)
diff --git a/275/CH2/EX2.2.46/Ch2_2_46.sce b/275/CH2/EX2.2.46/Ch2_2_46.sce new file mode 100755 index 000000000..3459eb384 --- /dev/null +++ b/275/CH2/EX2.2.46/Ch2_2_46.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 2.46")
+printf("\n")
+disp("Find the capacitor value for full wave rectifier")
+printf("Given\n")
+Vdc=20
+f=60
+RL=500
+r=0.1/(2*sqrt(3))
+c=1/(4*sqrt(3)*r*f*RL)
+printf("Capacitor value =\t%e farad\n",c)
diff --git a/275/CH2/EX2.2.50/Ch2_2_50.sce b/275/CH2/EX2.2.50/Ch2_2_50.sce new file mode 100755 index 000000000..4968753b3 --- /dev/null +++ b/275/CH2/EX2.2.50/Ch2_2_50.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 2.50")
+printf("\n")
+disp("calculate load & source effects & the load & line regulation")
+printf("Given\n")
+Vo1=20
+Vo2=19.7
+//load effect=delVo for delIL(max)
+LE=Vo1-Vo2
+//Load regulation
+LR=(LE*100)/Vo1
+//source effect=delVo for 10% change in Vs
+V=20.2
+SE=V-Vo1
+//Line regulation
+LiR=(SE/Vo1)*100
+printf("load effect \n %f volt\n",LE)
+printf("load regulation \n%f \n",LR)
+printf("source effect \n %f volt\n",SE)
+printf("line regulation \n%f\n",LiR)
diff --git a/275/CH2/EX2.2.51/Ch2_2_51.sce b/275/CH2/EX2.2.51/Ch2_2_51.sce new file mode 100755 index 000000000..60afa8421 --- /dev/null +++ b/275/CH2/EX2.2.51/Ch2_2_51.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 2.51")
+printf("\n")
+disp("calculate load & source effects & load & line regulation")
+printf("Given\n")
+Vo1=15
+Vo2=14.9
+//load effect=delVo for delIL(max)
+LE=Vo1-Vo2
+//Load regulation
+LR=LE*100/Vo1
+//source effect=delVo for 10% change in Vs
+V=14.95
+SE=Vo1-V
+//Line regulation
+LiR=(SE/Vo1)*100
+printf("load effect \n %f volt\n",LE)
+printf("load regulation \n%f \n",LR)
+printf("source effect \n %f volt\n",SE)
+printf("line regulation \n%f\n",LiR)
diff --git a/275/CH2/EX2.2.54/Ch2_2_54.sce b/275/CH2/EX2.2.54/Ch2_2_54.sce new file mode 100755 index 000000000..b8cceae67 --- /dev/null +++ b/275/CH2/EX2.2.54/Ch2_2_54.sce @@ -0,0 +1,30 @@ +clc
+disp("Example 2.54")
+printf("\n")
+disp("Design the Zener Diode Voltage regulator for given specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//unregulated dc input voltage
+Vimin=8
+Vimax=12
+//regulated dc output voltage
+Vo=5
+//minimum zener current
+Izmin=5*10^-3
+//maximum zener current
+Izmax=80*10^-3
+//load current
+ILmin=0
+ILmax=20*10^-3
+//load resistance
+RL=Vo/ILmax
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+
diff --git a/275/CH2/EX2.2.55/Ch2_2_55.sce b/275/CH2/EX2.2.55/Ch2_2_55.sce new file mode 100755 index 000000000..7016f9cdd --- /dev/null +++ b/275/CH2/EX2.2.55/Ch2_2_55.sce @@ -0,0 +1,32 @@ +clc
+disp("Example 2.55")
+printf("\n")
+disp("Design a zener diode voltage regulator to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//unregulated dc input voltage
+Vimin=13
+Vimax=17
+//Load current
+ILmin-0
+ILmax=10*10^-3
+//regulated output voltage
+Vo=10
+//minimum zener current
+Izmin=5*10^-3
+//Maximum power dissipation
+Pzmax=500*10^-3
+//maximum zener current
+Izmax=Pzmax/Vo
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+//load resistance
+RLmin=Vo/ILmax
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RLmin)
diff --git a/275/CH2/EX2.2.56/Ch2_2_56.sce b/275/CH2/EX2.2.56/Ch2_2_56.sce new file mode 100755 index 000000000..8cf253d1d --- /dev/null +++ b/275/CH2/EX2.2.56/Ch2_2_56.sce @@ -0,0 +1,31 @@ +clc
+disp("Example 2.56")
+printf("\n")
+disp("Design a zener diode voltage regulator to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//dc input voltage
+Vimin=20
+Vimax=Vimin
+//dc output voltage
+Vo=10
+//load current
+ILmin=0
+ILmax=20*10^-3
+//minimum zener current
+Izmin=10*10^-3
+//maximum zener current
+Izmax=100*10^-3
+//load resistance
+RLmin=Vo/ILmax
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RLmin)
+
diff --git a/275/CH2/EX2.2.57/Ch2_2_57.sce b/275/CH2/EX2.2.57/Ch2_2_57.sce new file mode 100755 index 000000000..fefc22898 --- /dev/null +++ b/275/CH2/EX2.2.57/Ch2_2_57.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 2.57")
+printf("\n")
+disp("Calculate the value of series resistance & Zener diode current when load is 1200ohm")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//Input voltage
+Vi=32
+//Zener diode voltage
+Vz=24
+//maximum power
+Pzmax=600*10^-3
+//output voltage
+Vo=24
+//since Vi has no variation
+Vimax=32
+Vimin=Vimax
+//Zener current
+Izmax=Pzmax/Vz
+//series resistance
+ILmin=0
+R=(Vimax-Vo)/(Izmax+ILmin)
+//Diode current
+RL=1200
+IL=Vo/RL //load current
+I=(Vi-Vo)/R //total current
+IZ=I-IL
+printf("The diode current=\t%f ampere\n",IZ)
diff --git a/275/CH2/EX2.2.58/Ch2_2_58.sce b/275/CH2/EX2.2.58/Ch2_2_58.sce new file mode 100755 index 000000000..3c4b2986f --- /dev/null +++ b/275/CH2/EX2.2.58/Ch2_2_58.sce @@ -0,0 +1,31 @@ +clc
+disp("Example 2.58")
+printf("\n")
+disp("Design a voltage regulator using zener diode to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//unregulated dc input voltage
+Vimin=20
+Vimax=30
+//regulated dc output voltage
+Vo=10
+//minimum zener current
+Izmin=2*10^-3
+//maximum zener current
+Izmax=100*10^-3
+//load current
+ILmin=0
+ILmax=25*10^-3
+//load resistance
+RL=Vo/ILmax
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RLmin)
+
diff --git a/275/CH2/EX2.2.59/Ch2_2_59.sce b/275/CH2/EX2.2.59/Ch2_2_59.sce new file mode 100755 index 000000000..25d8e7c19 --- /dev/null +++ b/275/CH2/EX2.2.59/Ch2_2_59.sce @@ -0,0 +1,33 @@ +clc
+disp("Example 2.59")
+printf("\n")
+disp("Design a zener voltage regulator to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//DC input voltage
+Vimin=10-2
+Vimax=10+2
+//DC output voltage
+Vo=5
+//Load current
+ILmax=10*10^-3
+ILmin=0
+//zener wattage
+Pzmax=400*10^-3
+Vz=Vo
+//maximum zener current
+Izmax=Pzmax/Vz
+//since Izmin is not given so let us take IZmin=5mA
+Izmin=5*10^-3
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+//load resistance
+RL=Vo/ILmax
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RL)
diff --git a/275/CH2/EX2.2.60/Ch2_2_60.sce b/275/CH2/EX2.2.60/Ch2_2_60.sce new file mode 100755 index 000000000..b42c89f07 --- /dev/null +++ b/275/CH2/EX2.2.60/Ch2_2_60.sce @@ -0,0 +1,29 @@ +clc
+disp("Example 2.60")
+printf("\n")
+disp("Design a zener voltage regulator to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//DC input voltage(10V[+-]20%)
+Vimin=10-2
+Vimax=10+2
+//DC output voltage
+Vo=5
+//Load current
+ILmax=20*10^-3
+ILmin=0
+//zener current
+Izmax=80*10^-3
+Izmin=5*10^-3
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//minimum resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+//load resistance
+RL=Vo/ILmax
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RL)
diff --git a/275/CH2/EX2.2.61/Ch2_2_61.sce b/275/CH2/EX2.2.61/Ch2_2_61.sce new file mode 100755 index 000000000..16af3a357 --- /dev/null +++ b/275/CH2/EX2.2.61/Ch2_2_61.sce @@ -0,0 +1,33 @@ +clc
+disp("Example 2.61")
+printf("\n")
+disp("Design a zener voltage regulator to meet following specification")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//DC input voltage
+Vimin=12-3
+Vimax=12+3
+//DC output voltage
+Vo=5
+//Load current
+ILmax=20*10^-3
+ILmin=0
+//zener wattage
+Pzmax=500*10^-3
+Vz=Vo
+//maximum zener current
+Izmax=Pzmax/Vz
+//since Izmin is not given so let us take IZmin=5mA
+Izmin=5*10^-3
+//maximum Resistance
+Rmax=(Vimin-Vo)/(Izmin+ILmax)
+//mini resistance
+Rmin=(Vimax-Vo)/(Izmax+ILmin)
+//Required resistance
+R=(Rmax+Rmin)/2
+//load resistance
+RL=Vo/ILmax
+printf("minimum resistance %d ohm \n",Rmin)
+printf("maximum resistance %d ohm \n",Rmax)
+printf("required resistance %d ohm \n",R)
+printf("load resistance %d ohm \n",RL)
diff --git a/275/CH2/EX2.2.63/Ch2_2_63.sce b/275/CH2/EX2.2.63/Ch2_2_63.sce new file mode 100755 index 000000000..95ec482fb --- /dev/null +++ b/275/CH2/EX2.2.63/Ch2_2_63.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 2.63")
+printf("\n")
+disp("Design a 6V dc reference source to operate from a 16v supply")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//output voltage
+Vo=6
+//input voltage
+Vi=16
+//zener power
+Pzmax=400*10^-3
+//zener current maximum
+Izmax=Pzmax/Vo
+//I=Iz+IL & ILmin=0, we have Izmax=I
+//take Izmin=5*10^-3
+Izmin=5*10^-3
+//maximum load current
+ILmax=Izmax-Izmin
+//load resistance
+RLmin=Vo/ILmax
+//series resistance
+R=(Vi-Vo)/Izmax
+printf("maximum load current %d ampere\n",ILmax)
+printf("Load resistance %d ohm\n",RLmin)
+printf("sereies resistance %d ohm\n",R)
diff --git a/275/CH2/EX2.2.64/Ch2_2_64.sce b/275/CH2/EX2.2.64/Ch2_2_64.sce new file mode 100755 index 000000000..168d2aeef --- /dev/null +++ b/275/CH2/EX2.2.64/Ch2_2_64.sce @@ -0,0 +1,27 @@ +clc
+disp("Example 2.64")
+printf("\n")
+disp("Design a 8V dc reference source to operate from a 20v supply and find maximum load current")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//output voltage
+Vo=8
+//input voltage
+Vi=20
+//zener power
+Pzmax=400*10^-3
+//zener current maximum
+Izmax=Pzmax/Vo
+//I=Iz+IL & ILmin=0, we have Izmax=I
+//take Izmin=5*10^-3
+Izmin=5*10^-3
+//maximum load current
+ILmax=Izmax-Izmin
+//load resistance
+RLmin=Vo/ILmax
+//series resistance
+R=(Vi-Vo)/Izmax
+printf("maximum load current %d ampere\n",ILmax)
+printf("Load resistance %d ohm\n",RLmin)
+printf("sereies resistance %d ohm\n",R)
+
diff --git a/275/CH2/EX2.2.65/Ch2_2_65.sce b/275/CH2/EX2.2.65/Ch2_2_65.sce new file mode 100755 index 000000000..dc8023850 --- /dev/null +++ b/275/CH2/EX2.2.65/Ch2_2_65.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 2.65")
+printf("\n")
+disp("Calculate circuit current when supply voltage drops to 27V, select suitable components")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//input voltage
+Vi=30
+//output voltage
+Vo=9
+//test current(lies b/w Izmin & Izmax)
+Izt=20*10^-3
+//load current(assume zero, no load operation)
+IL=0
+//circuit current
+I=Izt
+//series resistance
+R=(Vi-Vo)/I
+//zener current when Vi drops to 27V
+Vi1=27
+Iz=(Vi1-Vo)/R
+printf("Zener current is %f ampere\n",Iz)
\ No newline at end of file diff --git a/275/CH2/EX2.2.66/Ch2_2_66.sce b/275/CH2/EX2.2.66/Ch2_2_66.sce new file mode 100755 index 000000000..ae32e0e64 --- /dev/null +++ b/275/CH2/EX2.2.66/Ch2_2_66.sce @@ -0,0 +1,33 @@ +clc
+disp("Example 2.66")
+printf("\n")
+disp("Calculate the effect of a 10% variation supply voltage on diode current")
+printf("Given\n")
+//input voltage
+Vi=25
+//output voltage
+Vo=10
+//test current(lies b/w Izmin & Izmax)
+Izt=20*10^-3
+//load current(assume zero, no load operation)
+IL=10^-3
+//select R such that
+Iz=Izt
+//series resistance
+R=(Vi-Vo)/(Iz+IL)
+//maximum input voltage
+Vimax=25+2.5
+//minimum input voltage
+Vimin=25-2.5
+//ciruit current
+I1=(Vimax-Vo)/R
+//zener current when Vimax
+Izmax=I1-IL
+//cicuit current when Vimin
+I2=(Vimin-Vo)/R
+//zener current when Vimin
+Izmin=I2-IL
+printf("circuit current when Vimax is %f ampere\n",I1)
+printf("zener current when Vimax is %f ampere\n",Izmax)
+printf("circuit current when Vimin is %f ampere\n",I2)
+printf("zener current when Viin is %f ampere\n",Izmin)
diff --git a/275/CH2/EX2.2.68/Ch2_2_68.sce b/275/CH2/EX2.2.68/Ch2_2_68.sce new file mode 100755 index 000000000..a4cf6342f --- /dev/null +++ b/275/CH2/EX2.2.68/Ch2_2_68.sce @@ -0,0 +1,35 @@ +clc
+disp("Example 2.68")
+printf("\n")
+disp("Calculate the line regulation, output resistance, load regulation & ripple rejection ratio")
+printf("Given\n")
+printf("1 Resistance are in ohms \n 2 Current are in ampere \n 3 voltage sources are in volt\n")
+//input voltage
+Vi=16
+//output voltage
+Vo=6
+//load current
+ILmax=60*10^-3
+//dynamic impedence
+Zz=7
+//series resistance
+R=150
+//Source effect
+delVi=(10*16)/100
+RL=Vo/ILmax
+//Zz||RL
+Rp=(Zz*RL)/(Zz+RL)
+delVo=(delVi*Rp)/(R+Rp)
+//Line regulation
+LR=(delVo*100)/Vo
+//load effect
+delIL=ILmax
+Ro=(Zz*R)/(Zz+R)
+delVo1=delIL*Ro
+//output resistance
+Rout=Ro
+//Ripple rejection ratio
+VrobyVri=Rp/(R+Rp)
+printf("line regulation is %f \n",LR)
+printf("output resistance is %d ohm\n",Rout)
+printf("Ripple rejection ratio %f \n",VrobyVri)
\ No newline at end of file diff --git a/275/CH3/EX3.3.14/Ch3_3_14.sce b/275/CH3/EX3.3.14/Ch3_3_14.sce new file mode 100755 index 000000000..2598ed14f --- /dev/null +++ b/275/CH3/EX3.3.14/Ch3_3_14.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 3.14")
+printf("\n")
+disp("calculate the value of Ic,Ie,beta for a transistor")
+printf("Given\n")
+alpha=0.98
+//base current
+Ib=120*10^-6
+//Value of Ic
+Ic=alpha*Ib/(1-alpha)
+//Value of Ie
+Ie=Ic+Ib
+//value of beta
+beta=alpha/(1-alpha)
+printf("base current \n%f ampere\n",Ib)
+printf("collector current \n%f ampere\n",Ic)
+printf("Emitter current \n%f ampere\n",Ie)
+printf("beta \n%f\n",beta)
diff --git a/275/CH3/EX3.3.15/Ch3_3_15.sce b/275/CH3/EX3.3.15/Ch3_3_15.sce new file mode 100755 index 000000000..3e46888f1 --- /dev/null +++ b/275/CH3/EX3.3.15/Ch3_3_15.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 3.15")
+printf("\n")
+disp("Find the value of alpha & beta of transistor and Ib for desired Ic")
+printf("Given\n")
+Ic=1.2*10^-3
+Ib=20*10^-6
+//the value of beta
+beta=Ic/Ib
+//the value of alpha
+alpha=beta/(1+beta)
+//the value of Ib for desired value of Ic=5mA
+Ic1=5*10^-3
+Ib1=Ic1/beta
+printf("beta \n%f\n",beta)
+printf("alpha \n%f\n",alpha)
+printf("base current when collector current is 5mA is \n%f ampere\n",Ib1)
diff --git a/275/CH3/EX3.3.16/Ch3_3_16.sce b/275/CH3/EX3.3.16/Ch3_3_16.sce new file mode 100755 index 000000000..946594569 --- /dev/null +++ b/275/CH3/EX3.3.16/Ch3_3_16.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 3.16")
+printf("\n")
+disp("calculate the value of alpha,Ib,beta for a transistor")
+printf("Given\n")
+//collector current
+Ic=2.5*10^-3
+//emitter current
+Ie=2.55*10^-3
+//Value of alpha
+alpha=Ic/Ie
+//Value of Ib
+Ib=Ie-Ic
+//value of beta
+beta=Ic/Ib
+printf("collector current \n%f ampere\n",Ic)
+printf("Emitter current \n%f ampere\n",Ie)
+printf("alpha \n%f\n",alpha)
+printf("base current \n%f ampere\n",Ib)
+printf("beta \n%f\n",beta)
diff --git a/275/CH3/EX3.3.17/Ch3_3_17.sce b/275/CH3/EX3.3.17/Ch3_3_17.sce new file mode 100755 index 000000000..f5eb703ea --- /dev/null +++ b/275/CH3/EX3.3.17/Ch3_3_17.sce @@ -0,0 +1,19 @@ +clc
+disp("Example 3.17")
+printf("\n")
+disp("calculate the value of beta for transistor. find new collector current when beta of new transistor is 70")
+printf("Given\n")
+//old transistor
+Ic=3*10^-3
+Ie=3.03*10^-3
+//find Ib
+Ib=Ie-Ic
+//value of beta
+beta=Ic/Ib
+//for new transistor beta=70
+beta1=70
+//the value of Ic
+Ic=beta1*Ib
+printf("base current \n%f ampere\n",Ib)
+printf("beta \n%f\n",beta)
+printf("new value of collector current for beta 70 is \n%f ampere\n",Ic)
diff --git a/275/CH3/EX3.3.18/Ch3_3_18.sce b/275/CH3/EX3.3.18/Ch3_3_18.sce new file mode 100755 index 000000000..2358d6125 --- /dev/null +++ b/275/CH3/EX3.3.18/Ch3_3_18.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 3.18")
+printf("\n")
+disp("calculate the value of Ic,Ie for a transistor.Find beta for transistor")
+printf("Given\n")
+//For old transistor
+alpha=0.97
+Ib=50*10^-6
+//value of collector current
+Ic=alpha*Ib/(1-alpha)
+//value of emitter current
+Ie=Ic/alpha
+//value of beta
+beta=Ic/Ib
+printf("collector current \n%f ampere\n",Ic)
+printf("Emitter current \n%f ampere\n",Ie)
+printf("beta \n%f\n",beta)
diff --git a/275/CH3/EX3.3.19/Ch3_3_19.sce b/275/CH3/EX3.3.19/Ch3_3_19.sce new file mode 100755 index 000000000..c7036b756 --- /dev/null +++ b/275/CH3/EX3.3.19/Ch3_3_19.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 3.19")
+printf("\n")
+disp("calculate the value of Ie,alpha,beta for a transistor and find Ib for new value of Ic")
+printf("Given\n")
+//for old transistor
+Ic=5.25*10^-3
+Ib=100*10^-6
+//value of Ie
+Ie=Ic+Ib
+//value of alpha
+alpha=Ic/Ie
+//value of beta
+beta=Ic/Ib
+//for new value of Ib the Ic value is
+Ic1=15*10^-3
+Ib=Ic1/beta
+printf("emitter current \n%f ampere\n",Ie)
+printf("alpha \n%f\n",alpha)
+printf("beta \n%f\n",beta)
+printf("new base current \n%f ampere\n",Ib)
diff --git a/275/CH3/EX3.3.20/Ch3_3_20.sce b/275/CH3/EX3.3.20/Ch3_3_20.sce new file mode 100755 index 000000000..a723e1b42 --- /dev/null +++ b/275/CH3/EX3.3.20/Ch3_3_20.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 3.20")
+printf("\n")
+disp("calculate the value of Ic,Ie for a transistor")
+printf("Given\n")
+alpha=0.99
+//base current
+Ib=20*10^-6
+//value of collector current
+Ic=alpha*Ib/(1-alpha)
+//value of emitter current
+Ie=Ic+Ib
+printf("base current \n%f ampere\n",Ib)
+printf("collector current \n%f ampere\n",Ic)
+printf("Emitter current \n%f ampere\n",Ie)
+
diff --git a/275/CH3/EX3.3.21/Ch3_3_21.sce b/275/CH3/EX3.3.21/Ch3_3_21.sce new file mode 100755 index 000000000..eada64040 --- /dev/null +++ b/275/CH3/EX3.3.21/Ch3_3_21.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 3.21")
+printf("\n")
+disp("calculate the value of Ic,alpha,beta for a transistor and Ic when Ib=150uA")
+printf("Given\n")
+Ic=12.42*10^-3
+Ib=200*10^-6
+//value of Ie
+Ie=Ic+Ib
+//value of alpha
+alpha=Ic/Ie
+//value of beta
+beta=Ic/Ib
+//value of Ic when Ib=150uA
+Ib1=150*10^-6
+Ic=beta*Ib1
+printf("Emitter current \n%f ampere\n",Ie)
+printf("alpha \n%f\n",alpha)
+printf("beta \n%f\n",beta)
+printf("collector current \n%f ampere\n",Ic)
diff --git a/275/CH3/EX3.3.22/Ch3_3_22.sce b/275/CH3/EX3.3.22/Ch3_3_22.sce new file mode 100755 index 000000000..1e6eb08f9 --- /dev/null +++ b/275/CH3/EX3.3.22/Ch3_3_22.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 3.22")
+printf("\n")
+disp("calculate the value of Ib,beta for a transistor and Ic, Ie for new value of beta")
+printf("Given\n")
+Ic=16*10^-3
+Ie=16.04*10^-3
+//base current
+Ib=Ie-Ic
+//beta value
+beta=Ic/Ib
+//for beta=25
+beta1=25
+Ic1=beta1*Ib
+Ie1=Ic1+Ib
+printf("base current \n%f ampere\n",Ib)
+printf("beta \n%f\n",beta)
+printf("emitter current \n%f ampere\n",Ie1)
diff --git a/275/CH3/EX3.3.25/Ch3_3_25.sce b/275/CH3/EX3.3.25/Ch3_3_25.sce new file mode 100755 index 000000000..d97d2397a --- /dev/null +++ b/275/CH3/EX3.3.25/Ch3_3_25.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 3.25")
+printf("\n")
+disp("Find the DC collector voltage & voltage gain of circuit for Vi=50mV")
+printf("Given\n")
+//base current for Vbe=0.7
+Ib=30*10^-6
+Vbe=0.7
+beta=80
+//collector current
+Ic=beta*Ib
+//given from ckt
+Vcc=20
+Rc=5.8*10^3
+//writing KVL for Common Emitter circuit
+Vc=Vcc-(Ic*Rc)
+//for input characteristics delVi=delVb=50mV
+Vi=50*10^-3
+delIb=5*10^-6
+Ic1=beta*delIb
+//output voltage
+Vo=Ic1*Rc
+//voltage gain
+Av=Vo/Vi
+printf("Dc collector voltage \n%f volt\n",Vc)
+printf("voltage gain \n%f\n",Av)
diff --git a/275/CH3/EX3.3.26/Ch3_3_26.sce b/275/CH3/EX3.3.26/Ch3_3_26.sce new file mode 100755 index 000000000..effdb50c8 --- /dev/null +++ b/275/CH3/EX3.3.26/Ch3_3_26.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 3.26")
+printf("\n")
+disp("FInd the DC current gain for circuit fig 3.15 and ac voltage gain")
+printf("Given\n")
+//to find dc current gain
+//given
+Vcc=15
+Vc=7
+Rc=5.6*10^3
+Ib=20*10^-6
+//to find Vrc
+Vrc=Vcc-Vc
+//collector current
+Ic=Vrc/Rc
+//dc current gain
+betadc=Ic/Ib
+//to find ac voltage gain
+//given
+Vi=50*10^-3
+delIb=10*10^-6
+delIc=betadc*delIb
+//output voltage
+Vo=delIc*Rc
+//voltage gain
+Av=Vo/Vi
+printf("DC current gain \n%f\n",betadc)
+printf("voltage gain \n%f\n",Av)
diff --git a/275/CH3/EX3.3.27/Ch3_3_27.sce b/275/CH3/EX3.3.27/Ch3_3_27.sce new file mode 100755 index 000000000..deb467a90 --- /dev/null +++ b/275/CH3/EX3.3.27/Ch3_3_27.sce @@ -0,0 +1,45 @@ +clc
+disp("Example 3.27")
+printf("\n")
+disp("Find the following terms as given in question 3.27")
+printf("Given\n")
+//to find collector voltage
+//given
+Vbe=0.7
+Ib=30*10^-6
+beta=50
+Rc=12*10^3
+Vcc=25
+//collector current
+Ic=beta*Ib
+//collector voltage
+Vc=Vcc-(Ic*Rc)
+//to find voltage gain
+//given
+Vi=50*10^-3
+Ib1=15*10^-6
+Ic1=beta*Ib1
+Vo=Ic1*Rc
+//voltage gain
+Av=Vo/Vi
+//to find Vce
+//given
+Vbe=0.73
+Ib2=40*10^-6
+Ic2=beta*Ib2
+Vce=Vcc-(Ic2*Rc)
+//to find voltage gain when Rc changed to 6.8k
+Rc1=6.8*10^3
+Vo1=Ic1*Rc1
+Av1=Vo1/Vi
+//to find current gain of replaced transistor
+//given
+Vc1=9
+Vrc=Vcc-Vc1
+Ic3=Vrc/Rc
+beta1=Ic3/Ib
+printf("collector voltage \n%f volt \n",Vc)
+printf("Voltage gain for vi=50mv \n%f\n",Av)
+printf("Vce if Vbe=0.73 is \n%f volt\n",Vce)
+printf("Voltage gain when Rc=6.8k \n%f Volt\n",Av1)
+printf("current gain of replaced transistor \n%f\n",beta1)
diff --git a/275/CH3/EX3.3.34/Ch3_34.png b/275/CH3/EX3.3.34/Ch3_34.png Binary files differnew file mode 100755 index 000000000..00bf8fc25 --- /dev/null +++ b/275/CH3/EX3.3.34/Ch3_34.png diff --git a/275/CH3/EX3.3.34/Ch3_3_34.sce b/275/CH3/EX3.3.34/Ch3_3_34.sce new file mode 100755 index 000000000..0a7f304ed --- /dev/null +++ b/275/CH3/EX3.3.34/Ch3_3_34.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 3.34")
+printf("\n")
+disp("Obtain the Common base current gain & output characteristics")
+printf("Given\n")
+Vcb=[ 4 4 4 4 4 4 ]
+Ic=[ 0 2 4 6 8 10]
+subplot(221)
+plot2d(Vcb,Ic)
+xlabel("Vcb in volt")
+ylabel("Ic in Ampere")
+xtitle("output characteristics")
+Ic1=[0 2 10 ]
+Ie=[0 2 10 ]
+subplot(222)
+plot2d(Ie,Ic1)
+xarrows(Ie,Ic1,2,2)
+xarrows(Ie,Ic1,10,10)
+xlabel("Vcb in volt")
+ylabel("Ic in Ampere")
+xtitle("current gain characteristics")
diff --git a/275/CH3/EX3.3.46/Ch3_3_46.sce b/275/CH3/EX3.3.46/Ch3_3_46.sce new file mode 100755 index 000000000..1ecb496bc --- /dev/null +++ b/275/CH3/EX3.3.46/Ch3_3_46.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 3.46")
+printf("\n")
+disp("For the circuit shown in example 3.46 draw a DC load line")
+printf("Given\n")
+//to find Vce value when Ic=0
+Ic1=0
+//given
+Rc=12*10^3
+Vcc=20
+//from circuit
+Vce=Vcc-(Ic1*Rc)
+//to find Ic when Vce=0
+Vce1=0
+Ic=Vcc/Rc
+//To draw DC load line
+Vceg=[Vce, Vce1]
+Icg=[Ic1,Ic]
+plot2d(Vceg,Icg)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC Load line for Rc=12Kohm")
diff --git a/275/CH3/EX3.3.46/Ch3_46.png b/275/CH3/EX3.3.46/Ch3_46.png Binary files differnew file mode 100755 index 000000000..cfb72c634 --- /dev/null +++ b/275/CH3/EX3.3.46/Ch3_46.png diff --git a/275/CH3/EX3.3.50/Ch3_3_50.sce b/275/CH3/EX3.3.50/Ch3_3_50.sce new file mode 100755 index 000000000..09acb98e5 --- /dev/null +++ b/275/CH3/EX3.3.50/Ch3_3_50.sce @@ -0,0 +1,27 @@ +clc
+disp("Example 3.50")
+printf("\n")
+disp("Draw a DC load line for the base bias circuit")
+printf("Given\n")
+//given
+Rc=2.2*10^3
+Rb=470*10^3
+Vcc=18
+Vbe=0.7
+hFE=100
+//find the Ib
+Ib=(Vcc-Vbe)/Rb // from ciruit
+//find the Ic
+Icq=hFE*Ib
+//find the Vceq
+Vceq=Vcc-(Icq*Rc)
+//to draw Dc load line
+Ic1=Vcc/Rc
+Vce1=Vcc
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f,%f)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in Ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.50/Ch3_50.png b/275/CH3/EX3.3.50/Ch3_50.png Binary files differnew file mode 100755 index 000000000..68bb74ac6 --- /dev/null +++ b/275/CH3/EX3.3.50/Ch3_50.png diff --git a/275/CH3/EX3.3.51/Ch3_3_51.sce b/275/CH3/EX3.3.51/Ch3_3_51.sce new file mode 100755 index 000000000..edbf7cd53 --- /dev/null +++ b/275/CH3/EX3.3.51/Ch3_3_51.sce @@ -0,0 +1,33 @@ +clc
+disp("Example 3.51")
+printf("\n")
+disp("Draw a DC load line for the base bias circuit for different hFE")
+printf("Given\n")
+//given
+Rc=2.2*10^3
+Rb=470*10^3
+Vcc=18
+Vbe=0.7
+hFE1=50
+hFE2=200
+//find the Ib
+Ib=(Vcc-Vbe)/Rb // from ciruit
+//find the Ic for hFE1
+Icq1=hFE1*Ib
+//find the Vceq1
+Vceq1=Vcc-(Icq1*Rc)
+//find the Ic for hFE2
+Icq2=hFE2*Ib
+//find the Vceq2
+Vceq2=Vcc-(Icq2*Rc)
+//to draw Dc load line
+Ic1=Vcc/Rc
+Vce1=Vcc
+Vce=[Vcc Vceq1 Vceq2 0]
+Ic=[0 Icq1 Icq2 Ic1]
+printf("Q1(%f volt,%f ampere)\n",Vceq1,Icq1)
+printf("Q2(%f volt,%f ampere)\n",Vceq2,Icq2)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.51/Ch3_51.png b/275/CH3/EX3.3.51/Ch3_51.png Binary files differnew file mode 100755 index 000000000..fab590b17 --- /dev/null +++ b/275/CH3/EX3.3.51/Ch3_51.png diff --git a/275/CH3/EX3.3.52/Ch3_3_52.sce b/275/CH3/EX3.3.52/Ch3_3_52.sce new file mode 100755 index 000000000..fc53fa44d --- /dev/null +++ b/275/CH3/EX3.3.52/Ch3_3_52.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 3.52")
+printf("\n")
+disp(" Find Ic & Vce. Draw a DC load line for the base bias circuit")
+printf("Given\n")
+//given
+betadc=100
+Vbe=0.7
+Rc=10^3
+Rb=10^5
+Vb=5
+Vc=10
+//to find Ib
+Ib=(Vb-Vbe)/Rb //from ciruit
+//Ic value
+Icq=betadc*Ib
+//Vce value
+Vceq=Vc-(Icq*Rc)
+//to draw DC load line
+Ic1=Vc/Rc
+Vce1=Vc
+Vce=[Vc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.52/Ch3_52.png b/275/CH3/EX3.3.52/Ch3_52.png Binary files differnew file mode 100755 index 000000000..10daffe17 --- /dev/null +++ b/275/CH3/EX3.3.52/Ch3_52.png diff --git a/275/CH3/EX3.3.53/Ch3_3_53.sce b/275/CH3/EX3.3.53/Ch3_3_53.sce new file mode 100755 index 000000000..5c9ef4030 --- /dev/null +++ b/275/CH3/EX3.3.53/Ch3_3_53.sce @@ -0,0 +1,27 @@ +clc
+disp("Example 3.53")
+printf("\n")
+disp(" Find Ic & Vce. Draw a DC load line for the base bias circuit")
+printf("Given\n")
+//given
+betadc=50
+Vbe=0.7
+Rc=2.2*10^3
+Rb=240*10^3
+Vc=12
+//to find Ib
+Ib=(Vc-Vbe)/Rb //from ciruit
+//Ic value
+Icq=betadc*Ib
+//Vce value
+Vceq=Vc-(Icq*Rc)
+//to draw DC load line
+Ic1=Vc/Rc
+Vce1=Vc
+Vce=[Vc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.53/Ch3_53.png b/275/CH3/EX3.3.53/Ch3_53.png Binary files differnew file mode 100755 index 000000000..4599b7fae --- /dev/null +++ b/275/CH3/EX3.3.53/Ch3_53.png diff --git a/275/CH3/EX3.3.54/Ch3_3_54.sce b/275/CH3/EX3.3.54/Ch3_3_54.sce new file mode 100755 index 000000000..0747348cc --- /dev/null +++ b/275/CH3/EX3.3.54/Ch3_3_54.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 3.54")
+printf("\n")
+disp(" Draw a DC load line for the base bias circuit neglecting Vbe")
+printf("Given\n")
+//given
+betadc=100
+Rc=5*10^3
+Rb=1.5*10^6
+Vc=30
+//to find Ib
+Ib=Vc/Rb //from ciruit
+//Ic value
+Icq=betadc*Ib
+//Vce value
+Vceq=Vc-(Icq*Rc)
+//to draw DC load line
+Ic1=Vc/Rc
+Vce1=Vc
+Vce=[Vc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.54/Ch3_54.png b/275/CH3/EX3.3.54/Ch3_54.png Binary files differnew file mode 100755 index 000000000..f471d2653 --- /dev/null +++ b/275/CH3/EX3.3.54/Ch3_54.png diff --git a/275/CH3/EX3.3.55/Ch3_3_55.sce b/275/CH3/EX3.3.55/Ch3_3_55.sce new file mode 100755 index 000000000..351c6d536 --- /dev/null +++ b/275/CH3/EX3.3.55/Ch3_3_55.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 3.55")
+printf("\n")
+disp("Calculate transistor hFE & new Vce level for hFE=100 of base bias ciruit")
+printf("Given\n")
+//given
+Vcc=24
+Rb=390*10^3
+Rc=3.3*10^3
+Vce=10
+//Find Ic
+Ic=(Vcc-Vce)/Rc //from circuit
+//find Ib
+Ib=(Vcc-Vbe)/Rb //from ciruit
+//the value of hFE
+hFE=Ic/Ib
+//to find Vce when hFE=100
+hFE1=100
+Ic1=hFE1*Ib
+Vce1=Vcc-(Ic1*Rc)
+printf("Value of hFE is \n%f\n",hFE)
+printf("New value of Vce is \n%f volt\n",Vce1)
diff --git a/275/CH3/EX3.3.57/Ch3_3_57.sce b/275/CH3/EX3.3.57/Ch3_3_57.sce new file mode 100755 index 000000000..6a6f5f01f --- /dev/null +++ b/275/CH3/EX3.3.57/Ch3_3_57.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 3.57")
+printf("\n")
+disp("Design a Base bias circuit")
+printf("Given\n")
+//given
+Vce=5
+Ic=5*10^-3
+Vcc=15
+hFE=100
+//Value of Rc
+Rc=(Vcc-Vce)/Ic
+Ib=Ic/hFE
+//value of Rb
+Vbe=0.7
+Rb=(Vcc-Vbe)/Ib
+printf("The value of Rc=%f ohm\nRb=%f ohm\n",Rc,Rb)
+
diff --git a/275/CH3/EX3.3.58/Ch3_3_58.sce b/275/CH3/EX3.3.58/Ch3_3_58.sce new file mode 100755 index 000000000..a60716fc7 --- /dev/null +++ b/275/CH3/EX3.3.58/Ch3_3_58.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 3.58")
+printf("\n")
+disp("Draw the DC load line & determine Rc for base bias circuit")
+printf("Given\n")
+//given
+Vcc=18
+Vbe=0.7
+Vceq=9
+Icq=2*10^-3
+//to find Rc
+Rc=(Vcc-Vceq)/Icq //from circuit
+//to draw DC load line
+Ic1=Vcc/Rc
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.58/Ch3_58.png b/275/CH3/EX3.3.58/Ch3_58.png Binary files differnew file mode 100755 index 000000000..3f0d971e7 --- /dev/null +++ b/275/CH3/EX3.3.58/Ch3_58.png diff --git a/275/CH3/EX3.3.59/Ch3_3_59.sce b/275/CH3/EX3.3.59/Ch3_3_59.sce new file mode 100755 index 000000000..465f5bd63 --- /dev/null +++ b/275/CH3/EX3.3.59/Ch3_3_59.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 3.59")
+printf("\n")
+disp("Calculate Base resistance for base bias circuit")
+printf("Given\n")
+//given
+Vcc=20
+Vce=5
+Rc=6.8*10^3
+hFE=120
+Vbe=0.7
+//collector current
+Ic=(Vcc-Vce)/Rc
+//base current
+Ib=Ic/hFE
+//the required base resistance
+Rb=(Vcc-Vbe)/Ib
+printf("The base resistance \n%f ohm\n",Rb)
diff --git a/275/CH3/EX3.3.61/Ch3_3_61.sce b/275/CH3/EX3.3.61/Ch3_3_61.sce new file mode 100755 index 000000000..daa043f39 --- /dev/null +++ b/275/CH3/EX3.3.61/Ch3_3_61.sce @@ -0,0 +1,27 @@ +clc
+disp("Example 3.61")
+printf("\n")
+disp("Determine the Ic & Vce levels & draw DC load line for Collector to base bias")
+printf("Given\n")
+//given
+Vcc=15
+Vbe=0.7
+hFE=50
+Rc=1.8*10^3
+Rb=39*10^3
+//base current
+Ib=(Vcc-Vbe)/(Rb+(1+hFE)*Rc)
+//collector current
+Icq=hFE*Ib
+//value of Vce
+Vceq=(Ib*Rb)+Vbe
+//to draw DC load line
+Ic1=Vcc/Rc
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
+
diff --git a/275/CH3/EX3.3.61/Ch3_61.png b/275/CH3/EX3.3.61/Ch3_61.png Binary files differnew file mode 100755 index 000000000..ef59412ba --- /dev/null +++ b/275/CH3/EX3.3.61/Ch3_61.png diff --git a/275/CH3/EX3.3.62/Ch3_3_62.sce b/275/CH3/EX3.3.62/Ch3_3_62.sce new file mode 100755 index 000000000..a38143d49 --- /dev/null +++ b/275/CH3/EX3.3.62/Ch3_3_62.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 3.62")
+printf("\n")
+disp("Determine the hFE and new Vce for hFE=50 for Collector to base bias")
+printf("Given\n")
+//given
+Vcc=15
+Vce=5
+Vbe=0.7
+Rb=82*10^3
+Rc=5.6*10^3
+//base current
+Ib=(Vce-Vbe)/Rb
+//hFE value
+hFE=((Vcc-Vbe)/(Ib*Rc))-(Rb/Rc)-1
+//to find Vce for hFE=50
+hFE1=50
+Ib1=(Vcc-Vbe)/(Rb+(1+hFE1)*Rc)
+Vce1=(Ib1*Rb)+Vbe
+printf("The hFE is \n%f\n",hFE)
+printf("new Vce is \n%fvolt \n",Vce1)
diff --git a/275/CH3/EX3.3.63/Ch3_3_63.sce b/275/CH3/EX3.3.63/Ch3_3_63.sce new file mode 100755 index 000000000..6d7964408 --- /dev/null +++ b/275/CH3/EX3.3.63/Ch3_3_63.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 3.63")
+printf("\n")
+disp("Draw a DC load line for Collector to base bias")
+printf("Given\n")
+//given
+Vcc=20
+Vbe=0.7
+hFE=50
+Rc=1.8*10^3
+Rb=39*10^3
+//base current
+Ib=(Vcc-Vbe)/(Rb+(1+hFE)*Rc)
+//collector current
+Icq=hFE*Ib
+//to find Vce
+Vceq=(Ib*Rb)+Vbe
+//to draw DC load line
+Ic1=Vcc/Rc
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f,%f)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce")
+ylabel("Ic")
+xtitle("DC load line for base bias circuit")
\ No newline at end of file diff --git a/275/CH3/EX3.3.63/Ch3_63.png b/275/CH3/EX3.3.63/Ch3_63.png Binary files differnew file mode 100755 index 000000000..7b201920c --- /dev/null +++ b/275/CH3/EX3.3.63/Ch3_63.png diff --git a/275/CH3/EX3.3.64/Ch3_3_64.sce b/275/CH3/EX3.3.64/Ch3_3_64.sce new file mode 100755 index 000000000..206e0088a --- /dev/null +++ b/275/CH3/EX3.3.64/Ch3_3_64.sce @@ -0,0 +1,36 @@ +clc
+disp("Example 3.64")
+printf("\n")
+disp("Draw a DC load line for Collector to base bias for different hFE")
+printf("Given\n")
+//given
+Vcc=18
+Vbe=0.7
+hFE1=50
+hFE2=200
+Rc=2.2*10^3
+Rb=270*10^3
+//for hFE=50
+//base current
+Ib1=(Vcc-Vbe)/(Rb+(1+hFE1)*Rc)
+//collector current
+Icq1=hFE1*Ib1
+//to find Vce
+Vceq1=(Ib1*Rb)+Vbe
+//for hFE=200
+//base current
+Ib2=(Vcc-Vbe)/(Rb+(1+hFE2)*Rc)
+//collector current
+Icq2=hFE2*Ib2
+//to find Vce
+Vceq2=(Ib2*Rb)+Vbe
+//to draw DC load line
+Ic1=Vcc/Rc
+Vce=[Vcc Vceq1 Vceq2 0]
+Ic=[0 Icq1 Icq2 Ic1]
+printf("Q1(%f volt,%f ampere)\n",Vceq1,Icq1)
+printf("Q2(%f volt,%f ampere)\n",Vceq2,Icq2)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.64/Ch3_64.png b/275/CH3/EX3.3.64/Ch3_64.png Binary files differnew file mode 100755 index 000000000..77598e49c --- /dev/null +++ b/275/CH3/EX3.3.64/Ch3_64.png diff --git a/275/CH3/EX3.3.66/Ch3_3_66.sce b/275/CH3/EX3.3.66/Ch3_3_66.sce new file mode 100755 index 000000000..c5f0164ca --- /dev/null +++ b/275/CH3/EX3.3.66/Ch3_3_66.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 3.66")
+printf("\n")
+disp("Design a Collector to base bias circuit")
+printf("Given\n")
+//Given
+Vce=5
+Ic=5*10^-3
+Vbe=0.7
+Vcc=15
+hFE=100
+//base current
+Ib=Ic/hFE
+//collector resistance
+Rc=(Vcc-Vce)/(Ic+Ib)
+//base resistance
+Rb=(Vce-Vbe)/Ib
+printf("base current %f ampere \n",Ib)
+printf("Collector resistance %f ohm \n",Rc)
+printf("base resistance %f ohm \n",Rb)
\ No newline at end of file diff --git a/275/CH3/EX3.3.67/Ch3_3_67.sce b/275/CH3/EX3.3.67/Ch3_3_67.sce new file mode 100755 index 000000000..6cd3df931 --- /dev/null +++ b/275/CH3/EX3.3.67/Ch3_3_67.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 3.67")
+printf("\n")
+disp("Design a Collector to base bias circuit")
+printf("Given\n")
+//Given
+Vce=10
+Ic=3*10^-3
+Vbe=0.7
+Vcc=25
+hFE=80
+//base current
+Ib=Ic/hFE
+//collector resistance
+Rc=(Vcc-Vce)/(Ic+Ib)
+//base current
+Rb=(Vce-Vbe)/Ib
+printf("base current %f ampere \n",Ib)
+printf("Collector resistance %f ohm \n",Rc)
+printf("base resistance %f ohm \n",Rb)
\ No newline at end of file diff --git a/275/CH3/EX3.3.68/Ch3_3_68.sce b/275/CH3/EX3.3.68/Ch3_3_68.sce new file mode 100755 index 000000000..a671277e3 --- /dev/null +++ b/275/CH3/EX3.3.68/Ch3_3_68.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 3.68")
+printf("\n")
+disp("Calculate required base resistance for Collector to base bias circuit")
+printf("Given\n")
+//given
+Vcc=30
+Vce=7
+Vbe=0.7
+Rc=8.2*10^3
+hFE=100
+//base current
+Ib=(Vcc-Vce)/(Rc*(1+hFE))
+//base resistance
+Rb=(Vce-Vbe)/Ib
+printf("base resistance is \n%f ohm\n",Rb)
diff --git a/275/CH3/EX3.3.72/Ch3_3_72.sce b/275/CH3/EX3.3.72/Ch3_3_72.sce new file mode 100755 index 000000000..9b7b82e98 --- /dev/null +++ b/275/CH3/EX3.3.72/Ch3_3_72.sce @@ -0,0 +1,33 @@ +clc
+disp("Example 3.72")
+printf("\n")
+disp("Draw a DC load line for Voltage divider circuit")
+printf("Given\n")
+//given
+Vcc=15
+Rc=2.7*10^3
+Re=2.2*10^3
+R1=22*10^3
+R2=12*10^3
+Vbe=0.7
+//base voltage
+Vb=(Vcc*R2)/(R1+R2)
+//emitter voltage
+Ve=Vb-Vbe
+//emitter current
+Ie=Ve/Re
+//collector current
+Icq=Ie
+//collector to emitter voltage
+Vceq=Vcc-(Icq*(Rc+Re))
+//collector voltage
+Vc=Vce+Ve
+//to draw DC load line
+Ic1=Vcc/(Rc+Re)
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.72/Ch3_72.png b/275/CH3/EX3.3.72/Ch3_72.png Binary files differnew file mode 100755 index 000000000..2c8932e05 --- /dev/null +++ b/275/CH3/EX3.3.72/Ch3_72.png diff --git a/275/CH3/EX3.3.73/Ch3_3_73.sce b/275/CH3/EX3.3.73/Ch3_3_73.sce new file mode 100755 index 000000000..1b299caa6 --- /dev/null +++ b/275/CH3/EX3.3.73/Ch3_3_73.sce @@ -0,0 +1,38 @@ +clc
+disp("Example 3.73")
+printf("\n")
+disp("Find the Ve, Ic,Vce & Vc. Draw a DC load line for Voltage divider circuit")
+printf("Given\n")
+//given
+Vcc=18
+Vbe=0.7
+hFE=50
+R1=33*10^3
+R2=12*10^3
+Rc=1.2*10^3
+Re=10^3
+//thevenin voltage
+Vt=(Vcc*R2)/(R1+R2)
+//thevenin resistance
+Rt=(R1*R2)/(R1+R2)
+//base current
+Ib=(Vt-Vbe)/(Rt+(1+hFE)*Re)
+//collector current
+Icq=hFE*Ib
+//emitter current
+Ie=Ib+Icq
+//emitter voltage
+Ve=Ie*Re
+//collector to emitter voltage
+Vceq=Vcc-(Icq*Rc)-(Ie*Re)
+//collector voltage
+Vc=Vce+Ve
+//to draw DC load line
+Ic1=Vcc/(Rc+Re)
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f volt,%f ampere)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce in volt")
+ylabel("Ic in ampere")
+xtitle("DC load line for base bias circuit")
diff --git a/275/CH3/EX3.3.73/Ch3_73.png b/275/CH3/EX3.3.73/Ch3_73.png Binary files differnew file mode 100755 index 000000000..18d38411d --- /dev/null +++ b/275/CH3/EX3.3.73/Ch3_73.png diff --git a/275/CH3/EX3.3.74/Ch3_3_74.sce b/275/CH3/EX3.3.74/Ch3_3_74.sce new file mode 100755 index 000000000..a34f72ed9 --- /dev/null +++ b/275/CH3/EX3.3.74/Ch3_3_74.sce @@ -0,0 +1,38 @@ +clc
+disp("Example 3.74")
+printf("\n")
+disp("Find the Ve, Ic,Vce & Vc. Draw a DC load line for Voltage divider circuit")
+printf("Given\n")
+//given
+Vcc=15
+Vbe=0.7
+hFE=50
+R1=6.8*10^3
+R2=3.3*10^3
+Rc=0.9*10^3
+Re=0.9*10^3
+//thevenin voltage
+Vt=(Vcc*R2)/(R1+R2)
+//thevenin resistance
+Rt=(R1*R2)/(R1+R2)
+//base current
+Ib=(Vt-Vbe)/(Rt+(1+hFE)*Re)
+//collector current
+Icq=hFE*Ib
+//emitter current
+Ie=Ib+Icq
+//emitter voltage
+Ve=Ie*Re
+//collector to emitter voltage
+Vceq=Vcc-(Icq*Rc)-(Ie*Re)
+//collector voltage
+Vc=Vce+Ve
+//to draw DC load line
+Ic1=Vcc/(Rc+Re)
+Vce=[Vcc Vceq 0]
+Ic=[0 Icq Ic1]
+printf("Q(%f,%f)\n",Vceq,Icq)
+plot2d(Vce, Ic)
+xlabel("Vce")
+ylabel("Ic")
+xtitle("DC load line for base bias circuit")
\ No newline at end of file diff --git a/275/CH3/EX3.3.74/Ch3_74.png b/275/CH3/EX3.3.74/Ch3_74.png Binary files differnew file mode 100755 index 000000000..d5906b298 --- /dev/null +++ b/275/CH3/EX3.3.74/Ch3_74.png diff --git a/275/CH3/EX3.3.76/Ch3_3_76.sce b/275/CH3/EX3.3.76/Ch3_3_76.sce new file mode 100755 index 000000000..96a164119 --- /dev/null +++ b/275/CH3/EX3.3.76/Ch3_3_76.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 3.76")
+printf("\n")
+disp("Design a Voltage divider bias circuit")
+printf("Given\n")
+//given
+Vce=5
+Ve=Vce
+Ic=5*10^-3
+Vcc=15
+hFE=100
+Vbe=0.7
+//emitter resistance
+Re=Ve/Ic
+//collector resistance
+Rc=(Vcc-Vce-Ve)/Ic
+//current through resistor R2
+I2=Ic/10
+//base voltage
+Vb=Vbe+Ve
+//resistance 1
+R1=(Vcc-Vb)/I2
+//resistance 2
+R2=Vb/I2
+printf("Collector resistance %f ohm \n",Rc)
+printf("emitter resistance %f ohm \n",Re)
+printf("base voltage %f volt \n",Vb)
+printf("voltage divider resistance R1 & R2 %f ohm\n %f ohm\n",R1,R2)
diff --git a/275/CH3/EX3.3.77/Ch3_3_77.sce b/275/CH3/EX3.3.77/Ch3_3_77.sce new file mode 100755 index 000000000..149092ce9 --- /dev/null +++ b/275/CH3/EX3.3.77/Ch3_3_77.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 3.77")
+printf("\n")
+disp("Design a Voltage divider bias circuit")
+printf("Given\n")
+//given
+Vce=3
+Ve=5
+Ic=10^-3
+Vcc=12
+Vbe=0.7
+//emitter resistance
+Re=Ve/Ic
+//collector resistance
+Rc=(Vcc-Vce-Ve)/Ic
+//current through resistor R2
+I2=Ic/10
+//base voltage
+Vb=Vbe+Ve
+//resistance 1
+R1=(Vcc-Vb)/I2
+//resistance 2
+R2=Vb/I2
+printf("Collector resistance %f ohm \n",Rc)
+printf("emitter resistance %f ohm \n",Re)
+printf("base voltage %f volt \n",Vb)
+printf("voltage divider resistance R1 & R2 %f ohm\n %f ohm\n",R1,R2)
+
diff --git a/275/CH3/EX3.3.79/Ch3_3_79.sce b/275/CH3/EX3.3.79/Ch3_3_79.sce new file mode 100755 index 000000000..b0d9d4741 --- /dev/null +++ b/275/CH3/EX3.3.79/Ch3_3_79.sce @@ -0,0 +1,32 @@ +clc
+disp("Example 3.79")
+printf("\n")
+disp("Calculate the suitable resistor values for Voltage divider bias circuit")
+printf("Given\n")
+printf("1 Resistance are in ohms \n2 Current are in ampere \n3 voltage sources are in volt")
+//given
+Vcc=20
+Vce=8
+hFE=80
+Vbe=0.7
+Rc=6*10^3
+//select Ve
+Ve=5
+//find collector resistor
+Ic=(Vcc-Vce-Ve)/Rc
+//find I2
+I2=Ic/10
+//emitter resistance
+Re=Ve/Ic
+//base voltage
+Vb=Vbe+Ve
+//resistance R1
+R1=(Vcc-Vb)/I2
+//resistance R2
+R2=Vb/I2
+printf("Collector resistance %f ohm \n",Rc)
+printf("emitter resistance %f ohm \n",Re)
+printf("base voltage %f volt \n",Vb)
+printf("voltage divider resistance R1 & R2 %f ohm\n %f ohm\n",R1,R2)
+
+
diff --git a/275/CH3/EX3.3.85/Ch3_3_85.sce b/275/CH3/EX3.3.85/Ch3_3_85.sce new file mode 100755 index 000000000..e01150cfa --- /dev/null +++ b/275/CH3/EX3.3.85/Ch3_3_85.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 3.85")
+printf("\n")
+disp("Find the stability factor & change in Ic for increase in temperature of base bias circuit")
+printf("Given\n")
+//given
+hFE=100
+Rc=2.2*10^3
+Rb=470*10^3
+Icbo1=15*10^-9
+T1=25
+T2=105
+//stability factor
+S=1+hFE
+//Change in collector to base reverse saturation current(delIcbo)
+n=(T2-T1)/10
+Icbo2=Icbo1*2^8
+delIcbo=Icbo2-Icbo1
+//Change in Ic for increase in temperature
+delIc=S*delIcbo
+printf("Stability factor is \n%f\n",S)
+printf("the change in collector current is \n%f ampere\n",delIc)
diff --git a/275/CH3/EX3.3.86/Ch3_3_86.sce b/275/CH3/EX3.3.86/Ch3_3_86.sce new file mode 100755 index 000000000..0d40146ed --- /dev/null +++ b/275/CH3/EX3.3.86/Ch3_3_86.sce @@ -0,0 +1,22 @@ +clc
+disp("Example 3.86")
+printf("\n")
+disp("Find the stability factor & change in Ic for increase in temperature of collector to base bias circuit")
+printf("Given\n")
+//given
+hFE=100
+Rc=2.2*10^3
+Rb=270*10^3
+Icbo1=15*10^-9
+T1=25
+T2=105
+//stability factor
+S=(1+hFE)/(1+((hFE*Rc)/(Rc+Rb)))
+//Change in collector to base reverse saturation current(delIcbo)
+n=(T2-T1)/10
+Icbo2=Icbo1*2^8
+delIcbo=Icbo2-Icbo1
+//Change in Ic for increase in temperature
+delIc=S*delIcbo
+printf("stability factor %f \n",S)
+printf("change in Ic %f ampere\n",delIc)
\ No newline at end of file diff --git a/275/CH3/EX3.3.87/Ch3_3_87.sce b/275/CH3/EX3.3.87/Ch3_3_87.sce new file mode 100755 index 000000000..893370c62 --- /dev/null +++ b/275/CH3/EX3.3.87/Ch3_3_87.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 3.87")
+printf("\n")
+disp("Find the stability factor & change in Ic for increase in temperature of Voltage divider bias circuit")
+printf("Given\n")
+//given
+hFE=100
+Rc=1.2*10^3
+R1=33*10^3
+R2=12*10^3
+Re=10^3
+Icbo1=15*10^-9
+T1=25
+T2=105
+//thevenin resistance
+Rt=(R1*R2)/(R1+R2)
+//stability factor
+S=(1+hFE)/(1+((hFE*Re)/(Re+Rt)))
+//Change in collector to base reverse saturation current(delIcbo)
+n=(T2-T1)/10
+Icbo2=Icbo1*2^8
+delIcbo=Icbo2-Icbo1
+//Change in Ic for increase in temperature
+delIc=S*delIcbo
+printf("stability factor %f \n",S)
+printf("change in Ic %f ampere\n",delIc)
\ No newline at end of file diff --git a/275/CH3/EX3.3.89/Ch3_3_89.sce b/275/CH3/EX3.3.89/Ch3_3_89.sce new file mode 100755 index 000000000..c5f927cfe --- /dev/null +++ b/275/CH3/EX3.3.89/Ch3_3_89.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 3.89")
+printf("\n")
+disp("Calculate the change in Ic produced by effect of Vbe changes over temperature of Voltage divider bias circuit")
+printf("Given\n")
+//given
+Re=4.7*10^3
+T1=25
+T2=125
+//change in temperature
+delT=T2-T1
+//change in Vbe
+delVbe=delT*(-1.8*10^-3) //change in Vbe for 1C raise in temperature=-1.8mV/C
+//change in Ic
+delIc=-delVbe/Re
+printf("change in Ic %f ampere\n",delIc)
\ No newline at end of file diff --git a/275/CH3/EX3.3.90/Ch3_3_90.sce b/275/CH3/EX3.3.90/Ch3_3_90.sce new file mode 100755 index 000000000..100d6a721 --- /dev/null +++ b/275/CH3/EX3.3.90/Ch3_3_90.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 3.90")
+printf("\n")
+disp("Calculate the change in Ic produced by effect of Vbe changes over temperature of Voltage divider bias circuit")
+printf("Given\n")
+//given
+Re=4.7*10^3
+T1=-35
+T2=100
+//change in temperature
+delT=T2-T1
+//change in Vbe
+delVbe=delT*(-1.8*10^-3) //change in Vbe for 1C raise in temperature=-1.8mV/C
+//change in Ic
+delIc=-delVbe/Re
+printf("The change in IC is \n%f ampere\n",delIc)
diff --git a/275/CH4/EX4.4.18/Ch4_4_18.sce b/275/CH4/EX4.4.18/Ch4_4_18.sce new file mode 100755 index 000000000..a8bced337 --- /dev/null +++ b/275/CH4/EX4.4.18/Ch4_4_18.sce @@ -0,0 +1,24 @@ +clc
+disp("Example 4.18")
+printf("\n")
+disp("Calculate input voltage that turns SCR ON, & find supply voltage that turns SCR OFF if holding current is 10mA")
+printf("Given\n")
+printf("Resistance are in ohms \nCurrent are in Ampere \n Voltage sources are in volt\n")
+//gate trigger voltage
+Vgt=0.75
+//trigger current
+Igt=5*10^-3
+//gate resistance
+Rg=1000
+//load resistance
+RL=100
+//diode forward voltage
+Vf=0.7
+//holding current
+Ih=10*10^-3
+//minimum input voltage to trigger the SCR is
+Vin=Vgt+(Igt*Rg)
+//The supply voltage that turns OFF the SCR is
+VCC=Vf+(Ih*RL)
+printf("minimum input voltage to trigger the SCR is %f volt \n",Vin)
+printf("The supply voltage that turns OFF the SCR is %f volt \n",VCC)
diff --git a/275/CH4/EX4.4.28/Ch4_4_28.sce b/275/CH4/EX4.4.28/Ch4_4_28.sce new file mode 100755 index 000000000..538640f33 --- /dev/null +++ b/275/CH4/EX4.4.28/Ch4_4_28.sce @@ -0,0 +1,38 @@ +clc
+disp("Example 4.28")
+printf("\n")
+disp("Calculate suitable values of R1,Rp,R2 for SCR in circuit Fig 4.12")
+printf("Given\n")
+printf("Resistance are in ohms \nCurrent are in Ampere \n Voltage sources are in volt\n")
+//gate current
+Ig=250*10^-6
+//gate trigger voltage
+Vgt=0.75
+Vd=0.7
+//supply voltage
+Vs=40
+//peak value of supply voltage
+Vm=sqrt(2)*Vs
+//supply voltage at angle 10deg
+Vs1=Vm*sin(10*%pi/180)
+//supply voltage at angle 90deg
+Vs2=Vm*sin(90*%pi/180)
+Vt=Vd+Vgt
+//to trigger SCR at 10deg moving contact of Rp is at top
+//from circuit
+VR1=Vs1-Vt
+//choose I1min>>Ig
+I1min=1.5*10^-3
+R1=VR1/I1min
+//since Ig<<I1min, current through Rp & R2 is I1min
+RpPLUSR2=Vt/I1min
+//to trigger SCR at 90deg moving contact of Rp is at bottom
+VR2=Vt
+I1=Vs2/(R1+RpPLUSR2)
+R2=Vt/I1
+Rp=RpPLUSR2-R2
+printf("Resistance R1 is %f ohm \n",R1)
+printf("Resistance R2 is %f ohm \n",R2)
+printf("Resistance Rp is %f ohm \n",Rp)
+
+
diff --git a/275/CH4/EX4.4.29/Ch4_4_29.sce b/275/CH4/EX4.4.29/Ch4_4_29.sce new file mode 100755 index 000000000..d961ab69f --- /dev/null +++ b/275/CH4/EX4.4.29/Ch4_4_29.sce @@ -0,0 +1,35 @@ +clc
+disp("Example 4.29")
+printf("\n")
+disp("Calculate suitable values of R1,Rp,R2 for SCR in circuit Fig 4.12")
+printf("Given\n")
+printf("Resistance are in ohms \nCurrent are in Ampere \n Voltage sources are in volt\n")
+//gate current
+Ig=600*10^-6
+//gate trigger voltage
+Vg=0.7
+Vd=0.7
+//supply voltage
+Vs=230
+//peak value of supply voltage
+Vm=sqrt(2)*Vs
+//supply voltage at angle 8deg
+Vs1=Vm*sin(8*%pi/180)
+//supply voltage at angle 90deg
+Vs2=Vm*sin(90*%pi/180)
+//to trigger SCR at 10deg moving contact of Rp is at top
+//from circuit
+VR1=Vs1-Vg
+//choose I1min>>Ig
+I1min=6*10^-3
+R1=VR1/I1min
+//since Ig<<I1min, current through Rp & R2 is I1min
+RpPLUSR2=Vg/I1min
+//to trigger SCR at 90deg moving contact of Rp is at bottom
+VR2=Vt
+I1=Vs2/(R1+RpPLUSR2)
+R2=Vg/I1
+Rp=RpPLUSR2-R2
+printf("Resistance R1 is %f ohm \n",R1)
+printf("Resistance R2 is %f ohm \n",R2)
+printf("Resistance Rp is %f ohm \n",Rp)
diff --git a/275/CH4/EX4.4.40/Ch4_4_40.sce b/275/CH4/EX4.4.40/Ch4_4_40.sce new file mode 100755 index 000000000..b86b1cae1 --- /dev/null +++ b/275/CH4/EX4.4.40/Ch4_4_40.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 4.40")
+printf("\n")
+disp("Design the SCR crowbar circuit to protect the load from voltage levels greater than 12V")
+printf("Given\n")
+//gate trigger voltage
+Vgt=0.75
+//load voltage maximum
+VLmax=12
+//Zener voltage is
+Vz=VLmax-Vgt
+//assume zener current(mini) as
+Izmin=10^-3
+R=Vgt/Izmin
+printf("zener voltage \n%f volt\n",Vz)
+printf("Resistance \n%f ohm\n",R)
diff --git a/275/CH4/EX4.4.41/Ch4_4_41.sce b/275/CH4/EX4.4.41/Ch4_4_41.sce new file mode 100755 index 000000000..6032f4100 --- /dev/null +++ b/275/CH4/EX4.4.41/Ch4_4_41.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 4.41")
+printf("\n")
+disp("Design the SCR crowbar circuit to protect the load from voltage levels greater than 7.5V")
+printf("Given\n")
+//gate trigger voltage
+Vgt=0.7
+//load voltage maximum
+VLmax=7.5
+//Zener voltage is
+Vz=VLmax-Vgt
+//assume zener current(mini) as
+Izmin=10^-3
+R=Vgt/Izmin
+printf("zener voltage \n%f volt\n",Vz)
+printf("Resistance \n%f ohm\n",R)
diff --git a/275/CH4/EX4.4.49/Ch4_4_49.sce b/275/CH4/EX4.4.49/Ch4_4_49.sce new file mode 100755 index 000000000..ad4489e25 --- /dev/null +++ b/275/CH4/EX4.4.49/Ch4_4_49.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 4.49")
+printf("\n")
+disp("Determine the minimum & maximum triggering voltage for a UJT")
+printf("Given\n")
+Vbb=20
+//intrinsic ratios
+nmin=0.6
+nmax=0.8
+V=0.7
+//minimum triggering voltage is
+Vpmini=nmin*Vbb+Vd
+//maximum triggering voltage is
+Vpmax=nmax*Vbb+Vd
+printf("Minimum triggering Voltage \n%f volt\n",Vpmini)
+printf("Maximum triggering Voltage \n%f volt\n",Vpmax)
diff --git a/275/CH4/EX4.4.51/Ch4_4_51.sce b/275/CH4/EX4.4.51/Ch4_4_51.sce new file mode 100755 index 000000000..3e1cc6d7f --- /dev/null +++ b/275/CH4/EX4.4.51/Ch4_4_51.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 4.51")
+printf("\n")
+disp("Calculate minimum & maximum values of Re for the relaxation oscillator & also find maximum oscillating frequency")
+printf("Given\n")
+Vbb=15
+//the parameters of UJT
+Ip=10^-6
+Iv=2.5*10^-3
+Vv=2.5
+n=0.7
+PRe=20*10^3
+C=10^-6
+Vp=12
+Vd=0.7
+Vp1=(n*Vbb)+Vd
+//minimum Re
+Remin=(Vbb-Vv)/Iv
+//maximum Re
+Remax=(Vbb-Vp1)/Ip
+//to find maximum oscillating frequency
+T=PRe*C*log((Vbb-Vv)/(Vbb-Vp))
+f=1/T
+printf("maximum Re \n%f ohm\n",Remax)
+printf("minimum Re \n%f ohm\n",Remin)
+printf("maximum oscillating frequency \n%f hz \n",f)
diff --git a/275/CH4/EX4.4.52/Ch4_4_52.sce b/275/CH4/EX4.4.52/Ch4_4_52.sce new file mode 100755 index 000000000..ce8e1966e --- /dev/null +++ b/275/CH4/EX4.4.52/Ch4_4_52.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 4.52")
+printf("\n")
+disp("Determine the minimum & maximum values of VEB1 for a UJT")
+printf("Given\n")
+Vbb=15
+//intrinsic ratios
+nmin=0.68
+nmax=0.82
+V=0.7
+//mini triggering voltage is
+Vpmini=nmin*Vbb+Vd
+//max triggering voltage is
+Vpmax=nmax*Vbb+Vd
+printf("minimum triggering voltage \n%f volt\n",Vpmini)
+printf("maximum triggering voltage \n%f volt\n",Vpmax)
diff --git a/275/CH4/EX4.4.53/Ch4_4_53.sce b/275/CH4/EX4.4.53/Ch4_4_53.sce new file mode 100755 index 000000000..651a8f419 --- /dev/null +++ b/275/CH4/EX4.4.53/Ch4_4_53.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 4.53")
+printf("\n")
+disp("find maximum oscillating frequency")
+Vbb=20
+//the parameters of UJT
+Ip=10^-6
+Iv=10*10^-3
+Vv=3.5
+n=0.75
+PRe=4.7*10^3
+C=0.5*10^-6
+Vd=0.7
+Vp1=(n*Vbb)+Vd
+//to find maximum oscillating frequency
+T=PRe*C*log((Vbb-Vv)/(Vbb-Vp1))
+f=1/T
+printf("Oscillator frequency \n%f hz\n",f)
diff --git a/275/CH4/EX4.4.74/Ch4_4_74.sce b/275/CH4/EX4.4.74/Ch4_4_74.sce new file mode 100755 index 000000000..1cc566fe6 --- /dev/null +++ b/275/CH4/EX4.4.74/Ch4_4_74.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 4.74")
+printf("\n")
+disp("plot the drain characteristics of JFET")
+//given
+Vds=[0 1 2 2.5 3 4 6 8]
+Id=[0 2 4.5 5.3 5.5 5.5 5.5 5.5]
+plot2d(Vds,Id)
+xlabel("Vds(V)")
+ylabel("Id(mA)")
+xtitle("Plot of Vds V/s Id")
\ No newline at end of file diff --git a/275/CH4/EX4.4.74/Ch4_74.png b/275/CH4/EX4.4.74/Ch4_74.png Binary files differnew file mode 100755 index 000000000..d70c5f67b --- /dev/null +++ b/275/CH4/EX4.4.74/Ch4_74.png diff --git a/275/CH4/EX4.4.77/Ch4_4_77.sce b/275/CH4/EX4.4.77/Ch4_4_77.sce new file mode 100755 index 000000000..8ab28c5e0 --- /dev/null +++ b/275/CH4/EX4.4.77/Ch4_4_77.sce @@ -0,0 +1,28 @@ +clc
+disp("Example 4.77")
+printf("\n")
+disp("calculate Vds at these gate_source voltages & circuit voltage gain of JFET")
+printf("Given\n")
+//drain current
+Id=9*10^-3
+//gate to source voltage
+Vgs=(-2)
+//when Vgs is reduced to -1V then Id is 12mA
+Vgs1=-1
+Id1=12*10^-3
+//from circuit (fig 4.49)
+Rd=1.5*10^3
+Vdd=20
+//to find Vds
+//when Vgs=-2
+Vds=Vdd-(Id*Rd)
+//when Vgs=-1
+Vds1=Vdd-(Id1*Rd)
+//change in input voltage Vgs is
+delVi=Vgs1-Vgs
+//change in output voltage is
+delVo=Vds-Vds1
+//Voltage gain
+Av=delVo/delVi
+printf("The value of Vds at gate-source voltages is \n%f volt\n",Vds)
+printf("The circuit voltage gain \n%f\n",Av)
diff --git a/275/CH4/EX4.4.78/Ch4_4_78.sce b/275/CH4/EX4.4.78/Ch4_4_78.sce new file mode 100755 index 000000000..11ca90ec5 --- /dev/null +++ b/275/CH4/EX4.4.78/Ch4_4_78.sce @@ -0,0 +1,25 @@ +clc
+disp("Example 4.78")
+printf("\n")
+disp("calculate the minimum & maximum variation in the drain source voltage Vds produced by a change of 0.1V & circuit voltage gain of JFET")
+printf("Given\n")
+//transconductance
+gmmax=5000*10^-6
+gmmin=1500*10^-6
+//change in gate to source voltage
+delVgs=0.1
+Rd=1.5*10^3
+//the maximum change in drain current
+delIdmax=gmmax*delVgs
+delVdsmax=delIdmax*Rd
+//voltage gain
+Av1=delVdsmax/delVgs
+//the minimum change in drain current
+delIdmin=gmmin*delVgs
+delVdsmin=delIdmin*Rd
+//voltage gain
+Av2=delVdsmin/delVgs
+printf("maximum change in drain voltage is %f volt\n",delVdsmax)
+printf("maximum voltage gain %f \n",Av1)
+printf("minimum change in drain voltage is %f volt\n",delVdsmin)
+printf("minimum voltage gain %f \n",Av2)
\ No newline at end of file diff --git a/275/CH4/EX4.4.79/Ch4_4_79.sce b/275/CH4/EX4.4.79/Ch4_4_79.sce new file mode 100755 index 000000000..67ad10588 --- /dev/null +++ b/275/CH4/EX4.4.79/Ch4_4_79.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 4.79")
+printf("\n")
+disp("calculate transconductance of JFET")
+printf("Given\n")
+//voltage gain
+Av=20
+//drain resistance
+Rd=3.3*10^3
+//transconductance
+gm=Av/Rd
+printf("Transconductance of JFET \n%f (1/ohm)\n",gm)
diff --git a/275/CH4/EX4.4.80/Ch4_4_80.sce b/275/CH4/EX4.4.80/Ch4_4_80.sce new file mode 100755 index 000000000..1525c9ab2 --- /dev/null +++ b/275/CH4/EX4.4.80/Ch4_4_80.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 4.80")
+printf("\n")
+disp("determine the suitable value of load resistor Rd of JFET")
+printf("Given\n")
+//voltage gain
+Av=10
+//transconductance
+gm=4500*10^-6
+//load resistance
+Rd=Av/gm
+printf("load resistance \n%f ohm \n",Rd)
diff --git a/275/CH5/EX5.5.10/Ch5_5_10.sce b/275/CH5/EX5.5.10/Ch5_5_10.sce new file mode 100755 index 000000000..903318ed3 --- /dev/null +++ b/275/CH5/EX5.5.10/Ch5_5_10.sce @@ -0,0 +1,19 @@ +clc
+disp("Example 5.10")
+printf("\n")
+disp("Calculate overall voltage gain in db & output voltage when input voltage is 1uV for cascaded amplifier")
+printf("Given\n")
+//Voltage gain of amplifier
+Av1=10
+Av2=100
+Av3=1000
+//input voltage
+Vi=10^-6
+//overall voltage gain
+Av=Av1*Av2*Av3
+//in db
+Avdb=20*log10(Av)
+//output voltage when input voltage is 10^-6V
+Vo=Av*Vi
+printf("overall voltage gain in dB \n%f dB\n",Avdb)
+printf("output voltage \n%f volt\n",Vo)
diff --git a/275/CH5/EX5.5.11/Ch5_5_11.sce b/275/CH5/EX5.5.11/Ch5_5_11.sce new file mode 100755 index 000000000..4d9c0ca28 --- /dev/null +++ b/275/CH5/EX5.5.11/Ch5_5_11.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 5.11")
+printf("\n")
+disp("Calculate overall voltage gain in db of cascaded 2 stage amplifier")
+printf("Given\n")
+//Voltage gain
+Av1=10
+Av2=20
+//overall voltage gain
+Av=Av1*Av2
+//in db
+Avdb=20*log10(Av)
+printf("Overall gain is \n%f dB\n",Avdb)
diff --git a/275/CH5/EX5.5.12/Ch5_5_12.sce b/275/CH5/EX5.5.12/Ch5_5_12.sce new file mode 100755 index 000000000..cf02c1dc7 --- /dev/null +++ b/275/CH5/EX5.5.12/Ch5_5_12.sce @@ -0,0 +1,32 @@ +clc
+disp("Example 5.12")
+printf("\n")
+disp("Calculate overall voltage gain ,gain of 2nd & 3rd stage,input voltage of 2nd stage & all in db of three stage amplifier")
+printf("Given\n")
+//input voltage
+Vi=0.05
+//output voltage
+Vo=150
+//voltage gain of 1st stage
+Av1=20
+//input to 3rd stage
+V2=15
+//overall voltage gain
+Av=Vo/Vi
+//input to 2nd stage
+V1=Av1*Vi
+//voltage gain of 2nd stage
+Av2=V2/V1
+//voltage gain of 3rd stage
+Av3=Vo/V2
+//all stages gain in db
+Av1db=20*log10(Av1)
+Av2db=20*log10(Av2)
+Av3db=20*log10(Av3)
+//overall gain in db
+Av=Av1db+Av2db+Av3db
+printf("overall voltage gain \n%f\n",Av)
+printf("voltage gain of 2nd & 3rd stages \n%f\n%f\n",Av2,Av3)
+printf("input voltage of 2nd stage \n%f volt\n",V1)
+printf("Decibal voltage gain of 1st, 2nd, 3rd stage \n%fdB\n%fdB\n%fdB\n",Av1db,Av2db,Av3db)
+printf("Overall gain in db \n%f dB\n",Av)
diff --git a/275/CH5/EX5.5.15/Ch5_5_15.sce b/275/CH5/EX5.5.15/Ch5_5_15.sce new file mode 100755 index 000000000..0983b8deb --- /dev/null +++ b/275/CH5/EX5.5.15/Ch5_5_15.sce @@ -0,0 +1,24 @@ +clc
+disp("Example 5.15")
+printf("\n")
+disp("For CE amplifier shown in fig 5.5 find R1,R2,Re & Rc")
+printf("Given\n")
+Vcc=24
+//load resistance
+RL=120*10^3
+//since Rc<<RL
+Rc=RL/10
+//select Ve & Vce
+Ve=5
+Vce=3
+Vrc=Vcc-Vce-Ve //from circuit
+Ic=Vrc/Rc
+//find Re
+Re=Ve/Ic
+R2=10*Re
+//Vbe for si transistor
+Vbe=0.7
+Vb=Vbe+Ve
+I2=Vb/R2
+R1=(Vcc-Vb)/I2
+printf("The resistance values are\nR1=%f ohm\nR2=%f ohm\nRe=%f ohm\nRc=%f ohm\n",R1,R2,Re,Rc)
diff --git a/275/CH5/EX5.5.16/Ch5_5_16.sce b/275/CH5/EX5.5.16/Ch5_5_16.sce new file mode 100755 index 000000000..66162069d --- /dev/null +++ b/275/CH5/EX5.5.16/Ch5_5_16.sce @@ -0,0 +1,24 @@ +clc
+disp("Example 5.16")
+printf("\n")
+disp("For CE amplifier shown in fig 5.5 find R1,R2,Re & Rc")
+printf("Given\n")
+Vcc=18
+//load resistance
+RL=56*10^3
+//since Rc<<RL
+Rc=RL/10
+//select Ve & Vce
+Ve=5
+Vce=3
+Vrc=Vcc-Vce-Ve //from circuit
+Ic=Vrc/Rc
+//find Re
+Re=Ve/Ic
+R2=10*Re
+//Vbe for si transistor
+Vbe=0.7
+Vb=Vbe+Ve
+I2=Vb/R2
+R1=(Vcc-Vb)/I2
+printf("The resistance values are\nR1=%f ohm\nR2=%f ohm\nRe=%f ohm\nRc=%f ohm\n",R1,R2,Re,Rc)
diff --git a/275/CH5/EX5.5.19/Ch5_5_19.sce b/275/CH5/EX5.5.19/Ch5_5_19.sce new file mode 100755 index 000000000..4ba2ed5a9 --- /dev/null +++ b/275/CH5/EX5.5.19/Ch5_5_19.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 5.19")
+printf("\n")
+disp("calculate upper cut-off frequency & voltage gain at lower cut-off frequency")
+printf("Given\n")
+//bandwidth of amplifier
+BW=500*10^3
+//lower cut-off frequency
+f1=25
+//midband gain
+Ao=120
+//upper cut-off frequency
+f2=BW+f1
+//voltage gain at lower cut-off frequency
+A1=Ao/sqrt(2)
+printf("upper cut-off frequency \n %f hz\n",f2)
+printf("Voltage gain at lower cut-off frequency \n %f \n",A1)
\ No newline at end of file diff --git a/275/CH5/EX5.5.23/Ch5_5_23.sce b/275/CH5/EX5.5.23/Ch5_5_23.sce new file mode 100755 index 000000000..bcf5efe1c --- /dev/null +++ b/275/CH5/EX5.5.23/Ch5_5_23.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 5.23")
+printf("\n")
+disp("calculate closed-loop gain for the negative feedback amplifier")
+printf("Given\n")
+//voltage gain without feedback
+Av=100000
+//feedback factor
+B=1/100
+//voltage gain with feedback
+Acl=Av/(1+(B*Av))
+//when Av is changed by 50%
+Av1=50*100000/100
+Av2=Av+Av1
+//voltage gain with feedback when Av changed by +50%
+Acl1=Av2/(1+(B*Av2))
+//voltage gain with feedback when Av changed by -50%
+Av3=Av-Av1
+Acl2=Av3/(1+(B*Av3))
+printf("closed loop gain of negative feedback amplifier is \n %f \n",Acl2)
\ No newline at end of file diff --git a/275/CH5/EX5.5.24/Ch5_5_24.sce b/275/CH5/EX5.5.24/Ch5_5_24.sce new file mode 100755 index 000000000..6997820a4 --- /dev/null +++ b/275/CH5/EX5.5.24/Ch5_5_24.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.24")
+printf("\n")
+disp("calculate closed-loop gain for the negative feedback amplifier")
+printf("Given\n")
+//voltage gain without feedback
+Av=1000
+//feedback factor
+B=0.1
+//voltage gain with feedback
+Acl=Av/(1+(B*Av))
+printf("closed loop gain of negative feedback amplifier is \n %f \n",Acl)
\ No newline at end of file diff --git a/275/CH5/EX5.5.27/Ch5_5_27.sce b/275/CH5/EX5.5.27/Ch5_5_27.sce new file mode 100755 index 000000000..1bbb116f3 --- /dev/null +++ b/275/CH5/EX5.5.27/Ch5_5_27.sce @@ -0,0 +1,23 @@ +clc
+disp("Example 5.27")
+printf("\n")
+disp("calculate input impedance of amplifier with negative feedback")
+printf("Given\n")
+//input impedance without feedback
+Zb=10^3
+//open loop voltage gain
+Av=100000
+//feedback network resistance
+RF1=56*10^3
+RF2=560
+//input side resistance
+R1=68*10^3
+R2=33*10^3
+//feedback factor
+B=RF2/(RF1+RF2)
+//input impedance with feedback
+Zi=Zb*(1+(B*Av))
+//input impedance with feedback by considering R1 & R2
+Rp=(R1*R2)/(R1+R2)
+Zin=(Zi*Rp)/(Zi+Rp)
+printf("input impedance with negative feedback \n%f ohm\n",Zin)
diff --git a/275/CH5/EX5.5.29/Ch5_5_29.sce b/275/CH5/EX5.5.29/Ch5_5_29.sce new file mode 100755 index 000000000..b7c5fcd29 --- /dev/null +++ b/275/CH5/EX5.5.29/Ch5_5_29.sce @@ -0,0 +1,29 @@ +clc
+disp("Example 5.29")
+printf("\n")
+disp("calculate input & output impedance of amplifier with negative feedback")
+printf("Given\n")
+//input impedance without feedback
+Zb=10^3
+//open loop voltage gain
+Av=7533
+//input side resistance
+R1=68*10^3
+R2=47*10^3
+//feedback factor
+B=1/101
+//input impedance with feedback
+Zi=Zb*(1+(B*Av))
+//input impedance with feedback by considering R1 & R2
+Rp=(R1*R2)/(R1+R2)
+Zin=(Zi*Rp)/(Zi+Rp)
+//output impedance without feedback
+Zc=50*10^3
+Rc=3.9*10^3
+//output impedance with feedback
+Zo=Zc/(1+(B*Av))
+//output impedance with feedback by considering Rc
+Zout=(Rc*Zo)/(Rc+Zo)
+printf("input impedance with negative feedback \n%f ohm\n",Zin)
+printf("output impedance with negative feedback \n%f ohm\n",Zout)
+
diff --git a/275/CH5/EX5.5.3/Ch5_5_3.sce b/275/CH5/EX5.5.3/Ch5_5_3.sce new file mode 100755 index 000000000..41783e61a --- /dev/null +++ b/275/CH5/EX5.5.3/Ch5_5_3.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.3")
+printf("\n")
+disp("Calculate output power change in decibel of amplifier")
+printf("Given\n")
+//output power when frequency is 5khz
+P1=50*10^-3
+//output power when frequency is 20khz
+P2=25*10^-3
+//output power change in decibel
+delPo=10*log10(P2/P1)
+printf("output power change \n%f dB\n",delPo)
diff --git a/275/CH5/EX5.5.35/Ch5_5_35.sce b/275/CH5/EX5.5.35/Ch5_5_35.sce new file mode 100755 index 000000000..372a4d7f8 --- /dev/null +++ b/275/CH5/EX5.5.35/Ch5_5_35.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 5.35")
+printf("\n")
+disp("Estimate the closed loop upper cut-off frequency & total harmonic distortion")
+printf("Given\n")
+//open loop gain
+Av=60000
+//closed loop gain
+Acl=300
+//open loop upper cut-off frequency
+F2OL=15*10^3
+//closed loop upper cut-off frequency & Av/Acl=(1+BAv)
+F2CL=F2OL*Av/Acl
+//total harmonic distortion with feedback if there is 10% distortion without feedback
+HD=10/(Av/Acl)
+printf("closed loop upper cut-off frequency \n%f hz\n",F2CL)
+printf("total harmonic distortion with feedback if there is 10per distortion without feedback \n%f\n",HD)
diff --git a/275/CH5/EX5.5.36/Ch5_5_36.sce b/275/CH5/EX5.5.36/Ch5_5_36.sce new file mode 100755 index 000000000..4790007e2 --- /dev/null +++ b/275/CH5/EX5.5.36/Ch5_5_36.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 5.36")
+printf("\n")
+disp("calculate open loop cut-off frequency if the open loop gain is 200000")
+printf("Given\n")
+//open loop gain
+Av=200000
+//closed loop gain
+Acl=250
+//upper cut-off frequency with feedback
+F2CL=4*10^6
+//upper cut-off frequency without feedback
+F2OL=F2CL/(Av/Acl)
+printf("upper cut-off frequency without feedback \n%f hz\n",F2OL)
+
diff --git a/275/CH5/EX5.5.37/Ch5_5_37.sce b/275/CH5/EX5.5.37/Ch5_5_37.sce new file mode 100755 index 000000000..8b4754205 --- /dev/null +++ b/275/CH5/EX5.5.37/Ch5_5_37.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 5.37")
+printf("\n")
+disp("calculate the phase shift with negative feedback")
+printf("Given\n")
+//open loop phase shift
+Po=15
+//open loop gain
+Av=60000
+//closed loop gain
+Acl=300
+//to calculate phase shift with feedback
+AvB=(Av/Acl)-1
+k=((AvB*sin(Po*%pi/180))/(1+(AvB*cos(Po*%pi/180))))
+Pcl=Po-(atan(k)*180/%pi)
+printf("The phase shift with negative feedback=\t%f degree\n",Pcl)
diff --git a/275/CH5/EX5.5.38/Ch5_5_38.sce b/275/CH5/EX5.5.38/Ch5_5_38.sce new file mode 100755 index 000000000..5bff9a152 --- /dev/null +++ b/275/CH5/EX5.5.38/Ch5_5_38.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 5.38")
+printf("\n")
+disp("calculate bandwidth,gain & harmonic distortion with feedback")
+printf("Given\n")
+//open loop gain
+Av=1000
+//bandwidth without feedback
+BWol=500*10^3
+//feedback factor
+B=0.1
+//bandwidth with feedback
+BWcl=BWol*(1+(B*Av))
+//closed loop gain
+Acl=Av/(1+(B*Av))
+//harmonic distortion if 15% negative feedback used
+HDcl=15/(1+(B*Av))
+printf("bandwidth with feedback is \n %f hz \n",BWcl)
+printf("closed loop gain \n %f \n",Acl)
+printf("Harmonic distortion with feedback \n %f \n",HDcl)
\ No newline at end of file diff --git a/275/CH5/EX5.5.4/Ch5_5_4.sce b/275/CH5/EX5.5.4/Ch5_5_4.sce new file mode 100755 index 000000000..4b6446a9b --- /dev/null +++ b/275/CH5/EX5.5.4/Ch5_5_4.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.4")
+printf("\n")
+disp("Calculate output power change in decibel of amplifier")
+printf("Given\n")
+//output voltage of amplifier when frequency 3khz
+V1=2
+//output voltage of amplifier when frequency 50khz
+V2=0.5
+//output power change in decibel
+delPo=20*log10(V2/V1)
+printf("output power change \n%f dB\n",delPo)
diff --git a/275/CH5/EX5.5.40/Ch5_5_50.sce b/275/CH5/EX5.5.40/Ch5_5_50.sce new file mode 100755 index 000000000..c5f6b605c --- /dev/null +++ b/275/CH5/EX5.5.40/Ch5_5_50.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 5.50")
+printf("\n")
+disp("calculate the frequency of oscillation & feedback factor of Hartley oscillator")
+printf("Given\n")
+//inductance
+L1=2*10^-3
+L2=8*10^-3
+//mutual inductance
+M=100*10^-6
+//capacitor
+C=0.001*10^-6
+//total inductance
+L=L1+L2+M
+//frequency of oscillation
+f=1/(2*%pi*sqrt(L*C))
+//feedback factor
+B=L1/L2
+printf("frequency of oscillation of hartley oscillator \n %f hz \n",f)
+printf("feedback factor \n %f \n",B)
\ No newline at end of file diff --git a/275/CH5/EX5.5.43/Ch5_5_43.sce b/275/CH5/EX5.5.43/Ch5_5_43.sce new file mode 100755 index 000000000..cb9d68563 --- /dev/null +++ b/275/CH5/EX5.5.43/Ch5_5_43.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 5.43")
+printf("\n")
+disp("calculate the frequency of oscillation of RC phase shift oscillator")
+printf("Given\n")
+R=500
+C=0.1*10^-6
+//frequency of oscillation
+f=1/(2*%pi*R*C*sqrt(6))
+printf("frequency of oscillation \n%f hz\n",f)
diff --git a/275/CH5/EX5.5.44/Ch5_5_44.sce b/275/CH5/EX5.5.44/Ch5_5_44.sce new file mode 100755 index 000000000..76b4dc61f --- /dev/null +++ b/275/CH5/EX5.5.44/Ch5_5_44.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 5.44")
+printf("\n")
+disp("calculate the value of Capacitor for a RC phase shift oscillator")
+printf("Given\n")
+R=1000
+//frequency of oscillation
+f=5000
+//capacitor value
+C=1/(2*%pi*R*f*sqrt(6))
+printf("Capacitor value \n%e farad \n",C)
diff --git a/275/CH5/EX5.5.45/Ch5_5_45.sce b/275/CH5/EX5.5.45/Ch5_5_45.sce new file mode 100755 index 000000000..7cd54acb5 --- /dev/null +++ b/275/CH5/EX5.5.45/Ch5_5_45.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.45")
+printf("\n")
+disp("calculate the value of R & c for RC phase shift oscillator")
+printf("Given\n")
+//oscillating frequency
+f=2000
+//select Capacitor value
+C=0.1*10^-6
+//resistance value
+R=1/(2*%pi*f*C*sqrt(6))
+printf("Resistance value \n%f ohm\n",R)
diff --git a/275/CH5/EX5.5.49/Ch5_5_49.sce b/275/CH5/EX5.5.49/Ch5_5_49.sce new file mode 100755 index 000000000..b1dc0300c --- /dev/null +++ b/275/CH5/EX5.5.49/Ch5_5_49.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 5.49")
+printf("\n")
+disp("calculate frequency of oscillation,feedback factor & gain required for sustained oscillation of hartley oscillator")
+printf("Given\n")
+//inductance
+L1=5*10^-3
+L2=10*10^-3
+//capacitor
+C=0.01*10^-6
+//frequency of oscillation
+f=1/(2*%pi*sqrt((L1+L2)*C))
+//feedback factor
+B=L1/L2
+//gain required for sustained oscillation
+Av=L2/L1
+printf("gain required for sustained oscillation=\t>%f\n",Av)
\ No newline at end of file diff --git a/275/CH5/EX5.5.5/Ch5_5_5.sce b/275/CH5/EX5.5.5/Ch5_5_5.sce new file mode 100755 index 000000000..392a76eb9 --- /dev/null +++ b/275/CH5/EX5.5.5/Ch5_5_5.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 5.5")
+printf("\n")
+disp("Calculate power gain of amplifier")
+printf("Given\n")
+//have equal input & load resistance
+//input voltage
+Vi=100*10^-3
+//output voltage
+Vo=3
+//power gain of amplifier
+Apdb=20*log10(Vo/Vi)
+printf("power gain of amplifier \n%f\n",Apdb)
diff --git a/275/CH5/EX5.5.51/Ch5_5_51.sce b/275/CH5/EX5.5.51/Ch5_5_51.sce new file mode 100755 index 000000000..027eabd74 --- /dev/null +++ b/275/CH5/EX5.5.51/Ch5_5_51.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 5.51")
+printf("\n")
+disp("calculate the value of L1 & L2 of Hartley oscillator")
+printf("Given\n")
+//frequency of oscillation
+f=25*10^3
+C=0.02*10^-6
+//feedback factor
+B=0.2
+//Total inductance
+L=1/(4*(%pi)^2*f^2*C)
+L1byL2=B
+L1plusL2=L
+//therefore
+L2=L/1.2
+L1=L-L2
+printf("The values of L1=\t%f henry\nL2=\t%f henry\n",L1,L2)
diff --git a/275/CH5/EX5.5.53/Ch5_5_53.sce b/275/CH5/EX5.5.53/Ch5_5_53.sce new file mode 100755 index 000000000..fe93c2c6a --- /dev/null +++ b/275/CH5/EX5.5.53/Ch5_5_53.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 5.53")
+printf("\n")
+disp("Design the value of L1,L2 & C for a hartley oscillator")
+printf("Given\n")
+//frequency of oscillation
+f=30*10^3
+//then value of LC
+LC=1/(4*(%pi)^2*f^2)
+//select c as
+C=0.1*10^-6
+//Total inductance
+L=LC/C
+//let L1=L2
+L1=L/2
+L2=L1
+printf("The values of L1=\t%f henry\nL2=\t%f henry\nC=\t%e farad\n",L1,L2,C)
diff --git a/275/CH5/EX5.5.55/Ch5_5_55.sce b/275/CH5/EX5.5.55/Ch5_5_55.sce new file mode 100755 index 000000000..7932ae835 --- /dev/null +++ b/275/CH5/EX5.5.55/Ch5_5_55.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 5.55")
+printf("\n")
+disp("calculate the frequency of oscillation of Colpitts oscillator")
+printf("Given\n")
+//capacitor
+C1=400*10^-12
+C2=C1
+//inductance
+L=2*10^-3
+//Total capacitance
+C=C1*C2/(C1+C2)
+//frequency of oscillation
+f=1/(2*%pi*sqrt(L*C))
+printf("frequency of oscillations \n%f hz\n",f)
diff --git a/275/CH5/EX5.5.56/Ch5_5_56.sce b/275/CH5/EX5.5.56/Ch5_5_56.sce new file mode 100755 index 000000000..bc3506d21 --- /dev/null +++ b/275/CH5/EX5.5.56/Ch5_5_56.sce @@ -0,0 +1,19 @@ +clc
+disp("Example 5.56")
+printf("\n")
+disp("calculate the frequency of oscillation,feedback factor & gain required for sustained oscillation")
+printf("Given\n")
+//Capacitance
+C1=40*10^-12
+C2=10*10^-12
+//inductance
+L=3*10^-3
+//total effective capacitance
+C=C1*C2/(C1+C2)
+//frequency of oscillation
+f=1/(2*%pi*sqrt(L*C))
+//feedback factor
+B=C2/C1
+//gain required for sustained oscillation
+Av=C1/C2
+printf("gain required for sustained oscillation =\t>%f\n",Av)
diff --git a/275/CH5/EX5.5.57/Ch5_5_57.sce b/275/CH5/EX5.5.57/Ch5_5_57.sce new file mode 100755 index 000000000..81cfa9341 --- /dev/null +++ b/275/CH5/EX5.5.57/Ch5_5_57.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 5.57")
+printf("\n")
+disp("calculate the value of L of Colpitts oscillator ")
+printf("Given\n")
+//capacitor
+C1=100*10^-12
+C2=60*10^-12
+//total effective capacitance
+C=C1*C2/(C1+C2)
+//frequency of oscillation
+f=40*10^3
+//inductance
+L=1/(4*(%pi)^2*f^2*C)
+printf("inductance value is \n%f henry\n",L)
diff --git a/275/CH5/EX5.5.58/Ch5_5_58.sce b/275/CH5/EX5.5.58/Ch5_5_58.sce new file mode 100755 index 000000000..861b11428 --- /dev/null +++ b/275/CH5/EX5.5.58/Ch5_5_58.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 5.58")
+printf("\n")
+disp("calculate the value of C1 & C2 of Colpitts oscillator")
+printf("Given\n")
+//inductance
+L=5*10^-3
+//frequency of oscillation
+f=50*10^3
+//total effective capacitance
+C=1/(4*(%pi)^2*f^2*L)
+//feedback factor
+B=0.1
+//then C2/C1=0.1, so substituting in C=C1C2/(C1+C2) we get
+C1=1.1*C/0.1
+C2=0.1*C1
+printf("The value of C1=\t%e farad\nC2=\t%e farad\n",C1,C2)
diff --git a/275/CH5/EX5.5.59/Ch5_5_59.sce b/275/CH5/EX5.5.59/Ch5_5_59.sce new file mode 100755 index 000000000..bc55b4252 --- /dev/null +++ b/275/CH5/EX5.5.59/Ch5_5_59.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 5.59")
+printf("\n")
+disp("calculate the value of L & C for a colpitts oscillator")
+printf("Given\n")
+//frequency of oscillation
+f=40*10^3
+LC=1/(4*(%pi)^2*f^2)
+//select L
+L=10*10^-3
+//find C
+C=1/(4*(%pi)^2*f^2*L)
+//let C1=C2 so we get
+C1=2*C
+C2=C1
+printf("The values of L=\t%f henry\nC1=\t%e farad\nC2=\t%e farad\n",L,C1,C2)
diff --git a/275/CH5/EX5.5.6/Ch5_5_6.sce b/275/CH5/EX5.5.6/Ch5_5_6.sce new file mode 100755 index 000000000..328e3f523 --- /dev/null +++ b/275/CH5/EX5.5.6/Ch5_5_6.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.6")
+printf("\n")
+disp("Calculate new level of output voltage when it has fallen by 4db")
+printf("Given\n")
+//output voltage of an amplifier is 2V when frequency 1khz
+V1=2
+//power in db
+Po=-4
+//new level of output voltage
+V2=10^(Po/20)*V1
+printf("new output voltage \n%f volt\n",V2)
diff --git a/275/CH5/EX5.5.61/Ch5_5_61.sce b/275/CH5/EX5.5.61/Ch5_5_61.sce new file mode 100755 index 000000000..c9fb67518 --- /dev/null +++ b/275/CH5/EX5.5.61/Ch5_5_61.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 5.61")
+printf("\n")
+disp("calculate the frequency of oscillation for Wein_Bridge Oscillator")
+printf("Given\n")
+//Resistance
+R=2*10^3
+//capacitor
+C=0.1*10^-6
+//frequency of oscillation
+f=1/(2*%pi*R*C)
+printf("frequecy of oscillation \n%f hz\n",f)
diff --git a/275/CH5/EX5.5.62/Ch5_5_62.sce b/275/CH5/EX5.5.62/Ch5_5_62.sce new file mode 100755 index 000000000..6765c9b06 --- /dev/null +++ b/275/CH5/EX5.5.62/Ch5_5_62.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 5.62")
+printf("\n")
+disp("calculate the value of R & c for Wein-Bridge oscillator")
+printf("Given\n")
+//frequency of oscillation
+f=1000
+//find RC
+RC=1/(2*%pi*f)
+//select C<10^-6F
+C=0.1*10^-6
+//the value of R
+R=1/(2*%pi*f*C)
+printf("the value of c \n%f farad\n",C)
+printf("the value of R \n%f ohm\n",R)
diff --git a/275/CH5/EX5.5.65/Ch5_5_65.sce b/275/CH5/EX5.5.65/Ch5_5_65.sce new file mode 100755 index 000000000..1f309f5cc --- /dev/null +++ b/275/CH5/EX5.5.65/Ch5_5_65.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 5.65")
+printf("\n")
+disp("calculate the Series & parallel resonant frequencies of Crystal")
+printf("Given\n")
+//indutance
+L=3
+//Capacitor due to mechanical mounting of crystal
+Cm=10*10^-12
+//electrical equivalent capacitance of crystal compliance
+Cs=0.05*10^-12
+//electrical equivalent resistance of crystal structure internal friction
+R=2*10^3
+//series resonant frequency
+fs=1/(2*%pi*sqrt(L*Cs))
+Cp=Cm*Cs/(Cm+Cs)
+//parallel resonant frequency
+fp=1/(2*%pi*sqrt(L*Cp))
+printf("series resonant frequency \n%f hz\n",fs)
+printf("parallel resonant frequency \n%f hz\n",fp)
diff --git a/275/CH6/EX6.6.15/Ch6_6_15.sce b/275/CH6/EX6.6.15/Ch6_6_15.sce new file mode 100755 index 000000000..e0960630c --- /dev/null +++ b/275/CH6/EX6.6.15/Ch6_6_15.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 6.15")
+printf("\n")
+disp("calculate the maximum frequency at which output is faithful reproduction of input")
+printf("given")
+disp("slew rate=3Mv/s")
+sr=3*10^6
+Vm=12
+//calculate Frequency
+fmax=(sr/(2*%pi*Vm))
+printf("maximum frequency=%d hz",fmax)
diff --git a/275/CH6/EX6.6.19/Ch6_6_19.sce b/275/CH6/EX6.6.19/Ch6_6_19.sce new file mode 100755 index 000000000..99b7198af --- /dev/null +++ b/275/CH6/EX6.6.19/Ch6_6_19.sce @@ -0,0 +1,17 @@ +clc
+disp("Example 6.19")
+printf("\n")
+disp("calculate common mode gain & output voltage")
+printf("Given")
+disp("differential gain=500")
+disp("CMRR=80dB,Input signal is 2*sin100*%pi*t")
+Ad=500
+CMRR=80
+t=1/200
+Vc=2*sin(100*%pi*t)
+//calculate common mode gain
+Ac=Ad/(10^(CMRR/20))
+//calculate common mode output voltage
+Vcmov=Ac*Vc
+printf("Common mode gain =%f\n",Ac)
+printf("Common mode output voltage =%f volt\n",Vcmov)
diff --git a/275/CH6/EX6.6.20/Ch6_6_20.sce b/275/CH6/EX6.6.20/Ch6_6_20.sce new file mode 100755 index 000000000..7bbf14dd8 --- /dev/null +++ b/275/CH6/EX6.6.20/Ch6_6_20.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 6.20")
+printf("\n")
+disp("To express CMRR in dB")
+printf("given")
+disp("Ad=10^4,Ac=0.1")
+Ad=10^4
+Ac=0.1
+//to find CMMR in dB
+CMRR=20*log10(Ad/Ac)
+printf("CMRR in dB=%d dB",CMRR)
diff --git a/275/CH6/EX6.6.24/Ch6_24.png b/275/CH6/EX6.6.24/Ch6_24.png Binary files differnew file mode 100755 index 000000000..9b157bd06 --- /dev/null +++ b/275/CH6/EX6.6.24/Ch6_24.png diff --git a/275/CH6/EX6.6.24/Ch6_6_24.sce b/275/CH6/EX6.6.24/Ch6_6_24.sce new file mode 100755 index 000000000..9b5329abf --- /dev/null +++ b/275/CH6/EX6.6.24/Ch6_6_24.sce @@ -0,0 +1,29 @@ +clc
+disp("Example 6.24")
+printf("\n")
+disp("calculate output voltage for inverting amplifier & sketch the waveform")
+printf("given")
+disp("Peak to peak input votage=200mV,Rf/R1=10")
+Vpp=200*10^(-3)
+Vm=Vpp/2
+RfdivR1=10
+wt=0:0.2:3*%pi
+Vi=Vm*sin(wt)
+Vo=-(RfdivR1)*Vi
+disp(Vo)
+a= gca ();
+subplot(221)
+a= gca();
+a. x_location = "origin";
+a. y_location = "origin";
+plot2d(wt,Vi)
+xtitle("Vi V/s wt","wt","Vi in volt")
+a.thickness=2
+subplot(222)
+a= gca();
+a. x_location = "origin";
+a. y_location = "origin";
+plot2d(wt,Vo)
+xtitle("Vo V/s wt","wt","Vo in volt")
+a.thickness=2
+
diff --git a/275/CH6/EX6.6.25/Ch6_6_25.sce b/275/CH6/EX6.6.25/Ch6_6_25.sce new file mode 100755 index 000000000..fc2ab82ba --- /dev/null +++ b/275/CH6/EX6.6.25/Ch6_6_25.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 6.25")
+printf("\n")
+disp("Design An Inverting Amplifier for the given closed loop gain")
+printf("given")
+disp("closed loop gain=-15")
+Af=(-15)
+R1=10^3
+Rf=(-Af)*R1
+printf("The resistance values are=\n%f ohm,\n%f ohm",R1,Rf)
diff --git a/275/CH6/EX6.6.26/Ch6_6_26.sce b/275/CH6/EX6.6.26/Ch6_6_26.sce new file mode 100755 index 000000000..90e488365 --- /dev/null +++ b/275/CH6/EX6.6.26/Ch6_6_26.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 6.26")
+printf("\n")
+disp("calculate the output voltage for a given input voltages")
+printf("given")
+disp("input voltages=0.2,0.5sin314t,-0.4")
+Rf=200*10^3
+R1=20*10^3
+Af=(-Rf)/R1// calculate open loop gain
+t=%pi/(2*314)//intialise t value
+Vi=[0.2,0.5*(sin(314*t)),-0.4]
+Vo=Af*Vi//calculate output voltage
+printf("Output voltages are=\n%f volt,\n%f volt,\n%f volt",Vo)
+
+
+
diff --git a/275/CH6/EX6.6.27/Ch6_6_27.sce b/275/CH6/EX6.6.27/Ch6_6_27.sce new file mode 100755 index 000000000..94cdb1ec6 --- /dev/null +++ b/275/CH6/EX6.6.27/Ch6_6_27.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 6.27")
+printf("\n")
+disp("Calculate closed loop gain & input voltage to get output voltage 2v")
+printf("given")
+disp("Rf=1M,R1=20K,output voltage=2V")
+Rf=10^6
+R1=20*10^3
+Vo=2
+//calculate closed loop gain
+Af=(-Rf/R1)
+//calculate input voltage
+Vi=Vo/Af
+printf("closed loop voltage gain=%f\n",Af)
+printf("Input voltage=%f volt",Vi)
diff --git a/275/CH6/EX6.6.28/Ch6_6_28.sce b/275/CH6/EX6.6.28/Ch6_6_28.sce new file mode 100755 index 000000000..f182a6bf6 --- /dev/null +++ b/275/CH6/EX6.6.28/Ch6_6_28.sce @@ -0,0 +1,15 @@ +clc
+disp("Example 6.27")
+printf("\n")
+disp("Calculate closed loop gain & input voltage to get output voltage 2v")
+print("given")
+disp("Rf=1M,R1=20K,output voltage=2V")
+Rf=10^6
+R1=20*10^3
+Vo=2
+//calculate closed loop gain
+Af=(-Rf/R1)
+//calculate input voltage
+Vi=Vo/Af
+printf("closed loop voltage gain=%f\n",Af)
+printf("Input voltage=%f",Vi)
diff --git a/275/CH6/EX6.6.31/Ch6_6_31.sce b/275/CH6/EX6.6.31/Ch6_6_31.sce new file mode 100755 index 000000000..135db3c23 --- /dev/null +++ b/275/CH6/EX6.6.31/Ch6_6_31.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 6.31")
+printf("\n")
+disp("calculate output voltage for given specification")
+printf("given")
+disp("Rf=360k,R1=120k,Vi=0.5,0.6sin314t,-0.3")
+Rf=360*10^3
+R1=120*10^3
+Af=1+(Rf/R1)
+t=0 //initialise t value
+Vi=[0.5, 0.6*cos(314*t),-0.3]
+Vo=Af*Vi //calculate output voltage
+printf("output voltage =%f volt,\n%f volt,\n%f volt",Vo)
diff --git a/275/CH6/EX6.6.32/Ch6_6_32.sce b/275/CH6/EX6.6.32/Ch6_6_32.sce new file mode 100755 index 000000000..302dad254 --- /dev/null +++ b/275/CH6/EX6.6.32/Ch6_6_32.sce @@ -0,0 +1,16 @@ +clc
+disp("Example 6.32")
+printf("\n")
+disp("Calculate Gain & input voltage")
+printf("Given")
+disp("Rf=100K,R1=10K")
+Rf=100*10^3
+R1=10^4
+//calculate voltage gain
+Af=1+(Rf/R1)
+Vo=4
+//calculate input voltage
+Vi=Vo/Af
+//display values
+printf("Closed loop gain =%f\n",Af)
+printf("Input voltage=%f volt",Vi)
diff --git a/275/CH6/EX6.6.33/Ch6_6_33.sce b/275/CH6/EX6.6.33/Ch6_6_33.sce new file mode 100755 index 000000000..504eab1f7 --- /dev/null +++ b/275/CH6/EX6.6.33/Ch6_6_33.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 6.33")
+printf("\n")
+disp("Calculate output voltage if input voltage is 1V")
+printf("Given")
+disp("R1=1K,Rf=100K,V+=15V,V-=-15,Vi=1v")
+Rf=10^5
+R1=10^3
+//supply votage
+Vplus=15
+Vminus=(-15)
+//calculate voltage gain
+Af=(-Rf)/R1
+Vi=1
+// calculate output voltage
+Vo=Af*Vi
+//condition to check output votage is greater than Vplus
+if(Vo>Vplus) then
+ printf("The Maximum positive output voltage=%f volt",Vplus)
+//condition to check output voltage is less than Vminus
+elseif (Vo<Vminus) then
+ printf("The maximum negative output voltage=%f volt",Vminus)
+//else display Vo
+ else
+ printf("The output voltage=%f volt",Vo)
+end
diff --git a/275/CH6/EX6.6.34/Ch6_6_34.sce b/275/CH6/EX6.6.34/Ch6_6_34.sce new file mode 100755 index 000000000..210966d8c --- /dev/null +++ b/275/CH6/EX6.6.34/Ch6_6_34.sce @@ -0,0 +1,23 @@ +clc
+disp("Example 6.34")
+printf("\n")
+disp("Calculate output voltage")
+printf("Given")
+disp("R1=2K,Rf=200K,V+=12V,V-=-12,Vi=1.5V")
+Rf=20^4
+R1=2*10^3
+Vplus=12
+Vminus=-12
+Af=1+(Rf/R1)
+Vi=1.5
+Vo=Af*Vi
+//condition to check output votage is greater than Vplus
+if(Vo>Vplus) then
+ printf("The Maximum positive output voltage=%f volt",Vplus)
+//condition to check output voltage is less than Vminus
+elseif(Vo<Vminus)
+ printf("The maximum negative output voltage=%f volt",Vminus)
+ //else display Vo
+else
+ printf("The output voltage=%f volt",Vo)
+end
diff --git a/275/CH6/EX6.6.37/Ch6_6_37.sce b/275/CH6/EX6.6.37/Ch6_6_37.sce new file mode 100755 index 000000000..9c1117014 --- /dev/null +++ b/275/CH6/EX6.6.37/Ch6_6_37.sce @@ -0,0 +1,16 @@ +clc
+disp("example 6.37")
+printf("\n")
+disp("calculate voltage gain,input resistance,current through R1")
+printf("Given")
+disp("Rf=100k,R1=10k")
+disp("input voltage is 0.5v")
+Rf=10^5
+R1=10^4
+Af=-Rf/R1
+Rif=R1
+Vi=0.5
+I1=(Vi/R1)
+printf("closed loop voltage gain is %3.1f\n",Af)
+printf("input resistance is\n %3.1f ohm\n",Rif)
+printf("current flowing through R1 is %f ampere\n",I1)
diff --git a/275/CH6/EX6.6.45/Ch6_6_45.sce b/275/CH6/EX6.6.45/Ch6_6_45.sce new file mode 100755 index 000000000..8c2174c15 --- /dev/null +++ b/275/CH6/EX6.6.45/Ch6_6_45.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 6.45")
+printf("\n")
+disp("Calculate output votage")
+printf("Given")
+disp("input voltage V1=-1v,V2=-2v,V3=3v")
+disp("Resistance Rf=60k,R1=10k,R2=20k,R3=30k")
+Rf=60*10^3;R1=10^4;R2=20*10^3;R3=30*10^3;
+V1=-1;V2=-2;V3=3;
+Vo=-[(Rf/R1)*V1+(Rf/R2)*V2+(Rf/R3)*V3]
+printf("The output voltage is %f volt",Vo)
diff --git a/275/CH6/EX6.6.55/Ch6_6_55.sce b/275/CH6/EX6.6.55/Ch6_6_55.sce new file mode 100755 index 000000000..972663172 --- /dev/null +++ b/275/CH6/EX6.6.55/Ch6_6_55.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 6.55")
+printf("\n")
+disp("Calculate Bandwidth with feedback")
+printf("Given")
+disp("Open loop voltage gain=2*10^5 \n")
+disp("Break frequency is 5Hz,10% negative feedback\n")
+A=2*10^5
+B=0.1
+Fi=5
+//bandwidth with feedback
+Fb=Fi*(1+A*B)
+printf("Bandwidth with feedback is %f hz\n",Fb)
diff --git a/275/CH6/EX6.6.56/Ch6_6_56.sce b/275/CH6/EX6.6.56/Ch6_6_56.sce new file mode 100755 index 000000000..895e1b195 --- /dev/null +++ b/275/CH6/EX6.6.56/Ch6_6_56.sce @@ -0,0 +1,11 @@ +clc
+disp("Example 6.56")
+printf("\n")
+printf("Given")
+disp("open loop gain is 100")
+disp("Gain Bandwidth Product is 1MHz")
+Af=100
+GBW=10^6
+ReqBandwidth=GBW/Af
+RfbyR1=Af-1
+printf("the ratio of resistance is=%f",RfbyR1)
\ No newline at end of file diff --git a/275/CH6/EX6.6.57/Ch6_6_57.sce b/275/CH6/EX6.6.57/Ch6_6_57.sce new file mode 100755 index 000000000..0619a5f14 --- /dev/null +++ b/275/CH6/EX6.6.57/Ch6_6_57.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 6.57")
+printf("\n")
+printf("given")
+disp("gain is 200 & gain bandwidth product is 1MHz")
+Af=200
+GBW=10^6
+BW=10^4
+reqBW=GBW/Af
+if(reqBW>BW) then
+ printf("Required bandwidth is=%f",reqBW)
+ else
+ Af2=10
+ Af1=200/Af2
+ R1fbyR11=Af1-1
+ R2fbyR21=Af2-1
+ printf("The ratio of resistance of both amplifier circuit is=\n%d,\n%d",R1fbyR11,R2fbyR21)
+end
\ No newline at end of file diff --git a/275/CH7/EX7.7.25/Ch7_7_25.sce b/275/CH7/EX7.7.25/Ch7_7_25.sce new file mode 100755 index 000000000..451b8c5e6 --- /dev/null +++ b/275/CH7/EX7.7.25/Ch7_7_25.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 7.25")
+printf("\n")
+disp("calculate side band frequencies & bandwidth \n")
+printf("Given")
+disp("Fc=600khz,Fm=1khz")
+Fc=6*10^5
+Fm=10^3
+Flsb=Fc-Fm
+Fusb=Fc+Fm
+BW=2*Fm
+printf("Side band frequencies are= %d hz,\t%d hz\n",Flsb,Fusb)
+printf("Bandwidth is=%d hz",BW)
diff --git a/275/CH7/EX7.7.27/Ch7_7_27.sce b/275/CH7/EX7.7.27/Ch7_7_27.sce new file mode 100755 index 000000000..7987eb60b --- /dev/null +++ b/275/CH7/EX7.7.27/Ch7_7_27.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 7.27")
+printf("\n")
+disp("Calculate the total power in the modulated wave")
+printf("Given")
+disp("carrier power=400W,modulation index=75%")
+Pc=400
+Ma=0.75
+Pt=Pc*(1+(Ma^2/2))
+printf("The total power in modulated wave =\n%f watt",Pt)
diff --git a/275/CH7/EX7.7.28/Ch7_7_28.sce b/275/CH7/EX7.7.28/Ch7_7_28.sce new file mode 100755 index 000000000..259cc70a5 --- /dev/null +++ b/275/CH7/EX7.7.28/Ch7_7_28.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 7.28")
+printf("\n")
+disp("Determine the radiated power at a modulation index of 0.6")
+printf("Given")
+disp("carrier power=50Khz, modulation index=0.6")
+Pc=5*10^4
+Ma=0.6
+Pt=Pc*(1+(Ma^2/2))
+printf("The total power in modulated wave =\n%f watt",Pt)
diff --git a/275/CH7/EX7.7.34/Ch7_7_34.sce b/275/CH7/EX7.7.34/Ch7_7_34.sce new file mode 100755 index 000000000..28ebbfcef --- /dev/null +++ b/275/CH7/EX7.7.34/Ch7_7_34.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 7.34")
+printf("\n")
+disp("calculate carrier power")
+printf("Given\n")
+disp("total power=10KW,modulation index=0.6")
+Pt=10^4
+Ma=0.6
+Pc=Pt/(1+(Ma^2/2))
+printf("The carrier power is=%f watt\n",Pc)
diff --git a/275/CH7/EX7.7.35/Ch7_7_35.sce b/275/CH7/EX7.7.35/Ch7_7_35.sce new file mode 100755 index 000000000..6282a4b38 --- /dev/null +++ b/275/CH7/EX7.7.35/Ch7_7_35.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 7.35")
+printf("\n")
+disp("Determine power content of carrier & each sideband")
+printf("Given\n")
+disp("Total power=2.64KW,modulation index=80%")
+Pt=2.64*10^3
+Ma=0.8
+Pc=Pt/(1+(Ma^2/2))
+Plsb=Ma^2*Pc/4
+Pusb=Plsb
+printf("The total power is=%f watt\n",Pc)
+printf("The sideband power is=\n%f watt,\t%f watt",Plsb,Pusb)
diff --git a/275/CH7/EX7.7.36/Ch7_7_36.sce b/275/CH7/EX7.7.36/Ch7_7_36.sce new file mode 100755 index 000000000..400c407a4 --- /dev/null +++ b/275/CH7/EX7.7.36/Ch7_7_36.sce @@ -0,0 +1,20 @@ +clc
+disp("Example 7.36")
+printf("\n")
+disp("Calculate sideband frequencies,bandwidth,power in sidebands,Total power")
+printf("Given")
+disp("carrier power=1KW,carrier frequency=2MHz,Modulation frequency=2KHz,Modulation index=0.6")
+Pc=10^3
+Fc=2*10^6
+Fm=2*10^3
+Ma=0.6
+Flsb=Fc-Fm
+Fusb=Fc+Fm
+BW=2*Fm
+Plsb=Ma^2*Pc/4
+Pusb=Plsb
+Pt=Pc*(1+(Ma^2/2))
+printf("Sideband frequencies are=\n%d hz,\t%d hz\n",Flsb,Fusb)
+printf("Bandwidth=%d hz\n",BW)
+printf("Power in sidebands=\n%f watt,\t%f watt\n",Plsb,Pusb)
+printf("Total power=\n%f watt",Pt)
diff --git a/275/CH7/EX7.7.37/Ch7_7_37.sce b/275/CH7/EX7.7.37/Ch7_7_37.sce new file mode 100755 index 000000000..40d0d753b --- /dev/null +++ b/275/CH7/EX7.7.37/Ch7_7_37.sce @@ -0,0 +1,14 @@ +clc
+disp("Example 7.37")
+printf("\n")
+disp("Calculate the modulation index")
+printf("Given\n")
+disp("carrier voltage=100V,Total modulated voltage in rms=110V")
+Vt=110
+Vcar=100
+//assume R value as 1
+R=1
+Pt=Vt^2/R
+Pc=Vcar^2/R
+Ma=sqrt(2*((Pt/Pc)-1))
+printf("Modulation index =%f",Ma)
\ No newline at end of file diff --git a/275/CH7/EX7.7.38/Ch7_7_38.sce b/275/CH7/EX7.7.38/Ch7_7_38.sce new file mode 100755 index 000000000..818416a6e --- /dev/null +++ b/275/CH7/EX7.7.38/Ch7_7_38.sce @@ -0,0 +1,18 @@ +clc
+disp("Example 7.38")
+printf("\n")
+disp("Determine modulation index & Antenna current when MOdulation index changes to 0.8")
+printf("given\n")
+disp("carrier current=8A,Modulated carrier current=8.93A")
+Icar=8
+It=8.93
+//assume R=1
+R=1
+Pc=Icar^2*R
+Pt=It^2*R
+Ma=sqrt(2*((Pt/Pc)-1))
+//Modulated carrier current when Ma changes to 8
+Ma1=0.8
+It1=Icar*sqrt(1+(Ma1^2/2))
+printf("Modulation index =%f\n",Ma)
+printf("Modulated carrier current when Ma changes to 8 is =%f ampere",It1)
diff --git a/275/CH7/EX7.7.39/Ch7_7_39.sce b/275/CH7/EX7.7.39/Ch7_7_39.sce new file mode 100755 index 000000000..c980be36d --- /dev/null +++ b/275/CH7/EX7.7.39/Ch7_7_39.sce @@ -0,0 +1,12 @@ +clc
+disp("Example 7.39")
+printf("\n")
+disp("Calculate transmission power efficiency and average power in carrier component")
+printf("Given \n")
+disp("Total power=20KW,Modulation index=0.7")
+Pt=2*10^4
+Ma=0.7
+Pc=Pt/(1+(Ma^2/2))
+%n=(Ma^2/(2+Ma^2))*100
+printf("The carrier Power =%f watt\n",Pc)
+printf("The transmission power efficiency =%f",%n)
diff --git a/275/CH7/EX7.7.40/Ch7_7_40.sce b/275/CH7/EX7.7.40/Ch7_7_40.sce new file mode 100755 index 000000000..bdf483c19 --- /dev/null +++ b/275/CH7/EX7.7.40/Ch7_7_40.sce @@ -0,0 +1,10 @@ +clc
+disp("Example 7.40")
+printf("\n")
+disp("Calculate modulation index")
+printf("Given\n")
+disp("maximum & minimum amplitudes are 600mv,200mv")
+Vmax=600*10^-3
+Vmin=200*10^-3
+Ma=(Vmax-Vmin)/(Vmax+Vmin)
+printf("Modulation Index is =\n%f",Ma)
\ No newline at end of file diff --git a/275/CH7/EX7.7.41/Ch7_41.png b/275/CH7/EX7.7.41/Ch7_41.png Binary files differnew file mode 100755 index 000000000..d21c33a1e --- /dev/null +++ b/275/CH7/EX7.7.41/Ch7_41.png diff --git a/275/CH7/EX7.7.41/Ch7_7_41.sce b/275/CH7/EX7.7.41/Ch7_7_41.sce new file mode 100755 index 000000000..d25ed1e05 --- /dev/null +++ b/275/CH7/EX7.7.41/Ch7_7_41.sce @@ -0,0 +1,26 @@ +clc
+disp("Example 7.41")
+printf("\n")
+disp("sketch the frequency spectrum")
+printf("Given\n")
+disp("carrier amplitude=10V,carrier frequency=10MHz,Modulating frequency=1Khz,MI=0.5")
+Vc=10
+fc=10^7
+fm=10^3
+ma=0.5
+wc=2*%pi*fc
+wm=2*%pi*fm
+t=10^-7
+v=Vc*(1+(ma*sin(wm*t)))*cos(wc*t)
+Vs=(ma*Vc)/2
+flsb=fc-fm
+fusb=fc+fm
+// take below values just for plotting graph with intial values
+f1=9.9989*10^6
+v1=0
+f=[f1 flsb fc fusb]
+a=[v1 Vs Vc Vs]
+plot2d3(f,a)
+xtitle("Frequency Spectrum")
+xlabel("Frequency")
+ylabel("Amplitude")
\ No newline at end of file diff --git a/275/CH7/EX7.7.42/Ch7_7_42.sce b/275/CH7/EX7.7.42/Ch7_7_42.sce new file mode 100755 index 000000000..169345e07 --- /dev/null +++ b/275/CH7/EX7.7.42/Ch7_7_42.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 7.42")
+printf("\n")
+disp("Find the saving power if power contained in the LSB alone is used")
+printf("Given\n")
+disp("Total power=20KW,Modulation Index=0.8")
+Pt=20*10^3
+Ma=0.8
+Pc=Pt/(1+(Ma^2/2))
+Plsb=(Pt-Pc)/2
+%Ps=((Pt-Plsb)/Pt)*100
+printf("power in sideband=%f watt\n",Plsb)
+printf("Saving in power=\n%f\n",%Ps)
diff --git a/275/CH7/EX7.7.55/Ch7_7_55.sce b/275/CH7/EX7.7.55/Ch7_7_55.sce new file mode 100755 index 000000000..20535dd94 --- /dev/null +++ b/275/CH7/EX7.7.55/Ch7_7_55.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 7.55")
+printf("\n")
+disp("Find the maximum frequency deviation & modulation index")
+printf("Given\n")
+disp("Kf=1KHz/v,Modulating voltage=15v,frequency=3KHz")
+K=10^3
+Vm=15
+Fm=3*10^3
+del=K*Vm
+Mf=del/Fm
+printf("Maximum frequency Deviation is =\n%d hz\n",del)
+printf("Modulation Index=\n%f\n",Mf)
diff --git a/275/CH7/EX7.7.56/Ch7_7_56.sce b/275/CH7/EX7.7.56/Ch7_7_56.sce new file mode 100755 index 000000000..74fd3d8ca --- /dev/null +++ b/275/CH7/EX7.7.56/Ch7_7_56.sce @@ -0,0 +1,21 @@ +clc
+disp("Example 7.56")
+printf("\n")
+disp("find the frequency deviation & modulation index")
+printf("Given\n")
+del=5*10^3
+Vm=2.5
+Kf=del/Vm
+//when Vm=7.5
+Vm=7.5
+del1=Kf*Vm
+//when Vm=10v
+Vm=10
+del2=Kf*Vm
+Fm1=500
+Mf1=del/Fm1
+Mf2=del1/Fm1
+Fm2=250
+Mf3=del2/Fm2
+printf("Frequency deviation at different modulating Voltage =\n%d hz\n%d hz\n",del1,del2)
+printf("Modulation index at different frequency deviation & modulating frequency =\n%d\n%d\n%d\n",Mf1,Mf2,Mf3)
diff --git a/275/CH7/EX7.7.92/Ch7_7_92.sce b/275/CH7/EX7.7.92/Ch7_7_92.sce new file mode 100755 index 000000000..10cfed8c9 --- /dev/null +++ b/275/CH7/EX7.7.92/Ch7_7_92.sce @@ -0,0 +1,13 @@ +clc
+disp("Example 7.92")
+printf("\n")
+disp("Find the Peak Value")
+printf("Given\n")
+disp("Vpp=100v,deflection=5cm")
+Vpp=100
+D=5
+DS=Vpp/D
+//another sinusoidal produces a deflection of 8cm
+D1=8
+Vpp1=DS*D1
+printf("The peak value of unknown voltage=\n%d volt\n",Vpp1)
diff --git a/275/CH8/EX8.8.10/Ch8_8_10.sce b/275/CH8/EX8.8.10/Ch8_8_10.sce new file mode 100755 index 000000000..60a996532 --- /dev/null +++ b/275/CH8/EX8.8.10/Ch8_8_10.sce @@ -0,0 +1,46 @@ +clc
+clear
+disp("Example 8.10")
+printf("\n")
+disp("convert the following decimal to binary numbers")
+disp("a)47.8125 b)100.0001 c)29.3749")
+//given decimal number
+i=1;x=1
+dec=47.8125
+//separating integer part
+IP=floor(dec)
+IP1=IP
+//separating decimal part
+DP=modulo(dec,1)
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=(modulo(floor(IP),2))
+ IP=floor(IP)/2
+ i=i+1
+end
+if(IP1>0)
+IP=0
+for j=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(j)*10^(j-1));
+ end
+else
+ IP=0
+end
+
+//storing each decimal digit in D(x)
+while(x<=4)
+ DP=DP*2
+ D(x)=floor(DP)
+ x=x+1
+ DP=modulo(DP,1)
+end
+
+DP=0
+for j=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(10^(-1*j)*D(j))
+end
+Binary=IP+DP;
+printf("Binary format is")
+disp(Binary)
diff --git a/275/CH8/EX8.8.12/Ch8_8_12.sce b/275/CH8/EX8.8.12/Ch8_8_12.sce new file mode 100755 index 000000000..9f104d1d8 --- /dev/null +++ b/275/CH8/EX8.8.12/Ch8_8_12.sce @@ -0,0 +1,79 @@ +clc
+clear
+disp("Example 8.12")
+printf("\n")
+disp("convert the following octal to decimal")
+disp("a)243 b)124.21 c)0.65")
+//Given octal number
+i=1;w=1
+oct=243
+//separating integer part
+IP=floor(oct)
+IP1=IP
+//separating decimal part
+DP=modulo(oct,1)
+DP1=DP
+//converting decimal value to interger
+p=2
+DP=DP*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=modulo(IP,10);
+ IP=floor(IP/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DP>0)
+ D(w)=modulo(DP,10)
+ DP=(DP/10)
+ DP=floor(DP)
+ w=w+1;
+ end
+//to do zero padding of remaining erm of D(w)
+if(DP1<1)
+ if(DP1>0)
+if(length(D)<p)
+ q=length(D)
+ for f=q+1 :p
+ D(f)=0
+ end
+ end
+end
+end
+
+if(IP1>0)
+for i=1:length(I)//checking whether it is a octal number or not
+ if(I(i)>8) then
+ disp('not a octal number')
+ abort
+ end
+ end
+end
+if(IP1>0)
+IP=0
+for i=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(i)*8^(i-1))
+ end
+end
+
+if(DP1<1)
+ if(DP1>0)
+DP=0
+for z=1:length(D)
+ //multipliying bits of decimal part with their position values and adding
+ if(D(z)<8)
+ DP=DP+(D(z)*8^(-1*(length(D)+1-z)))
+ else
+ IP=0
+ DP=0
+ printf("not a octal number")
+ abort
+ end
+end
+end
+
+decimal=IP+DP
+//displaying the output
+printf("Decimal format")
+disp(decimal)
diff --git a/275/CH8/EX8.8.13/Ch8_8_13.sce b/275/CH8/EX8.8.13/Ch8_8_13.sce new file mode 100755 index 000000000..0c2c8e947 --- /dev/null +++ b/275/CH8/EX8.8.13/Ch8_8_13.sce @@ -0,0 +1,50 @@ +clc
+clear
+disp("Example 8.13")
+printf("\n")
+disp("convert the following decimael numbers to Octal")
+disp("a)283 b)847.951 c)0.728")
+//given decimal number
+i=1;x=1
+dec=283
+//separating integer part
+IP=floor(dec)
+IP1=IP
+//separating decimal part
+DP=modulo(dec,1)
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=(modulo(floor(IP),8))
+ IP=floor(IP)/8
+ i=i+1
+end
+if(IP1>0)
+IP=0
+for j=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(j)*10^(j-1));
+ end
+else
+ IP=0
+end
+
+//storing each decimal digit in D(x)
+if(DP<1)
+ if(DP>0)
+while(x<=4)
+ DP=DP*8
+ D(x)=floor(DP)
+ x=x+1
+ DP=modulo(DP,1)
+end
+
+DP=0
+for j=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(10^(-1*j)*D(j))
+ end
+end
+end
+octal=IP+DP
+printf("Octal format")
+disp(octal)
diff --git a/275/CH8/EX8.8.14/Ch8_8_14.sce b/275/CH8/EX8.8.14/Ch8_8_14.sce new file mode 100755 index 000000000..f2282224a --- /dev/null +++ b/275/CH8/EX8.8.14/Ch8_8_14.sce @@ -0,0 +1,119 @@ +clc
+clear
+disp("Example 8.14")
+printf("\n")
+disp("convert the following binary number to Octal")
+disp("a)101111 b)1010101 c)1110.01101")
+i=1;x=1;w=1
+//convert binary to decimal
+bin=101111
+//separating integer part
+IP=floor(bin)
+IP1=IP
+//separating decimal part
+DP=modulo(bin,1)
+DP1=DP
+//converting decimal value to interger
+p=5
+DP=DP*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=modulo(IP,10);
+ IP=floor(IP/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DP>0)
+ D(w)=modulo(DP,2)
+ DP=(DP/10)
+ DP=floor(DP)
+ w=w+1;
+ end
+ //to do zero padding of remaining erm of D(w)
+ if(DP1>0)
+ if(DP1<1)
+if(length(D)<p)
+ q=length(D)
+ for f=q+1 :p
+ D(f)=0
+ end
+ end
+end
+end
+if(IP1>0)
+for i=1:length(I)//checking whether it is a binary number or not
+ if(I(i)>1) then
+ disp('not a binary number')
+ abort
+ end
+ end
+end
+if(IP1>0)
+IP=0
+for i=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(i)*2^(i-1))
+ end
+end
+if(DP1>0)
+ if(DP1<1)
+DP=0
+for z=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(D(z)*2^(-1*(length(D)+1-z)))
+ end
+ else
+ DP=0
+end
+else
+DP=0
+end
+decimal=IP+DP
+//displaying the output
+disp(decimal)
+
+
+
+//convert decimal to octal
+i=1;
+//separating integer part
+IP2=floor(decimal)
+IP3=IP2
+//separating decimal part
+DP2=modulo(decimal,1)
+//storing each integer digit in I(i)
+while(IP2>0)
+ J(i)=(modulo(floor(IP2),8))
+ IP2=floor(IP2)/8
+ i=i+1
+end
+if(IP3>0)
+IP2=0
+for j=1:length(J)
+//multipliying bits of integer part with their position values and adding
+ IP2=IP2+(J(j)*10^(j-1));
+ end
+else
+ IP2=0
+end
+
+//storing each decimal digit in D(x)
+if(DP2<1)
+ if(DP2>0)
+while(x<=4)
+ DP2=DP2*8
+ E(x)=floor(DP2)
+ x=x+1
+ DP2=modulo(DP2,1)
+end
+
+DP2=0
+for j=1:length(E)
+//multipliying bits of decimal part with their position values and adding
+ DP2=DP2+(10^(-1*j)*E(j))
+ end
+end
+end
+octal=IP2+DP2
+printf("Octal format")
+disp(octal)
diff --git a/275/CH8/EX8.8.15/Ch8_8_15.sce b/275/CH8/EX8.8.15/Ch8_8_15.sce new file mode 100755 index 000000000..fc411fdf8 --- /dev/null +++ b/275/CH8/EX8.8.15/Ch8_8_15.sce @@ -0,0 +1,121 @@ +clc
+clear
+disp("Example 8.15")
+printf("\n")
+disp("convert the following octal to binary number")
+disp("a)724 b)365.217 c)0.506")
+//Given binary number
+i=1;w=1
+bin=724
+//separating integer part
+IP=floor(bin)
+IP1=IP
+//separating decimal part
+DP=modulo(bin,1)
+DP1=DP
+//converting decimal value to interger
+p=2
+DP=DP*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=modulo(IP,10);
+ IP=floor(IP/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DP>0)
+ D(w)=modulo(DP,10)
+ DP=(DP/10)
+ DP=floor(DP)
+ w=w+1;
+ end
+//to do zero padding of remaining erm of D(w)
+if(DP1<1)
+ if(DP1>0)
+if(length(D)<p)
+ q=length(D)
+ for f=q+1 :p
+ D(f)=0
+ end
+ end
+end
+end
+
+if(IP1>0)
+for i=1:length(I)//checking whether it is a octal number or not
+ if(I(i)>8) then
+ disp('not a octal number')
+ abort
+ end
+ end
+end
+if(IP1>0)
+IP=0
+for i=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(i)*8^(i-1))
+ end
+end
+
+if(DP1<1)
+ if(DP1>0)
+DP=0
+for z=1:length(D)
+ //multipliying bits of decimal part with their position values and adding
+ if(D(z)<8)
+ DP=DP+(D(z)*8^(-1*(length(D)+1-z)))
+ else
+ IP=0
+ DP=0
+ printf("not a octal number")
+ abort
+ end
+end
+end
+
+decimal=IP+DP
+//displaying the output
+disp(decimal)
+
+
+
+//decimal to Binary
+//given decimal number
+i=1;x=1
+//separating integer part
+IP2=floor(decimal)
+IP3=IP2
+//separating decimal part
+DP2=modulo(decimal,1)
+//storing each integer digit in I(i)
+while(IP2>0)
+ J(i)=(modulo(floor(IP2),2))
+ IP2=floor(IP2)/2
+ i=i+1
+end
+if(IP3>0)
+IP2=0
+for j=1:length(J)
+//multipliying bits of integer part with their position values and adding
+ IP2=IP2+(J(j)*10^(j-1));
+ end
+else
+ IP2=0
+end
+
+//storing each decimal digit in D(x)
+while(x<=4)
+ DP2=DP2*2
+ E(x)=floor(DP)
+ x=x+1
+ DP2=modulo(DP2,1)
+end
+
+DP2=0
+for j=1:length(E)
+//multipliying bits of decimal part with their position values and adding
+ DP2=DP2+(10^(-1*j)*E(j))
+end
+Binary=IP2+DP2;
+printf("Binary format")
+disp(Binary)
diff --git a/275/CH8/EX8.8.17/Ch8_8_17.sce b/275/CH8/EX8.8.17/Ch8_8_17.sce new file mode 100755 index 000000000..a55db7156 --- /dev/null +++ b/275/CH8/EX8.8.17/Ch8_8_17.sce @@ -0,0 +1,10 @@ +clc
+clear
+disp("Example 8.17")
+printf("\n")
+disp("convert the following hexadecimael numbers to decimal")
+disp("a)FACE b)31C c)CAD")
+//this progra, converts only integer part to decimal
+Hdec='FACE'
+dec=hex2dec(Hdec);
+printf("decimal=%d",dec)
\ No newline at end of file diff --git a/275/CH8/EX8.8.18/Ch8_8_18.sce b/275/CH8/EX8.8.18/Ch8_8_18.sce new file mode 100755 index 000000000..79b824143 --- /dev/null +++ b/275/CH8/EX8.8.18/Ch8_8_18.sce @@ -0,0 +1,10 @@ +clc
+clear
+disp("Example 8.17")
+printf("\n")
+disp("convert the following decimael numbers to hexadecimal")
+disp("a)2146 b)843 c)2604")
+//this program, converts only integer part to hexadecimal
+dec=843
+Hdec=dec2hex(dec);
+printf("decimal=%s",Hdec)
diff --git a/275/CH8/EX8.8.19/Ch8_8_19.sce b/275/CH8/EX8.8.19/Ch8_8_19.sce new file mode 100755 index 000000000..8ff17ea54 --- /dev/null +++ b/275/CH8/EX8.8.19/Ch8_8_19.sce @@ -0,0 +1,11 @@ +clc
+clear
+disp("Example 8.19")
+printf("\n")
+disp("convert the following binary numbers to hexadecimal")
+disp("a)101110 b)11010 c)1011101")
+//this program, converts only integer part to decimal
+bin='101110'
+dec=bin2dec(bin)
+Hdec=dec2hex(dec)
+printf("decimal=%s",Hdec)
diff --git a/275/CH8/EX8.8.21/Ch8_8_21.sce b/275/CH8/EX8.8.21/Ch8_8_21.sce new file mode 100755 index 000000000..53a3b7837 --- /dev/null +++ b/275/CH8/EX8.8.21/Ch8_8_21.sce @@ -0,0 +1,182 @@ +kclc
+clear
+disp("Example 8.21")
+printf("\n")
+disp("Add the following binary numbers")
+disp("a)11011 & 10110 b)1100 & 111 c)10.1011 & 11.011")
+//Given binary number
+i=1;w=1
+a=11011
+b=10110
+//Given binary number
+i=1;w=1
+bin=11.101
+//separating integer part
+IPa=floor(a)
+IP1a=IPa
+//separating decimal part
+DPa=modulo(a,1)
+DP1a=DPa
+//converting decimal value to interger
+p=4
+DPa=DPa*10^p //should change power of 10 as according to number of digits in decimal digit
+
+//storing each integer digit in I(i)
+while(IPa>0)
+ Ia(i)=modulo(IPa,10);
+ IPa=floor(IPa/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DPa>0)
+ Da(w)=modulo(DPa,2)
+ DPa=(DPa/10)
+ DPa=floor(DPa)
+ w=w+1;
+ end
+ //to do zero padding of remaining erm of D(w)
+ if(DP1a<1)
+ if(DP1a>0)
+if(length(Da)<p)
+ q=length(Da)
+ for f=q+1 :p
+ Da(f)=0
+ end
+ end
+end
+end
+
+if(IP1a>0)
+for i=1:length(Ia)//checking whether it is a binary number or not
+ if(Ia(i)>1) then
+ disp('not a binary number')
+ abort
+ end
+ end
+end
+if(IP1a>0)
+IPa=0
+for i=1:length(Ia)
+//multipliying bits of integer part with their position values and adding
+ IPa=IPa+(Ia(i)*2^(i-1))
+ end
+ end
+ DPa=0
+ if(DP1a>0)
+ if(DP1a<1)
+for z=1:length(Da)
+//multipliying bits of decimal part with their position values and adding
+ DPa=DPa+(Da(z)*2^(-1*(length(Da)+1-z)))
+ end
+end
+end
+decimala=IPa+DPa
+//displaying the output
+disp(decimala)
+
+//for b
+//Given binary number
+i=1;w=1
+//separating integer part
+IPb=floor(b)
+IP1b=IPb
+//separating decimal part
+DPb=modulo(b,1)
+DP1b=DPb
+//converting decimal value to interger
+p=3
+DPb=DPb*10^p //should change power of 10 as according to number of digits in decimal digit
+
+//storing each integer digit in I(i)
+while(IPb>0)
+ Ib(i)=modulo(IPb,10);
+ IPb=floor(IPb/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DPb>0)
+ Db(w)=modulo(DPb,2)
+ DPb=(DPb/10)
+ DPb=floor(DPb)
+ w=w+1;
+ end
+ //to do zero padding of remaining erm of D(w)
+ if(DP1b>0)
+ if(DP1b<1)
+if(length(Db)<p)
+ q=length(Db)
+ for f=q+1 :p
+ Db(f)=0
+ end
+ end
+end
+end
+if(IP1b>0)
+for i=1:length(Ib)//checking whether it is a binary number or not
+ if(Ib(i)>1) then
+ disp('not a binary number')
+ abort
+ end
+ end
+end
+if(IP1b>0)
+IPb=0
+for i=1:length(Ib)
+//multipliying bits of integer part with their position values and adding
+ IPb=IPb+(Ib(i)*2^(i-1))
+ end
+ end
+DPb=0
+if(DP1b>0)
+ if(DP1b<1)
+ for z=1:length(Db)
+//multipliying bits of decimal part with their position values and adding
+ DPb=DPb+(Db(z)*2^(-1*(length(Db)+1-z)))
+ end
+end
+end
+decimalb=IPb+DPb
+//displaying the output
+disp(decimalb)
+
+sum1=decimala+decimalb
+i=1;x=1
+
+//separating integer part
+IP=floor(sum1)
+IP1=IP
+//separating decimal part
+DP=modulo(sum1,1)
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=(modulo(floor(IP),2))
+ IP=floor(IP)/2
+ i=i+1
+end
+if(IP1>0)
+IP=0
+for j=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(j)*10^(j-1));
+ end
+else
+ IP=0
+end
+
+//storing each decimal digit in D(x)
+while(x<=4)
+ DP=DP*2
+ D(x)=floor(DP)
+ x=x+1
+ DP=modulo(DP,1)
+end
+
+DP=0
+for j=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(10^(-1*j)*D(j))
+end
+Binary=IP+DP;
+printf("Sum")
+disp(Binary)
+
diff --git a/275/CH8/EX8.8.23/Ch8_8_23.sce b/275/CH8/EX8.8.23/Ch8_8_23.sce new file mode 100755 index 000000000..83f61d32c --- /dev/null +++ b/275/CH8/EX8.8.23/Ch8_8_23.sce @@ -0,0 +1,196 @@ +clc
+clear
+disp("Example 8.23")
+printf("\n")
+disp("Add the following octal numbers")
+disp("a)46 & 375 b)27.34 & 11.76")
+//Given octal number
+i=1;w=1
+a=46
+b=375
+//separating integer part
+IPa=floor(a)
+IP1a=IPa
+//separating decimal part
+DPa=modulo(a,1)
+DP1a=DPa
+//converting decimal value to interger
+p=2
+DPa=DPa*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IPa>0)
+ Ia(i)=modulo(IPa,10);
+ IPa=floor(IPa/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DPa>0)
+ Da(w)=modulo(DPa,10)
+ DPa=(DPa/10)
+ DPa=floor(DPa)
+ w=w+1;
+ end
+//to do zero padding of remaining erm of D(w)
+if(DP1a<1)
+ if(DP1a>0)
+if(length(Da)<p)
+ q=length(Da)
+ for f=q+1 :p
+ Da(f)=0
+ end
+ end
+end
+end
+
+if(IP1a>0)
+for i=1:length(Ia)//checking whether it is a octal number or not
+ if(Ia(i)>8) then
+ disp('not a octal number')
+ abort
+ end
+ end
+end
+if(IP1a>0)
+IPa=0
+for i=1:length(Ia)
+//multipliying bits of integer part with their position values and adding
+ IPa=IPa+(Ia(i)*8^(i-1))
+ end
+end
+
+if(DP1a<1)
+ if(DP1a>0)
+DPa=0
+for z=1:length(Da)
+ //multipliying bits of decimal part with their position values and adding
+ if(Da(z)<8)
+ DPa=DPa+(Da(z)*8^(-1*(length(Da)+1-z)))
+ else
+ IPa=0
+ DPa=0
+ printf("not a octal number")
+ abort
+ end
+end
+end
+
+decimala=IPa+DPa
+//displaying the output
+disp(decimala)
+
+//for b
+//Given octal number
+i=1;w=1
+//separating integer part
+IPb=floor(b)
+IP1b=IPb
+//separating decimal part
+DPb=modulo(b,1)
+DP1b=DPb
+//converting decimal value to interger
+p=2
+DPb=DPb*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IPb>0)
+ Ib(i)=modulo(IPb,10);
+ IPb=floor(IPb/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DPb>0)
+ Db(w)=modulo(DPb,10)
+ DPb=(DPb/10)
+ DPb=floor(DPb)
+ w=w+1;
+ end
+//to do zero padding of remaining erm of D(w)
+if(DP1b<1)
+ if(DP1b>0)
+if(length(Db)<p)
+ q=length(Db)
+ for f=q+1 :p
+ Db(f)=0
+ end
+ end
+end
+end
+
+if(IP1b>0)
+for i=1:length(Ib)//checking whether it is a octal number or not
+ if(Ib(i)>8) then
+ disp('not a octal number')
+ abort
+ end
+ end
+end
+if(IP1b>0)
+IPb=0
+for i=1:length(Ib)
+//multipliying bits of integer part with their position values and adding
+ IPb=IPb+(Ib(i)*8^(i-1))
+ end
+end
+
+if(DP1b<1)
+ if(DP1b>0)
+DPb=0
+for z=1:length(Db)
+ //multipliying bits of decimal part with their position values and adding
+ if(Db(z)<8)
+ DPb=DPb+(Db(z)*8^(-1*(length(Db)+1-z)))
+ else
+ IPb=0
+ DPb=0
+ printf("not a octal number")
+ abort
+ end
+end
+end
+
+decimalb=IPb+DPb
+//displaying the output
+disp(decimalb)
+
+sum1=decimala+decimalb
+i=1;x=1
+//separating integer part
+IP=floor(sum1)
+IP1=IP
+//separating decimal part
+DP=modulo(sum1,1)
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=(modulo(floor(IP),8))
+ IP=floor(IP)/8
+ i=i+1
+end
+if(IP1>0)
+IP=0
+for j=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(j)*10^(j-1));
+ end
+else
+ IP=0
+end
+
+//storing each decimal digit in D(x)
+if(DP<1)
+ if(DP>0)
+while(x<=4)
+ DP=DP*8
+ D(x)=floor(DP)
+ x=x+1
+ DP=modulo(DP,1)
+end
+
+DP=0
+for j=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(10^(-1*j)*D(j))
+ end
+end
+end
+octal=IP+DP
+printf("Sum")
+disp(octal)
diff --git a/275/CH8/EX8.8.25/Ch8_8_25.sce b/275/CH8/EX8.8.25/Ch8_8_25.sce new file mode 100755 index 000000000..8f9a6edb0 --- /dev/null +++ b/275/CH8/EX8.8.25/Ch8_8_25.sce @@ -0,0 +1,14 @@ +clc
+clear
+disp("Example 8.25")
+printf("\n")
+disp("Add the following hexadecimal numbers")
+disp("a)ABC & ABCDE b) DEF & 12EF")
+//this program add only integer part
+a='ABC'
+b='ABCDE'
+a1=hex2dec(a)
+a2=hex2dec(b)
+sum1=a1+a2
+sumhex=dec2hex(sum1)
+printf("%s",sumhex)
\ No newline at end of file diff --git a/275/CH8/EX8.8.30a/Ch8_8_30a.sce b/275/CH8/EX8.8.30a/Ch8_8_30a.sce new file mode 100755 index 000000000..7c0c1dbb7 --- /dev/null +++ b/275/CH8/EX8.8.30a/Ch8_8_30a.sce @@ -0,0 +1,33 @@ +clc
+clear
+disp("Example 8.30a")
+printf("\n")
+disp("perform the following decimal subtraction using 9s complements")
+disp("a)49-24 b)321-578")
+//given numbers
+a=49
+b=-24
+//should set to 99 if input is 2 digit number,999 if 3digit number
+c=99
+//add c with 2nd operand
+e=c+b
+N=a+e
+if(N>100)
+ if(N<199)
+ M=N-100
+ M=M+1
+ N=M
+end
+end
+if(N>1000)
+ if(N<1999)
+ M=N-1000
+ M=M+1
+ N=M
+end
+end
+ M=N
+if(-b>a)
+ M=-(999-M)
+end
+printf("result=%d",M)
\ No newline at end of file diff --git a/275/CH8/EX8.8.30b/Ch8_8_30b.sce b/275/CH8/EX8.8.30b/Ch8_8_30b.sce new file mode 100755 index 000000000..73020d16a --- /dev/null +++ b/275/CH8/EX8.8.30b/Ch8_8_30b.sce @@ -0,0 +1,31 @@ +clc
+clear
+disp("Example 8.30b")
+printf("\n")
+disp("perform the following decimal subtraction using 10s complements")
+disp("a)49-24 b)321-578")
+//given numbers
+a=49
+b=-24
+//should set to 100 if input is 2 digit number,1000 if 3digit number
+c=1000
+//add c with 2nd operand
+e=c+b
+N=a+e
+if(N>100)
+ if(N<199)
+ M=N-100
+ N=M
+end
+end
+if(N>1000)
+ if(N<1999)
+ M=N-1000
+ N=M
+end
+end
+ M=N
+if(-b>a)
+ M=-(999-M+1)
+end
+printf("result=%d",M)
diff --git a/275/CH8/EX8.8.31a/Ch8_8_31a.sce b/275/CH8/EX8.8.31a/Ch8_8_31a.sce new file mode 100755 index 000000000..bc5abac67 --- /dev/null +++ b/275/CH8/EX8.8.31a/Ch8_8_31a.sce @@ -0,0 +1,43 @@ +clc
+clear
+disp("Example 8.31a")
+printf("\n")
+disp("perform the following binary substraction using 1s complement")
+disp("a)1010-0111 b)0110-1101")
+a=[1 0 1 0]
+b=~[0 1 1 1]
+d=0
+for i=1:length(a)
+ c(i)=a(length(a)+1-i)+b(length(a)+1-i)+d
+ if(c(i)==1)
+ d=0
+ end
+ if[c(i)==2]
+ d=1
+ c(i)=0
+ end
+end
+f=1
+if(d==1)
+ for i=1:length(a)
+ g(i)=c(i)+f
+ if(g(i)==1)
+ f=0
+ end
+ if(g(i)==2)
+ f=1
+ g(i)=0
+ end
+
+ end
+ for i=1:length(a)
+ c(i)=g(i)
+ end
+end
+if(d==0)
+ for i=1:length(a)
+ c(i)=~c(i)
+ end
+end
+printf("result =%d%d%d%d",c(4),c(3),c(2),c(1))
+
diff --git a/275/CH8/EX8.8.31b/Ch8_8_31b.sce b/275/CH8/EX8.8.31b/Ch8_8_31b.sce new file mode 100755 index 000000000..4cc46ef35 --- /dev/null +++ b/275/CH8/EX8.8.31b/Ch8_8_31b.sce @@ -0,0 +1,62 @@ +clc
+clear
+disp("Example 8.31b")
+printf("\n")
+disp("perform the following binary substraction using 2s complement")
+disp("a)1010-0111 b)0110-1101")
+a=[1 0 1 0]
+b=~[0 1 1 1]
+d=0
+h=1
+for i=1:length(b)
+ n(i)=b(length(b)+1-i)+h
+ if(n(i)==1)
+ h=0
+ end
+ if(n(i)==2)
+ h=1
+ n(i)=0
+ end
+
+ end
+ for i=1:length(a)
+ b(i)=n(i)
+ end
+
+
+for i=1:length(a)
+ c(i)=a(length(a)+1-i)+b(length(a)+1-i)+d
+ if(c(i)==1)
+ d=0
+ end
+ if[c(i)==2]
+ d=1
+ c(i)=0
+ end
+end
+
+
+if(d==0)
+ for i=1:length(a)
+ c(i)=~c(i)
+end
+j=1
+for i=1:length(b)
+ m(i)=c(i)+j
+ if(m(i)==1)
+ f=0
+ end
+ if(m(i)==2)
+ j=1
+ m(i)=0
+ end
+
+ end
+ for i=1:length(a)
+ c(i)=m(i)
+ end
+end
+for i=1:length(a)
+ C(i)=c(i)
+end
+printf("result =%d%d%d%d",c(4),c(3),c(2),c(1))
\ No newline at end of file diff --git a/275/CH8/EX8.8.48a/Ch8_8_48a.sce b/275/CH8/EX8.8.48a/Ch8_8_48a.sce new file mode 100755 index 000000000..a77924ce1 --- /dev/null +++ b/275/CH8/EX8.8.48a/Ch8_8_48a.sce @@ -0,0 +1,30 @@ +clc
+clear
+disp("Example 8.48a")
+printf("\n")
+disp("Prove the following boolean thereom")
+disp("A+AB=A")
+disp("A=a,B=b,AB=s,A+AB=d")
+a=[0 0 1 1]
+b=[0 1 0 1]
+for i=1:length(a)
+ s(i)=a(i)*b(i)
+end
+for i=1:length(a)
+ d(i)=s(i)+a(i)
+ if(d(i)==2)
+ d(i)=1
+ end
+
+end
+
+for i=1:length(a)
+ if(a(i)==d(i))
+ printf("")
+ else
+ printf("not")
+ abort
+ end
+
+end
+printf("yes")
\ No newline at end of file diff --git a/275/CH8/EX8.8.48b/Ch8_8_48b.sce b/275/CH8/EX8.8.48b/Ch8_8_48b.sce new file mode 100755 index 000000000..11a01cf43 --- /dev/null +++ b/275/CH8/EX8.8.48b/Ch8_8_48b.sce @@ -0,0 +1,37 @@ +clc
+clear
+disp("Example 8.48b")
+printf("\n")
+disp("Prove the following boolean thereom")
+disp("A+AB=A")
+disp("A=a,B=b,A1B=s,A+A1B=d")
+a=[0 0 1 1]
+b=[0 1 0 1]
+for i=1:length(a)
+ s(i)=(~a(i))*b(i)
+end
+for i=1:length(a)
+ d(i)=s(i)+a(i)
+ if(d(i)==2)
+ d(i)=1
+ end
+
+end
+
+for i=1:length(a)
+ e(i)=a(i)+b(i)
+ if(e(i)==2)
+ e(i)=1
+ end
+end
+
+for i=1:length(a)
+ if((e(i)==d(i)))
+ printf("_")
+ else
+ printf("not")
+ abort
+ end
+
+end
+printf("yes")
\ No newline at end of file diff --git a/275/CH8/EX8.8.49a/Ch8_8_49a.sce b/275/CH8/EX8.8.49a/Ch8_8_49a.sce new file mode 100755 index 000000000..95fe639c7 --- /dev/null +++ b/275/CH8/EX8.8.49a/Ch8_8_49a.sce @@ -0,0 +1,39 @@ +clc
+clear
+disp("Example 8.49a")
+printf("\n")
+disp("Prove the following boolean identities")
+disp("A+BC=(A+B)(A+C)")
+A=[0 0 0 0 1 1 1 1]
+B=[0 0 1 1 0 0 1 1]
+C=[0 1 0 1 0 1 0 1]
+for i=1:length(A)
+ Y(i)=A(i)+(B(i)*C(i))
+ if(Y(i)==2)
+ Y(i)=1
+ end
+end
+for i=1:length(A)
+ Z(i)=(A(i)+B(i))*(A(i)+C(i))
+ if(Z(i)==2)
+ Z(i)=1
+ end
+ if(Z(i)==3)
+ Z(i)=1
+ end
+ if(Z(i)==4)
+ Z(i)=1
+ end
+end
+for i=1:length(A)
+ if(Z(i)==Y(i))
+ printf("_")
+ else
+ printf("NOT")
+ abort
+ end
+end
+
+ printf("proved")
+
+
\ No newline at end of file diff --git a/275/CH8/EX8.8.49b/Ch8_8_49b.sce b/275/CH8/EX8.8.49b/Ch8_8_49b.sce new file mode 100755 index 000000000..3efa08162 --- /dev/null +++ b/275/CH8/EX8.8.49b/Ch8_8_49b.sce @@ -0,0 +1,33 @@ +clc
+clear
+disp("Example 8.49b")
+printf("\n")
+disp("Prove the following boolean identities")
+disp("ABC+AB1C+ABC1=AB+AC")
+A=[0 0 0 0 1 1 1 1]
+B=[0 0 1 1 0 0 1 1]
+C=[0 1 0 1 0 1 0 1]
+for i=1:length(A)
+ Y(i)=(A(i)*B(i)*C(i))+(A(i)*(~B(i))*C(i))+(A(i)*B(i)*(~C(i)))
+ if(Y(i)==3)
+ Y(i)=1
+ end
+ if(Y(i)==2)
+ Y(i)=1
+ end
+end
+for i=1:length(A)
+ Z(i)=(A(i)*B(i))+(A(i)*C(i))
+ if(Z(i)==2)
+ Z(i)=1
+ end
+end
+for i=1:length(A)
+ if(Z(i)==Y(i))
+ printf("_")
+ else
+ printf("NOT")
+ abort
+ end
+end
+ printf("proved")
diff --git a/275/CH8/EX8.8.50a/Ch8_8_50a.sce b/275/CH8/EX8.8.50a/Ch8_8_50a.sce new file mode 100755 index 000000000..f09a387fc --- /dev/null +++ b/275/CH8/EX8.8.50a/Ch8_8_50a.sce @@ -0,0 +1,16 @@ +clc
+clear
+disp("Example 8.50a")
+printf("\n")
+disp("Construct the Truth Table for logic expression")
+disp("AB1+C1")
+A=[0 0 0 0 1 1 1 1]
+B=[0 0 1 1 0 0 1 1]
+C=[0 1 0 1 0 1 0 1]
+for i=1:length(A)
+ f(i)=(A(i)*(~(B(i))))+(~C(i))
+ if(f(i)==2)
+ f(i)=1
+ end
+end
+printf("truth table =%d%d%d%d%d%d%d%d",f(1),f(2),f(3),f(4),f(5),f(6),f(7),f(8))
\ No newline at end of file diff --git a/275/CH8/EX8.8.50b/Ch8_8_50b.sce b/275/CH8/EX8.8.50b/Ch8_8_50b.sce new file mode 100755 index 000000000..e026d3dc1 --- /dev/null +++ b/275/CH8/EX8.8.50b/Ch8_8_50b.sce @@ -0,0 +1,15 @@ +clc
+clear
+disp("Example 8.50b")
+printf("\n")
+disp("Construct the Truth Table for logic expression")
+disp("AB1+A1B")
+A=[0 0 1 1]
+B=[0 1 0 1]
+for i=1:length(A)
+ f(i)=(A(i)*(~(B(i))))+(B(i)*(~(A(i))))
+ if(f(i)==2)
+ f(i)=1
+ end
+end
+printf("truth table =%d%d%d%d",f(1),f(2),f(3),f(4))
\ No newline at end of file diff --git a/275/CH8/EX8.8.50c/Ch8_8_50c.sce b/275/CH8/EX8.8.50c/Ch8_8_50c.sce new file mode 100755 index 000000000..7f1f8efac --- /dev/null +++ b/275/CH8/EX8.8.50c/Ch8_8_50c.sce @@ -0,0 +1,16 @@ +clc
+clear
+disp("Example 8.50c")
+printf("\n")
+disp("Construct the Truth Table for logic expression")
+disp("C1((B+D)1)")
+B=[0 0 0 0 1 1 1 1]
+C=[0 0 1 1 0 0 1 1]
+D=[0 1 0 1 0 1 0 1]
+for i=1:length(B)
+ f(i)=(~(C(i)))*(~(B(i)+D(i)))
+ if (f(i)==2)
+ f(i)=1
+ end
+end
+printf("truth table =%d%d%d%d%d%d%d%d",f(1),f(2),f(3),f(4),f(5),f(6),f(7),f(8))
\ No newline at end of file diff --git a/275/CH8/EX8.8.7/Ch8_8_7.sce b/275/CH8/EX8.8.7/Ch8_8_7.sce new file mode 100755 index 000000000..a9f2a9813 --- /dev/null +++ b/275/CH8/EX8.8.7/Ch8_8_7.sce @@ -0,0 +1,29 @@ +clc
+disp("Example 8.7")
+printf("\n")
+disp("convert the following binary numbers to decimal")
+disp("a)1011 b)110101 c)10101")
+//Given binary number
+bin=1011
+i=1
+//storing each integer digit in b(i)
+while(bin>0)
+ b(i)=modulo(bin,10)
+ bin=floor(bin/10)
+ i=i+1;
+end
+//checking whether it is a binary number or not
+for i=1:length(b)
+ if(b(i)>1) then
+ disp('not a binary number')
+ abort
+ end
+ end
+dec=0
+for i=1:length(b)
+//multipliying bits of integer part with their position values and adding
+ dec=dec+(b(i)*2^(i-1))
+end
+//displaying the output
+printf("decimal format is")
+disp(dec)
diff --git a/275/CH8/EX8.8.8/Ch8_8_8.sce b/275/CH8/EX8.8.8/Ch8_8_8.sce new file mode 100755 index 000000000..d8bfda1a3 --- /dev/null +++ b/275/CH8/EX8.8.8/Ch8_8_8.sce @@ -0,0 +1,61 @@ +clc
+clear
+disp("Example 8.8")
+printf("\n")
+disp("convert the following binary numbers to decimal")
+disp("a)11.101 b)0.0111 c)110.1101")
+//Given binary number
+i=1;w=1
+bin=11.101
+//separating integer part
+IP=floor(bin)
+IP1=IP
+//separating decimal part
+DP=modulo(bin,1)
+//converting decimal value to interger
+p=4
+DP=DP*10^p //should change power of 10 as according to number of digits in decimal digit
+//storing each integer digit in I(i)
+while(IP>0)
+ I(i)=modulo(IP,10);
+ IP=floor(IP/10);
+ i=i+1;
+ end
+//storing each decimal digit in D(w)
+while(DP>0)
+ D(w)=modulo(DP,2)
+ DP=(DP/10)
+ DP=floor(DP)
+ w=w+1;
+ end
+//to do zero padding of remaining erm of D(w)
+if(length(D)<p)
+ q=length(D)
+ for f=q+1 :p
+ D(f)=0
+ end
+end
+if(IP1>0)
+for i=1:length(I)//checking whether it is a binary number or not
+ if(I(i)>1) then
+ disp('not a binary number')
+ abort
+ end
+ end
+end
+if(IP1>0)
+IP=0
+for i=1:length(I)
+//multipliying bits of integer part with their position values and adding
+ IP=IP+(I(i)*2^(i-1))
+ end
+ end
+DP=0
+for z=1:length(D)
+//multipliying bits of decimal part with their position values and adding
+ DP=DP+(D(z)*2^(-1*(length(D)+1-z)))
+end
+decimal=IP+DP
+//displaying the output
+printf("Decimal format is")
+disp(decimal)
|