summaryrefslogtreecommitdiff
path: root/2360/CH4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2360/CH4
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 '2360/CH4')
-rwxr-xr-x2360/CH4/EX4.1/ex4_1.sce14
-rwxr-xr-x2360/CH4/EX4.2/ex4_2.sce8
-rwxr-xr-x2360/CH4/EX4.3/ex4_3.sce13
-rwxr-xr-x2360/CH4/EX4.4/ex4_4.sce10
-rwxr-xr-x2360/CH4/EX4.5/ex4_5.sce11
-rwxr-xr-x2360/CH4/EX4.6/ex4_6.sce9
-rwxr-xr-x2360/CH4/EX4.7/ex4_7.sce13
-rwxr-xr-x2360/CH4/EX4.8/ex4_8.sce16
8 files changed, 94 insertions, 0 deletions
diff --git a/2360/CH4/EX4.1/ex4_1.sce b/2360/CH4/EX4.1/ex4_1.sce
new file mode 100755
index 000000000..76db8ef2e
--- /dev/null
+++ b/2360/CH4/EX4.1/ex4_1.sce
@@ -0,0 +1,14 @@
+// Exa 4.1
+format('v',7);clc;clear;close;
+// Given data
+Vi = 5.1;//input voltage in V
+n = 8;// number of bit
+Resolution = 2^n;
+Resolution = Vi/(Resolution-1);// in V/LSB
+Resolution= Resolution*10^3;// in mV/LSB
+disp(Resolution,"The Resolution in mV/LSB is");
+Resolution= Resolution*10^-3;// in V/LSB
+Vi = 1.28;// in V
+D = Vi/Resolution;//digital output in LSBs
+DigitalOutput= dec2bin(round(D));// digital output in binary
+disp(DigitalOutput,"The digital output in binary is :")
diff --git a/2360/CH4/EX4.2/ex4_2.sce b/2360/CH4/EX4.2/ex4_2.sce
new file mode 100755
index 000000000..3b0355d9f
--- /dev/null
+++ b/2360/CH4/EX4.2/ex4_2.sce
@@ -0,0 +1,8 @@
+// Exa 4.2
+format('v',7);clc;clear;close;
+// Given data
+n = 12;//number of bit
+Vi = 4.095;//input voltage in V
+Q_E = Vi/(((2^n)-1)*2);//quantizing error in V
+Q_E = Q_E * 10^3;// in mV
+disp(Q_E,"The quantizing error in mV is");
diff --git a/2360/CH4/EX4.3/ex4_3.sce b/2360/CH4/EX4.3/ex4_3.sce
new file mode 100755
index 000000000..c1b8f70d5
--- /dev/null
+++ b/2360/CH4/EX4.3/ex4_3.sce
@@ -0,0 +1,13 @@
+// Exa 4.3
+format('v',7);clc;clear;close;
+// Given data
+// When Vi=100 mV
+Vi = 100;// in mV
+V_R = 100;// in mV
+t1 = 83.33;// in ms
+t2 = (Vi/V_R)*t1;// in ms
+disp(t2,"When Vi=100 mV, the value of t2 in ms is");
+// When Vi=200 mV
+Vi = 200;// in mV
+t2 = (Vi/V_R)*t1;// in ms
+disp(t2,"When Vi=200 mV, the value of t2 in ms is");
diff --git a/2360/CH4/EX4.4/ex4_4.sce b/2360/CH4/EX4.4/ex4_4.sce
new file mode 100755
index 000000000..b2dcce44e
--- /dev/null
+++ b/2360/CH4/EX4.4/ex4_4.sce
@@ -0,0 +1,10 @@
+// Exa 4.4
+format('v',7);clc;clear;close;
+// Given data
+t1 = 83.33;// in ms
+V_R = 100;// in mV
+Vi = 100;// in mV
+fc = 12;//clock frequency in kHz
+fc = fc* 10^3;// in Hz
+Digitaloutput = round(fc*t1*(Vi/V_R)*10^-3);//digital output in counts
+disp(Digitaloutput,"The Digital output in counts is");
diff --git a/2360/CH4/EX4.5/ex4_5.sce b/2360/CH4/EX4.5/ex4_5.sce
new file mode 100755
index 000000000..260377f0f
--- /dev/null
+++ b/2360/CH4/EX4.5/ex4_5.sce
@@ -0,0 +1,11 @@
+// Exa 4.5
+format('v',7);clc;clear;close;
+// Given data
+f = 1;// in MHz
+f = f * 10^6;// in Hz
+T = 1/f;// in sec
+T = T * 10^6;// in µsec
+n = 8;
+// Conversion time
+T_C = T*(n+1);// in µsec
+disp(T_C,"The conversion time in µsec is");
diff --git a/2360/CH4/EX4.6/ex4_6.sce b/2360/CH4/EX4.6/ex4_6.sce
new file mode 100755
index 000000000..dcf255910
--- /dev/null
+++ b/2360/CH4/EX4.6/ex4_6.sce
@@ -0,0 +1,9 @@
+// Exa 4.6
+format('v',7);clc;clear;close;
+// Given data
+n = 8;// number of bit
+T_C = 9;//conversion time in µs
+T_C = T_C * 10^-6;// in s
+// The maximum frequency
+f_max = 1/(2*%pi*T_C*(2^n));// in Hz
+disp(f_max,"The maximum frequency in Hz is");
diff --git a/2360/CH4/EX4.7/ex4_7.sce b/2360/CH4/EX4.7/ex4_7.sce
new file mode 100755
index 000000000..2fe6a06d4
--- /dev/null
+++ b/2360/CH4/EX4.7/ex4_7.sce
@@ -0,0 +1,13 @@
+// Exa 4.7
+format('v',7);clc;clear;close;
+// Given data
+n = 3;// number of bit
+R = 1/(10^n);
+V = 1;// in V
+// For 1V range,
+Resolution = V*R;// in V
+disp(Resolution,"For 1 V range, the resolution in V is");
+// For 50 V range,
+V = 50;// in V
+Resolution = V*R;// in V
+disp(Resolution,"For 50 V range, the resolution in V is");
diff --git a/2360/CH4/EX4.8/ex4_8.sce b/2360/CH4/EX4.8/ex4_8.sce
new file mode 100755
index 000000000..2e4d92581
--- /dev/null
+++ b/2360/CH4/EX4.8/ex4_8.sce
@@ -0,0 +1,16 @@
+// Exa 4.8
+clc;clear;close;
+// Given data
+format('v',8)
+n = 4;// number of bit
+R = 1/(10^n);
+disp(R,"Part (i) : The resolution is");
+// There are 5 digit places in 4 1/2 digits, so
+disp("Part (ii) : 11.87 would be displayed as 11.870")
+Reading= 0.5573;
+format('v',7)
+disp(Reading,"Part (iii) : On 1 V range, 0.5573 will be displayed as : ")
+format('v',6)
+disp(Reading,"On 10 V range, 0.5573 will be displayed as : ")
+
+