diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /273/CH25/EX25.13/ex25_13.sce | |
download | Scilab-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.13/ex25_13.sce')
-rwxr-xr-x | 273/CH25/EX25.13/ex25_13.sce | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/273/CH25/EX25.13/ex25_13.sce b/273/CH25/EX25.13/ex25_13.sce new file mode 100755 index 000000000..1152138b0 --- /dev/null +++ b/273/CH25/EX25.13/ex25_13.sce @@ -0,0 +1,28 @@ +clc;clear;
+//Example 25.13
+//calculation of sum of hexadecimal numbers
+
+//given values
+X1='C';
+X2='A';
+X3='E';
+Y1='3';
+Y2='2';
+Y3='D';
+
+//calculation
+x1=hex2dec(X1);//decimal equivalent
+x2=hex2dec(X2);//decimal equivalent
+x3=hex2dec(X3);//decimal equivalent
+y1=hex2dec(Y1);//decimal equivalent
+y2=hex2dec(Y2);//decimal equivalent
+y3=hex2dec(Y3);//decimal equivalent
+z1=x1+y1;
+z2=x2+y2;
+z3=x3+y3;
+Z1=dec2hex(z1);//binary equivalent of sum
+Z2=dec2hex(z2);//binary equivalent of sum
+Z3=dec2hex(z3);//binary equivalent of sum
+disp(Z1,'sum of the first set of hexadecimal numbers is');
+disp(Z2,'sum of the second set of hexadecimal numbers is');
+disp(Z3,'sum of the thirdm set of hexadecimal numbers is');
|