summaryrefslogtreecommitdiff
path: root/2522/CH6/EX6.5/exm6_5.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2522/CH6/EX6.5/exm6_5.sce
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 '2522/CH6/EX6.5/exm6_5.sce')
-rwxr-xr-x2522/CH6/EX6.5/exm6_5.sce29
1 files changed, 29 insertions, 0 deletions
diff --git a/2522/CH6/EX6.5/exm6_5.sce b/2522/CH6/EX6.5/exm6_5.sce
new file mode 100755
index 000000000..65e682f77
--- /dev/null
+++ b/2522/CH6/EX6.5/exm6_5.sce
@@ -0,0 +1,29 @@
+//page no 175
+//example no 6.5
+//INCRIMENTING ACCUMULATOR CONTENT.
+//accumulator holds the data FFH
+clc;
+A=hex2dec(['FF']); //converting FFH into decimal value
+//decimal value of 01H is 01. Adding 01 to A
+Y=A+1; //the result comes out to be 256
+Z=Y-256;
+X=dec2hex(Z);
+printf('Sum =')
+disp(X);
+if Y>255 then
+ printf('CY=1 \n')
+else
+ printf('CY=0 \n')
+end
+if Z>127 then
+ printf('S=1 \n')
+else
+ printf('S=0 \n')
+end
+if Z>0 then
+ printf('Z=0 \n')
+else
+ printf('Z=1 \n')
+end
+
+