summaryrefslogtreecommitdiff
path: root/3860/CH3/EX3.17
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3860/CH3/EX3.17
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3860/CH3/EX3.17')
-rw-r--r--3860/CH3/EX3.17/EX3_17.sce49
-rw-r--r--3860/CH3/EX3.17/Ex3_17.txt31
2 files changed, 80 insertions, 0 deletions
diff --git a/3860/CH3/EX3.17/EX3_17.sce b/3860/CH3/EX3.17/EX3_17.sce
new file mode 100644
index 000000000..f5c658bd5
--- /dev/null
+++ b/3860/CH3/EX3.17/EX3_17.sce
@@ -0,0 +1,49 @@
+//Example 3.17: Reduce expression using k-map
+clc; //clears the window
+clear; //clears all existing variables
+//Mapping the expression//
+disp(' a''b'' a''b ab ab'' ')
+disp('c''d'' 1 1 ')
+disp('cd'' 1 1 ')
+disp('cd 1 1')
+disp('cd'' 1 1')
+disp(' From the map, high outputs are for 0,1,5,7,8,10,14,15') //given logic equation
+a=[0 0 0 0;0 0 0 1;0 1 0 1;0 1 1 1;1 0 0 0;1 0 1 0 ;1 1 1 0;1 1 1 1]
+disp(a)
+for i=1: 8
+ 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
+ if a(i,4)==1 then
+ b(i,4)='d'
+ else
+ b(i,4)=' d'''
+ end
+end
+disp(' Evaluating expression from truth table and map ')
+x1=strcat([ b(1,1),b(1,2),b(1,3),b(1,4) ])
+x2=strcat([ b(2,1),b(2,2),b(2,3),b(2,4) ])
+x3=strcat([ b(3,1),b(3,2),b(3,3),b(3,4) ])
+x4=strcat([ b(4,1),b(4,2),b(4,3),b(4,4) ])
+x5=strcat([ b(5,1),b(5,2),b(5,3),b(5,4) ])
+x6=strcat([ b(6,1),b(6,2),b(6,3),b(6,4) ])
+x7=strcat([ b(7,1),b(7,2),b(7,3),b(7,4) ])
+x8=strcat([ b(8,1),b(8,2),b(8,3),b(8,4) ])
+x=[x1"+",x2"+",x3"+",x4"+",x5"+",x6"+",x7"+",x8]
+disp(x)
+//Expression is displayed//
+disp('The resulting two possible solution are')
+disp('F = a''c''d'' + bc''d + acd + b''cd''')
+disp('F = a''b''d'' + a''bc'' + abd + ab''c')
diff --git a/3860/CH3/EX3.17/Ex3_17.txt b/3860/CH3/EX3.17/Ex3_17.txt
new file mode 100644
index 000000000..f6cafe7dc
--- /dev/null
+++ b/3860/CH3/EX3.17/Ex3_17.txt
@@ -0,0 +1,31 @@
+
+ a'b' a'b ab ab'
+
+ c'd' 1 1
+
+ cd' 1 1
+
+ cd 1 1
+
+ cd' 1 1
+
+ From the map, high outputs are for 0,1,5,7,8,10,14,15
+
+ 0. 0. 0. 0.
+ 0. 0. 0. 1.
+ 0. 1. 0. 1.
+ 0. 1. 1. 1.
+ 1. 0. 0. 0.
+ 1. 0. 1. 0.
+ 1. 1. 1. 0.
+ 1. 1. 1. 1.
+
+ Evaluating expression from truth table and map
+
+!a'b'c' d' + a'b'c'd + a'bc'd + a'bcd + ab'c' d' + ab'c d' + abc d' + abcd !
+
+ The resulting two possible solution are
+
+ F = a'c'd' + bc'd + acd + b'cd'
+
+ F = a'b'd' + a'bc' + abd + ab'c \ No newline at end of file