summaryrefslogtreecommitdiff
path: root/48/CH3/EX3.4
diff options
context:
space:
mode:
Diffstat (limited to '48/CH3/EX3.4')
-rwxr-xr-x48/CH3/EX3.4/eg_3_4.sce23
1 files changed, 23 insertions, 0 deletions
diff --git a/48/CH3/EX3.4/eg_3_4.sce b/48/CH3/EX3.4/eg_3_4.sce
new file mode 100755
index 000000000..f7d81c619
--- /dev/null
+++ b/48/CH3/EX3.4/eg_3_4.sce
@@ -0,0 +1,23 @@
+clear;
+clc;
+//function definition
+x=[0;0;0;0;1;1;1;1];
+y=[0;0;1;1;0;0;1;1];
+z=[0;1;0;1;0;1;0;1];
+f=[1;0;1;1;0;0;1;1];
+g=[0;1;0;1;1;0;1;0];
+//calculating the values of expressions given
+forg=bitor(f,g);
+fandg=bitand(f,g);
+fcmp=bitcmp(f,1);
+s(:,1)=x;
+s(:,2)=y;
+s(:,3)=z;
+s(:,4)=f;
+s(:,5)=g;
+s(:,6)=forg;
+s(:,7)=fandg;
+s(:,8)=fcmp;
+p=[' x',' y',' z',' f',' g',' f+g',' fg',' f^'];
+disp(p);
+disp(s); \ No newline at end of file