summaryrefslogtreecommitdiff
path: root/275/CH8/EX8.8.49a
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /275/CH8/EX8.8.49a
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 '275/CH8/EX8.8.49a')
-rwxr-xr-x275/CH8/EX8.8.49a/Ch8_8_49a.sce39
1 files changed, 39 insertions, 0 deletions
diff --git a/275/CH8/EX8.8.49a/Ch8_8_49a.sce b/275/CH8/EX8.8.49a/Ch8_8_49a.sce
new file mode 100755
index 000000000..95fe639c7
--- /dev/null
+++ b/275/CH8/EX8.8.49a/Ch8_8_49a.sce
@@ -0,0 +1,39 @@
+clc
+clear
+disp("Example 8.49a")
+printf("\n")
+disp("Prove the following boolean identities")
+disp("A+BC=(A+B)(A+C)")
+A=[0 0 0 0 1 1 1 1]
+B=[0 0 1 1 0 0 1 1]
+C=[0 1 0 1 0 1 0 1]
+for i=1:length(A)
+ Y(i)=A(i)+(B(i)*C(i))
+ if(Y(i)==2)
+ Y(i)=1
+ end
+end
+for i=1:length(A)
+ Z(i)=(A(i)+B(i))*(A(i)+C(i))
+ if(Z(i)==2)
+ Z(i)=1
+ end
+ if(Z(i)==3)
+ Z(i)=1
+ end
+ if(Z(i)==4)
+ Z(i)=1
+ end
+end
+for i=1:length(A)
+ if(Z(i)==Y(i))
+ printf("_")
+ else
+ printf("NOT")
+ abort
+ end
+end
+
+ printf("proved")
+
+ \ No newline at end of file