summaryrefslogtreecommitdiff
path: root/1757/CH12
diff options
context:
space:
mode:
Diffstat (limited to '1757/CH12')
-rwxr-xr-x1757/CH12/EX12.2/EX12_2.sce34
-rwxr-xr-x1757/CH12/EX12.3/EX12_3.sce30
-rwxr-xr-x1757/CH12/EX12.4/EX12_4.sce11
-rwxr-xr-x1757/CH12/EX12.5/EX12_5.sce22
4 files changed, 97 insertions, 0 deletions
diff --git a/1757/CH12/EX12.2/EX12_2.sce b/1757/CH12/EX12.2/EX12_2.sce
new file mode 100755
index 000000000..445af563b
--- /dev/null
+++ b/1757/CH12/EX12.2/EX12_2.sce
@@ -0,0 +1,34 @@
+//Examle12.2 // Determine the following parameter of 8-bit A/D converter a) Normalized step size b) Actual step size c) Normalized maximum quantization level d) Actual maximum quantization e) Normalized peak quantization error f) Actual peak quantization error g) Percentage of quantization error
+clc;
+clear;
+close;
+N = 8 ;
+Vin = 12 ;
+
+//a) Normalized step size of A/D converter
+Ns = 2^-N ;
+disp('Normalized step size of A/D converter is = '+string(Ns)+ ' ');
+
+// b) Actual step size of A/D converter
+As = Vin*Ns ;
+disp('Actual step size of A/D converter is = '+string(As)+ ' ');
+
+// c) Normalized maximum quantization level of A/D converter
+Qmax = 1-2^-N ;
+disp('Normalized maximum quantization level of A/D converter is = '+string(Qmax)+ ' ');
+
+// d) Actual maximum quantization level of A/D converter
+QAmax = Qmax*Vin ;
+disp('Actual maximum quantization level of A/D converter is = '+string(QAmax)+ ' ');
+
+// e) Normalized peak quantization error of A/D converter
+Qp = 2^-(N+1);
+disp('Normalized peak quantization error of A/D converter is = '+string(Qp)+ ' ' );
+
+// f) Actual peak quantization error of A/D converter
+Qe = Qp*Vin ;
+disp('Actual peak quantization error of A/D converter is = '+string(Qe)+ ' V ');
+
+// g) Percentage of quantization error of A/D converter
+%Qp = 2^-(N+1)*100 ;
+disp('Percentage of quantization error of A/D converter is = '+string(%Qp)+ ' ') ;
diff --git a/1757/CH12/EX12.3/EX12_3.sce b/1757/CH12/EX12.3/EX12_3.sce
new file mode 100755
index 000000000..08e72b336
--- /dev/null
+++ b/1757/CH12/EX12.3/EX12_3.sce
@@ -0,0 +1,30 @@
+//Example12.3 // to determine the binary output of the 8-bit dual slope A/D converter
+clc;
+clear;
+close;
+Vin = 8.5 ;
+VR = 10 ;
+f = 2 ; //MHz
+N = 8 ;
+C = 0.1*10^-6 ;
+R = 2*10^3 ;
+
+// the output of integrator is defined as
+// Viao(T1) = -(Vin/R*C)*T1 ;
+
+// charging time of capacitor
+T1 = 2^N/f ;
+disp('charging time of capacitor is = '+string(T1)+ ' u sec');
+
+// the integrator output
+T1 = T1*10^-6 ;
+Viao =-(Vin/(R*C))*T1;
+disp('the integrator output is = '+string(Viao)+ ' V');
+
+// the binary output of a dual slope A/D converter
+Bn = (2^N*Vin)/VR;
+disp('the decimal output of a dual slope A/D converter is = '+string(Bn)+ ' = 218' );
+
+Bn=218;
+Bn = dec2bin(Bn) ;
+disp(' The binary output of a dual slope A/D converter is = '+string(Bn)+ ' ' );
diff --git a/1757/CH12/EX12.4/EX12_4.sce b/1757/CH12/EX12.4/EX12_4.sce
new file mode 100755
index 000000000..d6ae0d938
--- /dev/null
+++ b/1757/CH12/EX12.4/EX12_4.sce
@@ -0,0 +1,11 @@
+//Example12.4 // to determine the resolution of 12-bit A/D converter
+clc;
+clear;
+close;
+N =12 ;
+Vin = 15 ;
+
+// Resolution of an A/D converter
+Resolution = Vin/(2^N-1);
+disp('Resolution of an A/D converter is = '+string(Resolution)+ ' V ');
+;
diff --git a/1757/CH12/EX12.5/EX12_5.sce b/1757/CH12/EX12.5/EX12_5.sce
new file mode 100755
index 000000000..7d0041a6a
--- /dev/null
+++ b/1757/CH12/EX12.5/EX12_5.sce
@@ -0,0 +1,22 @@
+// Example12.5 // to determine the output time and duty cycle of V/T converter
+clc;
+clear;
+close;
+Vin = 5 ;
+C = 0.1*10^-6 ;
+R = 10*10^3 ;
+C1 = 100*10^-6 ;
+
+// The output time of a V/T converter is given as
+T = (7.5*C1)/(Vin) ;
+disp('The output time of a V/T converter is =' +string(T)+ ' sec');
+
+TH = 0.075 ;
+TL=TH ; // we consider
+// The duty cycle of V?T converter
+D = (TL+TH)/(TH) ;
+disp('The duty cycle of V?T converter is = '+string(D)+ ' ');
+
+// The output voltage of an integrator is define as
+Vio = -(Vin)/(R*C)*T ;
+disp('The output voltage of an integrator is is = '+string(Vio)+ ' V');