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 /48/CH3/EX3.10 | |
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 '48/CH3/EX3.10')
-rwxr-xr-x | 48/CH3/EX3.10/eg_3_10.sce | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/48/CH3/EX3.10/eg_3_10.sce b/48/CH3/EX3.10/eg_3_10.sce new file mode 100755 index 000000000..8cff8a98a --- /dev/null +++ b/48/CH3/EX3.10/eg_3_10.sce @@ -0,0 +1,34 @@ +clear;
+clc;
+a1=0;a2=a1;a3=a1;
+//all combinations of 2 varible inputs
+f(:,1)=[0;0;1;1];
+f(:,2)=[0;1;0;1];
+disp("The turth table of f for all the combinations of a0,a1,a2,a3 are shown below")
+//determining the values of f for all combinations of a0,a1,a2,a3
+for a3=0:1
+ for a2=0:1
+ for a1=0:1
+ for a0=0:1
+ disp([' a3' ' a2' ' a1' ' a0']);
+ disp([a3 a2 a1 a0]);
+ i=1;
+ for x=0:1
+ for y=0:1
+ f0=bitand(a0,bitand(bitcmp(x,1),bitcmp(y,1)));
+ f1=bitand(a1,bitand(bitcmp(x,1),y));
+ f2=bitand(a2,bitand(x,bitcmp(y,1)));
+ f3=bitand(a3,bitand(x,y));
+ f4=bitor(f0,f1);
+ f5=bitor(f2,f3);
+ f(i,3)=bitor(f4,f5);
+ i=i+1;
+ end
+ end
+ disp([' x' ' y' ' f']);
+ disp(f);
+ disp('*--------------------*');
+ end
+ end
+ end
+end
\ No newline at end of file |