summaryrefslogtreecommitdiff
path: root/2360/CH4/EX4.1
diff options
context:
space:
mode:
Diffstat (limited to '2360/CH4/EX4.1')
-rwxr-xr-x2360/CH4/EX4.1/ex4_1.sce14
1 files changed, 14 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 :")