diff options
Diffstat (limited to '273/CH25/EX25.5/ex25_5.sce')
-rwxr-xr-x | 273/CH25/EX25.5/ex25_5.sce | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/273/CH25/EX25.5/ex25_5.sce b/273/CH25/EX25.5/ex25_5.sce new file mode 100755 index 000000000..0c10b86c1 --- /dev/null +++ b/273/CH25/EX25.5/ex25_5.sce @@ -0,0 +1,14 @@ +clc;clear;
+//Example 25.5
+//calculation of difference of two binary numbers
+
+//given values
+X='1000';//first binary number
+Y='0011';//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 ')
|