summaryrefslogtreecommitdiff
path: root/1757/CH11
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1757/CH11
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '1757/CH11')
-rwxr-xr-x1757/CH11/EX11.1/EX11_1.sce11
-rwxr-xr-x1757/CH11/EX11.10/EX11_10.sce23
-rwxr-xr-x1757/CH11/EX11.11/EX11_11.sce39
-rwxr-xr-x1757/CH11/EX11.2/EX11_2.sce32
-rwxr-xr-x1757/CH11/EX11.3/EX11_3.sce10
-rwxr-xr-x1757/CH11/EX11.4/EX11_4.sce13
-rwxr-xr-x1757/CH11/EX11.5/EX11_5.sce57
-rwxr-xr-x1757/CH11/EX11.6/EX11_6.sce69
-rwxr-xr-x1757/CH11/EX11.7/EX11_7.sce54
-rwxr-xr-x1757/CH11/EX11.8/EX11_8.sce65
-rwxr-xr-x1757/CH11/EX11.9/EX11_9.sce70
11 files changed, 443 insertions, 0 deletions
diff --git a/1757/CH11/EX11.1/EX11_1.sce b/1757/CH11/EX11.1/EX11_1.sce
new file mode 100755
index 000000000..f57b8bbe2
--- /dev/null
+++ b/1757/CH11/EX11.1/EX11_1.sce
@@ -0,0 +1,11 @@
+//Example11.1 // to determine the full scale voltage of D/A
+clc;
+clear;
+close;
+Vref = 12 ;
+Rf = 10 ; // K ohm
+R = 5 ; // K ohm
+
+// the full scale voltage of D/A converter
+VFS = Vref*(Rf/R) ;
+disp('the full scale voltage of D/A converter VFS is = '+string(VFS)+ ' V ');
diff --git a/1757/CH11/EX11.10/EX11_10.sce b/1757/CH11/EX11.10/EX11_10.sce
new file mode 100755
index 000000000..07b9a8a0c
--- /dev/null
+++ b/1757/CH11/EX11.10/EX11_10.sce
@@ -0,0 +1,23 @@
+//Example11.10 // determine the analog output voltage and feed back current If
+clc;
+clear;
+close;
+Vref = 15 ;
+BI = 1000 ;
+Rf = 40 ; // K ohm
+R = 0.4*Rf ;
+
+// by using voltage divider rule Vin can be calculated as
+ Vin = -(Vref*2*R)/(2*R+2*R) ;
+
+// The output voltage of given R-2R ladder D/A converter is defined as
+
+// Vo = -(Rf*Vin/R)
+
+Vo = (Vref*Rf)/(2*R)
+disp('for the binary input 1000 output voltage is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
diff --git a/1757/CH11/EX11.11/EX11_11.sce b/1757/CH11/EX11.11/EX11_11.sce
new file mode 100755
index 000000000..ed15265fb
--- /dev/null
+++ b/1757/CH11/EX11.11/EX11_11.sce
@@ -0,0 +1,39 @@
+//Example11.11 // to find the resolution and analog output voltage of 8-bit D/A converter
+clc;
+clear;
+close;
+VFS = 10 ;
+N = 8 ;
+BI = 10101111 ; BI = 11100011 ; BI = 00101001 ; BI = 01000110
+
+// the resolution of 8-bit D/A converter is defined as
+Resolution = VFS/(2^N-1) ;
+
+// An analog output voltage of D/A converter is given by
+// Vo = Resolution*(2^-0*b0+2^-1*b1+....+2^-N*bn-1)
+// Vo = Resolution*(2^-0*b0+2^-1*b1+2^-2*b2+2^-3*b3+2^-4*b4+2^-5*b5+2^-6*b6+2^-7*b7);
+
+// For the BI 10101111 output analog voltage is
+BI = '10101111';
+BI = bin2dec(BI);
+Vo = Resolution*BI ;
+disp('For the BI 10101111 output analog voltage is = '+string(Vo)+ ' V ');
+
+// For the BI 11100010 output analog voltage is
+BI = '11100010';
+BI = bin2dec(BI);
+Vo = Resolution*BI ;
+disp('For the BI 11100010 output analog voltage is = '+string(Vo)+ ' V ');
+
+// For the BI 00101001 output analog voltage is
+BI = '00101001';
+BI = bin2dec(BI);
+Vo = Resolution*BI ;
+disp('For the BI 00101001 output analog voltage is = '+string(Vo)+ ' V ');
+
+// For the BI 01000110 output analog voltage is
+BI = '01000110';
+BI = bin2dec(BI);
+Vo = Resolution*BI ;
+disp('For the BI 01000110 output analog voltage is = '+string(Vo)+ ' V ');
+
diff --git a/1757/CH11/EX11.2/EX11_2.sce b/1757/CH11/EX11.2/EX11_2.sce
new file mode 100755
index 000000000..e3d889d40
--- /dev/null
+++ b/1757/CH11/EX11.2/EX11_2.sce
@@ -0,0 +1,32 @@
+//Example11.2 // determine the output voltage of D/A converter for the binary inputs a) 10101010 b) 11001100 c) 11101110 d) 00010001
+clc;
+clear;
+close;
+del = 12*10^-3 ; // mA
+
+// the input voltage of D/A converter
+ //Vo = del*binary input (BI)
+
+// For BI 10101010 the output
+BI = '10101010' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 10101010 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 11001100 the output
+BI = '11001100' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 11001100 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 11101110 the output
+BI = '11101110' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 11101110 the output of D/A converter is = ' +string(Vo)+ ' V ');
+
+// For BI 00010001 the output
+BI = '00010001' ;
+BI = bin2dec(BI);
+Vo = del*BI ;
+disp('For BI 00010001 the output of D/A converter is = ' +string(Vo)+ ' V ');
diff --git a/1757/CH11/EX11.3/EX11_3.sce b/1757/CH11/EX11.3/EX11_3.sce
new file mode 100755
index 000000000..70d25c70c
--- /dev/null
+++ b/1757/CH11/EX11.3/EX11_3.sce
@@ -0,0 +1,10 @@
+//Example11.3 // determine the resolution of 4-bit D/A converter
+clc;
+clear;
+close;
+VFS = 12 ;
+N = 4 ;
+
+// the resolution of 4-bit D/A converter is defined as
+Resolution = VFS/(2^N-1) ;
+disp('the resolution of 4-bit D/A converter is = '+string(Resolution)+ ' V ');
diff --git a/1757/CH11/EX11.4/EX11_4.sce b/1757/CH11/EX11.4/EX11_4.sce
new file mode 100755
index 000000000..4e142f31f
--- /dev/null
+++ b/1757/CH11/EX11.4/EX11_4.sce
@@ -0,0 +1,13 @@
+//Example11.4 // determine the number of bit required to design a 4-bit D/A converter
+clc;
+clear;
+close;
+VFS = 5 ;
+Resolution = 10*10^-3 ; // A
+
+// the resolution of 4-bit D/A converter is defined as
+// Resolution = VFS/(2^N-1) ;
+N = (VFS/Resolution)+1 ;
+N = log10(N)/log10(2);
+disp('the number of bit required to design a 4-bit D/A converter is = '+string(N)+ ' = 9 ');
+
diff --git a/1757/CH11/EX11.5/EX11_5.sce b/1757/CH11/EX11.5/EX11_5.sce
new file mode 100755
index 000000000..666505c5e
--- /dev/null
+++ b/1757/CH11/EX11.5/EX11_5.sce
@@ -0,0 +1,57 @@
+//Example11.5 // determine the analog output voltage
+clc;
+clear;
+close;
+Vref = 12 ;
+BI = 101 ; BI = 111 ; BI = 011 ; BI = 001 ; BI = 100 ;
+Rf = 40*10^3 ;
+R = 0.25*Rf ;
+
+// The output voltage of given binary weighted resistor D/A converter is defined as
+
+// Vo = -(Rf*Vref/R)*(2^0*b0+2^-1*b1+2^-2*b2) ;
+
+// Vo = -(Rf*Vref/R)*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the given value Rf,R and Vref the output voltage
+
+// Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the binary input 101 analog output is
+b2 = 1 ;
+b1 = 0 ;
+b0 = 1 ;
+Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 101 analog output is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 111 analog output is
+b2 = 1 ;
+b1 = 1 ;
+b0 = 1 ;
+Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 111 analog output is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 011 analog output is
+b2 = 0 ;
+b1 = 1 ;
+b0 = 1 ;
+Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 011 analog output is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 001 analog output is
+b2 = 0 ;
+b1 = 0 ;
+b0 = 1 ;
+Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 001 analog output is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 100 analog output is
+b2 = 1 ;
+b1 = 0 ;
+b0 = 0 ;
+Vo = -48*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 100 analog output is = '+string(Vo)+ ' V');
diff --git a/1757/CH11/EX11.6/EX11_6.sce b/1757/CH11/EX11.6/EX11_6.sce
new file mode 100755
index 000000000..bcdeb8d06
--- /dev/null
+++ b/1757/CH11/EX11.6/EX11_6.sce
@@ -0,0 +1,69 @@
+//Example11.6 // determine the analog output voltage and feed back current If
+clc;
+clear;
+close;
+Vref = 12 ;
+BI = 1001 ; BI = 1101 ; BI = 1010 ; BI = 0011 ;
+Rf = 25 ; // K ohm
+R = 0.25*Rf ;
+
+// The output voltage of given binary weighted resistor D/A converter is defined as
+
+// Vo = -(Rf*Vref/R)*(2^0*b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// Vo = -(Rf*Vref/R)*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// for the given value Rf,R and Vref the output voltage
+
+// Vo = -60*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// for the binary input 1001 analog output is
+b3 = 1 ;
+b2 = 0 ;
+b1 = 0 ;
+b0 = 1 ;
+Vo = -60*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1001 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 1101 analog output is
+b3 = 1 ;
+b2 = 1 ;
+b1 = 0 ;
+b0 = 1 ;
+Vo = -60*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1101 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 1010 analog output is
+b3 = 1 ;
+b2 = 0 ;
+b1 = 1 ;
+b0 = 0 ;
+Vo = -60*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1010 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 0011 analog output is
+b3 = 0 ;
+b2 = 0 ;
+b1 = 1 ;
+b0 = 1 ;
+Vo = -60*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 0011 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
diff --git a/1757/CH11/EX11.7/EX11_7.sce b/1757/CH11/EX11.7/EX11_7.sce
new file mode 100755
index 000000000..605d0b0f6
--- /dev/null
+++ b/1757/CH11/EX11.7/EX11_7.sce
@@ -0,0 +1,54 @@
+
+//Example11.7 // determine the feed back current If and analog output voltage
+clc;
+clear;
+close;
+Vref = 8 ; // V
+BI = 001 ; BI = 010 ; BI = 110 ;
+Rf = 25*10^3 ; // Hz
+R = 0.2*Rf ;
+
+// The output current of given binary weighted resistor D/A converter is defined as
+
+// If = -(Vref/R)*(2^0*b0+2^-1*b1+2^-2*b2) ;
+
+// If = -(Vref/R)*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the given value Rf,R and Vref the output current
+
+// If = -(1.6*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the binary input 001 the feedback current If is given by
+b2 = 0 ;
+b1 = 0 ;
+b0 = 1 ;
+If = (1.6*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 001 analog output is = '+string(If*1000)+ ' mA ');
+
+// An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 010 the feedback current If is given by
+b2 = 0 ;
+b1 = 1 ;
+b0 = 0 ;
+If = (1.6*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 010 analog output is = '+string(If*1000)+ ' mA');
+
+// the An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 110 the feedback current If is given by
+b2 = 1 ;
+b1 = 1 ;
+b0 = 0 ;
+If = (1.6*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 110 analog output is = '+string(If*1000)+ ' mA ');
+
+// the An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
diff --git a/1757/CH11/EX11.8/EX11_8.sce b/1757/CH11/EX11.8/EX11_8.sce
new file mode 100755
index 000000000..f94436d43
--- /dev/null
+++ b/1757/CH11/EX11.8/EX11_8.sce
@@ -0,0 +1,65 @@
+//Example11.8 // determine the feed back current If and analog output voltage
+clc;
+clear;
+close;
+Vref = 5 ;
+BI = 101 ; BI = 011 ; BI = 100 ; BI = 001 ;
+Rf = 25*10^3 ;
+R = 0.2*Rf ;
+
+// The output current of given R-2R ladder D/A converter is defined as
+
+// If = -(Vref/2*R)*(2^0*b0+2^-1*b1+2^-2*b2) ;
+
+// If = -(Vref/2*R)*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the given value Rf,R and Vref the output current
+
+// If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+
+// for the binary input 101 the feedback current If is given by
+b2 = 1 ;
+b1 = 0 ;
+b0 = 1 ;
+If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 101 analog output is = '+string(If)+ ' A ');
+
+// An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 011 the feedback current If is given by
+b2 = 0 ;
+b1 = 1 ;
+b0 = 1 ;
+If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 011 analog output is = '+string(If)+ ' A');
+
+// the An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
+
+// for the binary input 100 the feedback current If is given by
+b2 = 1 ;
+b1 = 0 ;
+b0 = 0 ;
+If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 100 analog output is = '+string(If)+ ' A ');
+
+// the An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
+// for the binary input 001 the feedback current If is given by
+b2 = 0 ;
+b1 = 0 ;
+b0 = 1 ;
+If = (0.5*10^-3)*(b0+2^-1*b1+2^-2*b2) ;
+disp('for the binary input 001 analog output is = '+string(If)+ ' A ');
+
+// the An analog output voltage Vo is
+Vo = -If*Rf ;
+disp('An analog output voltage Vo is = '+string(Vo)+ ' V ');
+
diff --git a/1757/CH11/EX11.9/EX11_9.sce b/1757/CH11/EX11.9/EX11_9.sce
new file mode 100755
index 000000000..413c78421
--- /dev/null
+++ b/1757/CH11/EX11.9/EX11_9.sce
@@ -0,0 +1,70 @@
+//Example11.9 // determine the analog output voltage and feed back current If
+clc;
+clear;
+close;
+Vref = 10 ;
+BI = 1001 ; BI = 1100 ; BI = 1010 ; BI = 0011 ;
+Rf = 50 ; // K ohm
+R = 0.4*Rf ;
+
+// The output voltage of given R-2R ladder D/A converter is defined as
+
+// Vo = -(Rf*Vref/2R)*(2^0*b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// Vo = -(Rf*Vref/2R)*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// for the given value Rf,R and Vref the output voltage
+
+// Vo = -12.5*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+
+// for the binary input 1001 analog output is
+b3 = 1 ;
+b2 = 0 ;
+b1 = 0 ;
+b0 = 1 ;
+Vo = -12.5*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1001 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 1100 analog output is
+b3 = 1 ;
+b2 = 1 ;
+b1 = 0 ;
+b0 = 0 ;
+Vo = -12.5*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1100 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 1010 analog output is
+b3 = 1 ;
+b2 = 0 ;
+b1 = 1 ;
+b0 = 0 ;
+Vo = -12.5*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 1010 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+
+
+// for the binary input 0011 analog output is
+b3 = 0 ;
+b2 = 0 ;
+b1 = 1 ;
+b0 = 1 ;
+Vo = -12.5*(b0+2^-1*b1+2^-2*b2+2^-3*b3) ;
+disp('for the binary input 0011 analog output is = '+string(Vo)+ ' V ');
+
+// the feedback current If is given by
+If = -(Vo/Rf) ;
+disp('the feedback current If is = '+string(If)+ ' mA ');
+