summaryrefslogtreecommitdiff
path: root/1241/CH6/EX6.7
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /1241/CH6/EX6.7
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 '1241/CH6/EX6.7')
-rwxr-xr-x1241/CH6/EX6.7/exa6_7.sce37
1 files changed, 37 insertions, 0 deletions
diff --git a/1241/CH6/EX6.7/exa6_7.sce b/1241/CH6/EX6.7/exa6_7.sce
new file mode 100755
index 000000000..5c4a17022
--- /dev/null
+++ b/1241/CH6/EX6.7/exa6_7.sce
@@ -0,0 +1,37 @@
+//Example 6-7//
+//Map X=ABC+AB''C+AB''C''//
+clc
+//clears the console//
+clear
+//clears all existing variables//
+//Mapping the expression//
+disp(' B''C'' B''C BC BC'' ')
+disp('A'' 0 0 0 0 ')
+disp('A 1 1 1 0 ')
+disp(' From the map, high outputs for 4,5 and 7 ')
+a=[1 0 0 ; 1 0 1 ; 1 1 1]
+disp(a)
+for i=1: 3
+ if a(i,1)==1 then
+ b(i,1)='A'
+ else
+ b(i,1)='A'''
+ end
+ if a(i,2)==1 then
+ b(i,2)='B'
+ else
+ b(i,2)='B'''
+ end
+ if a(i,3)==1 then
+ b(i,3)='C'
+ else
+ b(i,3)='C'''
+ end
+end
+disp(' evaluating expression from truth table and map ')
+l=strcat([ b(1,1),b(1,2),b(1,3)])
+m=strcat([ b(2,1),b(2,2),b(2,3)])
+n=strcat([ b(3,1),b(3,2),b(3,3)])
+x=strcat([l"+",m"+",n ])
+disp(x)
+//Expression is displayed//