summaryrefslogtreecommitdiff
path: root/2582/CH6/EX6.8
diff options
context:
space:
mode:
Diffstat (limited to '2582/CH6/EX6.8')
-rwxr-xr-x2582/CH6/EX6.8/Ex6_8.sce13
1 files changed, 13 insertions, 0 deletions
diff --git a/2582/CH6/EX6.8/Ex6_8.sce b/2582/CH6/EX6.8/Ex6_8.sce
new file mode 100755
index 000000000..66642eb83
--- /dev/null
+++ b/2582/CH6/EX6.8/Ex6_8.sce
@@ -0,0 +1,13 @@
+//Ex 6.8
+clc;clear;close;
+format('v',5);
+n=8;//no. of bits
+Range=0:10;//V
+Vin=5.2;//V
+oneLSB=max(Range)/2^n;//V
+disp(oneLSB*1000,"(a) Minimum voltage for 1 LSB in mV");
+Vifs=max(Range)-oneLSB;//V
+disp(Vifs,"(b) For all ones input voltage should be (V)");
+D=Vin/oneLSB;//Digital output in decimal
+D=dec2bin(round(D));//Digital output in binary
+disp(D,"(c) Digital Output");