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 /1964/CH15/EX15.11 | |
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 '1964/CH15/EX15.11')
-rwxr-xr-x | 1964/CH15/EX15.11/ex15_11.sce | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/1964/CH15/EX15.11/ex15_11.sce b/1964/CH15/EX15.11/ex15_11.sce new file mode 100755 index 000000000..b719ac2a9 --- /dev/null +++ b/1964/CH15/EX15.11/ex15_11.sce @@ -0,0 +1,17 @@ +//Chapter-15, Example 15.11, Page 500
+//=============================================================================
+clc
+clear
+//CALCULATIONS
+x1=base2dec(['1001'],2)//converting binary to decimal
+x2=base2dec(['0100'],2)//converting binary to decimal
+x3=x1+x2;
+if(x3>9)
+ x3=x3+6;
+ z1=dec2base(x3,2)//converting decimal to binary
+else
+ z1=dec2base(x3,2)//converting decimal to binary
+end
+disp(z1)
+//note:last 4 bits represent 3 and 5th bit prefixed with 3 bits will look as 1.hence the combined result will be 13
+//=================================END OF PROGRAM=======================================================================================================
|