summaryrefslogtreecommitdiff
path: root/273/CH25/EX25.4
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /273/CH25/EX25.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 '273/CH25/EX25.4')
-rwxr-xr-x273/CH25/EX25.4/ex25_4.sce14
1 files changed, 14 insertions, 0 deletions
diff --git a/273/CH25/EX25.4/ex25_4.sce b/273/CH25/EX25.4/ex25_4.sce
new file mode 100755
index 000000000..d7926693d
--- /dev/null
+++ b/273/CH25/EX25.4/ex25_4.sce
@@ -0,0 +1,14 @@
+clc;clear;
+//Example 25.4
+//calculation of difference of two binary numbers
+
+//given values
+X='1011';//first binary number
+Y='0101';//second binary number
+
+//calculation
+x=bin2dec(X);//decimal equivalent
+y=bin2dec(Y);//decimal equivalent
+z=x-y;
+Z=dec2bin(z);
+disp(Z,'difference of the given binary numbers '); \ No newline at end of file