diff options
Diffstat (limited to '48/CH3')
-rwxr-xr-x | 48/CH3/EX3.1/eg_1.sce | 13 | ||||
-rwxr-xr-x | 48/CH3/EX3.10/eg_3_10.sce | 34 | ||||
-rwxr-xr-x | 48/CH3/EX3.11/eg_3_11.sce | 16 | ||||
-rwxr-xr-x | 48/CH3/EX3.12/eg_3_12.sce | 5 | ||||
-rwxr-xr-x | 48/CH3/EX3.13/eg_3_13.sce | 22 | ||||
-rwxr-xr-x | 48/CH3/EX3.14/eg_3_14.sce | 35 | ||||
-rwxr-xr-x | 48/CH3/EX3.2/eg_3_2.sce | 16 | ||||
-rwxr-xr-x | 48/CH3/EX3.3/eg_3_3.sce | 14 | ||||
-rwxr-xr-x | 48/CH3/EX3.4/eg_3_4.sce | 23 | ||||
-rwxr-xr-x | 48/CH3/EX3.5/eg_3_5.sce | 11 | ||||
-rwxr-xr-x | 48/CH3/EX3.6/eg_3_6.sce | 13 | ||||
-rwxr-xr-x | 48/CH3/EX3.7/eg_3_7.sce | 7 | ||||
-rwxr-xr-x | 48/CH3/EX3.8/eg_3_8.sce | 10 | ||||
-rwxr-xr-x | 48/CH3/EX3.9/eg_3_9.sce | 6 |
14 files changed, 225 insertions, 0 deletions
diff --git a/48/CH3/EX3.1/eg_1.sce b/48/CH3/EX3.1/eg_1.sce new file mode 100755 index 000000000..d64b6503b --- /dev/null +++ b/48/CH3/EX3.1/eg_1.sce @@ -0,0 +1,13 @@ +clear
+clc;
+disp("T(x,y,z)=x^y^z+yz+xz");
+disp("**Minimise the given expression**");
+disp("**Since z is common in every term taking z common**");
+disp("T(x,y,z)=z(x^y^+y+x)");
+disp("**From the property a+a^b=a+b **");
+disp("T(x,y,z)=z(x^+y+x)");
+disp("**Since we know that a+a^=1 **");
+disp("T(x,y,z)=z(1+y)");
+disp("**we know that 1+a=1 **");
+disp("T(x,y,z)=z.1");
+disp("T(x,y,z)=z");
\ No newline at end of file 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 diff --git a/48/CH3/EX3.11/eg_3_11.sce b/48/CH3/EX3.11/eg_3_11.sce new file mode 100755 index 000000000..399ff30e7 --- /dev/null +++ b/48/CH3/EX3.11/eg_3_11.sce @@ -0,0 +1,16 @@ +clear;
+clc;
+disp("x NOR x=(x+x)^");
+disp("NOT Gate");
+disp("x NOR x=x^x^=x^");
+disp("OR Gate");
+disp("(x NOR y) NOR (x NOR y) = (x^ NOR y^)^ = x+y");
+disp("AND Gate");
+disp("(x NOR x) NOR (y NOR y )= x^ NOR y^ = xy");
+disp("NAND Gate");
+disp(" NOT ((x NOR x) NOR (y NOR y))= NOT (x^ NOR y^) = NOT(xy) = (xy)^");
+disp("XOR Gate");
+disp("(x^ NOR y^) NOR (x NOR y) = x^y+xy^");
+disp("XNOR Gate");
+disp("(x^ NOR y) NOR (x NOR y^) = xy+x^y^");
+disp("Since every other gate can be implemented using NOR gate it is said to be functionally complete")
\ No newline at end of file diff --git a/48/CH3/EX3.12/eg_3_12.sce b/48/CH3/EX3.12/eg_3_12.sce new file mode 100755 index 000000000..6c73ed694 --- /dev/null +++ b/48/CH3/EX3.12/eg_3_12.sce @@ -0,0 +1,5 @@ +clear;
+clc;
+disp("T=xy^+(x+y^)z");
+disp("from the identity a+a^b=a+b");
+disp("T=xy^+z");
\ No newline at end of file diff --git a/48/CH3/EX3.13/eg_3_13.sce b/48/CH3/EX3.13/eg_3_13.sce new file mode 100755 index 000000000..3ba59f36c --- /dev/null +++ b/48/CH3/EX3.13/eg_3_13.sce @@ -0,0 +1,22 @@ +clear;
+clc;
+disp("Air conditioning system of a storage warehouse will be turned on if and only if it satisfies these conditions");
+disp("let W denotes weight of 100 tons or more");
+disp("H denotes relative humidity of atleast 60 percent");
+disp("T denotes temparature above 60 degrees");
+disp("P denotes barometric pressure of 30 or more");
+disp("*-first condition-*");
+disp("W<100 tons => W^ ,H>=60 => H , T>60 ");
+disp("A1=W^HT");
+disp("*-second condition-*");
+disp("W>100 tons => W , T>60 => T");
+disp("A2=WT");
+disp("*-third condition-*");
+disp("W<100 tons => W^ ,P>30 => P");
+disp("A3=W^P");
+disp("since Air condtioning system should be activated if any one of the above is satisfied so ");
+disp("A=A1+A2+A3");
+disp("A=W^HT+WT+W^P");
+disp("A=T(W^H+W)+W^P");
+disp("A=T(W+H)+W^P");
+disp("Thus a combinational system with above expression makes the air conditioning system on when required")
\ No newline at end of file diff --git a/48/CH3/EX3.14/eg_3_14.sce b/48/CH3/EX3.14/eg_3_14.sce new file mode 100755 index 000000000..b0501f2d8 --- /dev/null +++ b/48/CH3/EX3.14/eg_3_14.sce @@ -0,0 +1,35 @@ +clear;
+clc;
+i=1;
+//all combinations of 2 variable inputs
+f(:,1)=[0;0;1;1];
+f(:,2)=[0;1;0;1];
+//verifying D'morgan first law
+for a=0:1
+ for b=0:1
+ f(i,3)=bitcmp(bitor(a,b),1);
+ f(i,4)=bitand(bitcmp(a,1),bitcmp(b,1));
+ i=i+1;
+ end
+end
+disp(" a b (a+b)^ a^b^");
+disp(f);
+disp("Therefore (a+b)^=a^ b^ ");
+//verfying D'morgan 2nd law
+i=1;
+for a=0:1
+ for b=0:1
+ f(i,3)=bitcmp(bitand(a,b),1);
+ f(i,4)=bitor(bitcmp(a,1),bitcmp(b,1));
+ i=i+1;
+ end
+end
+disp(" a b (ab)^ a^+b^");
+disp(f);
+//proving D'morgans laws theoritically
+disp("(a+b)^=a^.b^");
+disp("(a.b)^=a^+b^");
+disp("we have show that (a+b)(a+b)^=0 and (a+b)+a^.b^=1");
+disp("(a+b)a^b^=aa^b^+ba^b^=0+a^bb^=0+0=0");
+disp("(a+b)+a^b^=a+b+a^b^=a+b+a^=b+a+a^=b+1=1");
+disp("This proves the first Dmorgan law and in the similar way 2nd law can also be proved");
\ No newline at end of file diff --git a/48/CH3/EX3.2/eg_3_2.sce b/48/CH3/EX3.2/eg_3_2.sce new file mode 100755 index 000000000..a1dee0999 --- /dev/null +++ b/48/CH3/EX3.2/eg_3_2.sce @@ -0,0 +1,16 @@ +clear
+clc
+disp("T(x,y,z)=(x+y)[x^(y^+z^)]^+x^y^+x^z^");
+disp("From the properties 1. (ab)^=a^+b^ 2. (a+b)^=a^b^");
+disp("T(x,y,z)=((x+y)(x+yz))+x^y^+x^z^");
+disp("Multipliying the first 2 terms");
+disp("T(x,y,z)=(x+xyz+xy+yz)+x^y^+x^z^");
+disp("T(x,y,z)=(x(1+y+yz)+yz)+x^y^+x^z^");
+disp("T(x,y,z)=x+yz+x^y^+x^z^");
+disp("we know a+a^b=a+b");
+disp("T(x,y,z)=x+y^+yz+x^z^");
+disp("T(x,y,z)=x+z^+y^+yz");
+disp("T(x,y,z)=x+z^+y^+z");
+disp("since z+z^=1");
+disp("T(x,y,z)=x+1+y^");
+disp("T(x,y,z)=1")
diff --git a/48/CH3/EX3.3/eg_3_3.sce b/48/CH3/EX3.3/eg_3_3.sce new file mode 100755 index 000000000..a12240181 --- /dev/null +++ b/48/CH3/EX3.3/eg_3_3.sce @@ -0,0 +1,14 @@ +clear
+clc;
+disp("L.H.S = xy+x^y^+yz");
+disp("R.H.S = xy+x^y^+x^z");
+disp("Based on consensus theorem")
+disp("we can write x^y^+yz as x^y^+yz+x^z bcoz the two expressions are equal");
+disp("(x^y^+yz+x^z(y+y^))=x^y^+yz+x^yz+x^y^z");
+disp("x^y^+yz+x^yz+x^y^z=x^y^(1+z)+yz(1+x^)");
+disp("x^y^+yz=x^y^+yz+x^z");
+disp("so L.H.S=xy+x^y^+yz=xy+x^y^+yz+x^z");
+disp("In the similar way xy+yz+x^z can be simplified as xy+x^z");
+disp("so L.H.S becomes xy+x^z+x^y^");
+disp("thus L.H.S= R.H.S");
+disp("hence proved")
\ No newline at end of file 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 diff --git a/48/CH3/EX3.5/eg_3_5.sce b/48/CH3/EX3.5/eg_3_5.sce new file mode 100755 index 000000000..2236bc652 --- /dev/null +++ b/48/CH3/EX3.5/eg_3_5.sce @@ -0,0 +1,11 @@ +clear;
+clc;
+disp("T(A,B,C,D)=A^C^+ABD+BC^D+AB^D^+ABCD^");
+disp("Assume A^=x , C^=y , BD=z");
+disp("Now from consensus theorem for the first three terms");
+disp("BC^D is the redundant term so it can be removed");
+disp("T(A,B,C,D)=A^C^+ABD+AB^D^+ABCD^");
+disp("T(A,B,C,D)=A^C^+ABD+AD^(B^+BC)");
+disp("we know that a+a^b=a+b");
+disp("T(A,B,C,D)=A^C^+ABD+AD^(B^+C)");
+disp("T(A,B,C,D)=A^C^+A(BD+D^(B^+C))");
\ No newline at end of file diff --git a/48/CH3/EX3.6/eg_3_6.sce b/48/CH3/EX3.6/eg_3_6.sce new file mode 100755 index 000000000..a749f31bf --- /dev/null +++ b/48/CH3/EX3.6/eg_3_6.sce @@ -0,0 +1,13 @@ +clear
+clc
+disp("T(A,B,C,D)=A^B+ABD+AB^CD^+BC");
+disp("T(A,B,C,D)=B(A^+AD)+C(AD^B^+B)");
+disp("T(A,B,C,D)=B(A^+D)+C(AD^+B)");
+disp("T(A,B,C,D)=A^B+BD+ACD^+BC");
+disp("T(A,B,C,D)=A^B+BD+ACD^+BC(A+A^)");
+disp("T(A,B,C,D)=A^B+A^BC+ABC+BD+ACD^");
+disp("T(A,B,C,D)=A^B(1+C)+ABC+BD+ACD^");
+disp("T(A,B,C,D)=A^B+ABC+BD+ACD^");
+disp("**Now apply consensus theorem for 2nd 3rd and 4th terms**");
+disp("let x=D,y=B,z=AC");
+disp("T(A,B,C,D)=A^B+BD+ACD^");
\ No newline at end of file diff --git a/48/CH3/EX3.7/eg_3_7.sce b/48/CH3/EX3.7/eg_3_7.sce new file mode 100755 index 000000000..a1671e5f8 --- /dev/null +++ b/48/CH3/EX3.7/eg_3_7.sce @@ -0,0 +1,7 @@ +clear;
+clc;
+disp("T(x,y,z)=x^y+z^+xyz");
+disp("**To determine the canonical sum of products we have to check for a product which is not a min term and then multiply with the missing variable such that the expression value doesnt change**");
+disp("T(x,y,z)=x^y(z+z^)+(x+x^)(y+y^)z^+xyz");
+disp("T(x,y,z)=x^yz+x^yz^+xyz^+xy^z^+x^yz^+x^y^z^+xyz");
+disp("T(x,y,z)=x^yz+x^yz^+xyz^+xy^z^+x^y^z^+xyz");
\ No newline at end of file diff --git a/48/CH3/EX3.8/eg_3_8.sce b/48/CH3/EX3.8/eg_3_8.sce new file mode 100755 index 000000000..c97b4a049 --- /dev/null +++ b/48/CH3/EX3.8/eg_3_8.sce @@ -0,0 +1,10 @@ +clear;
+clc;
+disp("T(x,y,z)=x^(y^+z)");
+disp("**To determine the canonical product of sums form you need to check for a product which is not a max term and then add it with the missing terms such that the expression value is not altered**");
+disp("T(x,y,z)=(x^+yy^+zz^)(xx^+y^+z)");
+disp("a+b+cc^ can be written as product of 2 max terms (a+b+c)(a+b+c^)");
+disp("a+bb^+cc^ can be written as (a+b+c)(a+b+c^)(a+b^+c)(a+b^+c^)");
+disp("from the above two properties we can write the T(x,y,z) as");
+disp("T(x,y,z)=(x^+y+z)(x^+y+z^)(x^+y^+z)(x^+y^+z^)(x+y^+z)(x^+y^+z)");
+disp("T(x,y,z)=(x^+y+z)(x^+y+z^)(x^+y^+z)(x^+y^+z^)(x+y^+z)");
\ No newline at end of file diff --git a/48/CH3/EX3.9/eg_3_9.sce b/48/CH3/EX3.9/eg_3_9.sce new file mode 100755 index 000000000..dff2dbf37 --- /dev/null +++ b/48/CH3/EX3.9/eg_3_9.sce @@ -0,0 +1,6 @@ +clear;
+clc;
+disp("T(x,y,z)=x^y^z^+x^y^z+x^yz+xyz+xy^z+xy^z^");
+disp("the complement T^ consists of those minterms which are not contained in the expression for T");
+disp("T=[x^yz^+xyz^]^");
+disp("(x+y^+z)(x^+y^+z)");
|