summaryrefslogtreecommitdiff
path: root/3637/CH4/EX4.3/Ex4_3.sce
diff options
context:
space:
mode:
Diffstat (limited to '3637/CH4/EX4.3/Ex4_3.sce')
-rw-r--r--3637/CH4/EX4.3/Ex4_3.sce15
1 files changed, 15 insertions, 0 deletions
diff --git a/3637/CH4/EX4.3/Ex4_3.sce b/3637/CH4/EX4.3/Ex4_3.sce
new file mode 100644
index 000000000..7616dc469
--- /dev/null
+++ b/3637/CH4/EX4.3/Ex4_3.sce
@@ -0,0 +1,15 @@
+//problem 3 pagenumber 4.38
+//given
+n=4;format(6);
+z=['0111','1111'];
+vref=5;//volt
+//determine v0
+r=vref/(2^n-1);
+i=1;
+while i<3
+ v0=r*base2dec(z(i),2);
+ disp('Output voltage '+string(z(i))+' = '+string(v0)+' volt');
+ i=i+1;
+end
+
+