summaryrefslogtreecommitdiff
path: root/45/CH12/EX12.4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /45/CH12/EX12.4
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 '45/CH12/EX12.4')
-rwxr-xr-x45/CH12/EX12.4/example_12_4.sce18
1 files changed, 18 insertions, 0 deletions
diff --git a/45/CH12/EX12.4/example_12_4.sce b/45/CH12/EX12.4/example_12_4.sce
new file mode 100755
index 000000000..16ba150ff
--- /dev/null
+++ b/45/CH12/EX12.4/example_12_4.sce
@@ -0,0 +1,18 @@
+//Example 12.4
+clc
+clear
+V_A=0
+//a=input("Enter the binary digit(5 bits) :" );
+a=11010
+for i=1:5
+ r=modulo(a,10);
+ b(1,i)=r;
+ a=a/10;
+ a=floor(a);
+end
+for j=1:5
+V_A = V_A + 10*b(1,j)*2^(j-1);
+end;
+V_A=V_A/2^5;
+disp("The output voltage in volts is ');
+disp(V_A); // displaying the value \ No newline at end of file