summaryrefslogtreecommitdiff
path: root/45/CH11
diff options
context:
space:
mode:
Diffstat (limited to '45/CH11')
-rwxr-xr-x45/CH11/EX11.1/example_11_1.sce34
-rwxr-xr-x45/CH11/EX11.2/example_11_2.sce43
-rwxr-xr-x45/CH11/EX11.5/example_11_5.sce29
-rwxr-xr-x45/CH11/EX11.6/example_11_6.sce10
-rwxr-xr-x45/CH11/EX11.7/example_11_7.sce10
-rwxr-xr-x45/CH11/EX11.8/example_11_8.sce16
6 files changed, 142 insertions, 0 deletions
diff --git a/45/CH11/EX11.1/example_11_1.sce b/45/CH11/EX11.1/example_11_1.sce
new file mode 100755
index 000000000..252cd799c
--- /dev/null
+++ b/45/CH11/EX11.1/example_11_1.sce
@@ -0,0 +1,34 @@
+//example 11.1
+clc;
+//this program requires
+//kmap3a.sci to find the kmap
+//noof.sci function used inside kmap
+//noof0.sci function used inside kmap
+n= [ 0 0 0;
+ 0 0 1;
+ 0 1 0;
+ 0 1 1;
+ 1 0 0;
+ 1 0 1;
+ 1 1 0;
+ 1 1 1];
+ for i= 1:8 //printing the state synthesis table
+ an1(i,1)=n(i,3);
+ dn(i,1)=n(i,3);
+ if n(i,1)==1 & n(i,2) ==1 & n(i,3)==0 then
+ z(i,1)=1;
+ else
+ z(i,1)=0;
+ end
+end;
+dis=[n an1 dn z];
+disp('State Synthesis table :');
+disp(' An X Y An1 Dn Z');
+disp(dis);
+printf('\n\n Design equations :\n');
+Dn = [ 0 1 1 0;0 1 1 0];
+Z= [ 0 0 0 0;0 0 0 1];
+dn1= kmap3a(Dn); // finding the 3 varible kmap of Dn
+printf('\n Dn = %s \n\n',dn1); //displaying the minimized expression
+z1= kmap3a(Z); //finding the 3 variable kmap of Z
+printf('\n Z = %s \n\n',z1); //displaying the minimized expression
diff --git a/45/CH11/EX11.2/example_11_2.sce b/45/CH11/EX11.2/example_11_2.sce
new file mode 100755
index 000000000..f09a9e99f
--- /dev/null
+++ b/45/CH11/EX11.2/example_11_2.sce
@@ -0,0 +1,43 @@
+// example 11.2
+//this code needs
+//donkmapij.sci // function to minimize given expression using a kmap
+//noof1.sci
+//above two shoulb be executed before executing this code
+clc;
+tt=[0 0 0 0 0 0 0 0 0 0; // given state synthesis table
+ 0 0 0 1 0 0 0 0 0 0;
+ 0 0 1 0 0 1 0 0 0 1;
+ 0 0 1 1 1 0 0 0 1 0;
+ 0 1 0 0 0 1 0 0 0 1;
+ 0 1 0 1 0 1 0 0 0 1;
+ 0 1 1 0 1 0 0 0 1 0;
+ 0 1 1 1 0 0 1 0 0 0;
+ 1 0 0 0 1 0 0 0 1 0;
+ 1 0 0 1 1 0 0 0 1 0;
+ 1 0 1 0 0 0 1 0 0 0;
+ 1 0 1 1 0 0 1 1 0 0];
+disp('State snthesis table for Vending machine problem'); //printing the staate synthesis table
+disp('Present state input Next state Output Db Da');
+disp(' Bn An I J Bn1 An1 X Y');
+disp(tt);
+printf('\n\n Design equations :\n');
+
+printf('\n Design equation for DB\n');
+db =[ 0 0 2 1 ; 0 0 2 1 ;1 0 2 0 ;0 1 2 0];
+DB =donkmapij(db);// minimizing the expresion using 4 variable kmap
+printf('\n DB = %s \n\n',DB);//displaing result
+
+printf('\n Design equation for DA\n');
+da =[ 0 1 2 0;0 1 2 0 ;0 0 2 0;1 0 2 0];
+DA =donkmapij(da);// minimizing the expresion using 4 variable kmap
+printf('\n DA = %s \n\n',DA);//displaing result
+
+printf('\n Design equation for X\n');
+x =[0 0 2 0;0 0 2 0;0 1 2 1; 0 0 2 1];
+X =donkmapij(x);// minimizing the expresion using 4 variable kmap
+printf('\n X = %s \n\n',X);//displaing result
+
+printf('\n Design equation for Y\n');
+y=[0 0 2 0;0 0 2 0;0 0 2 1;0 0 2 0];
+Y =donkmapij(y);// minimizing the expresion using 4 variable kmap
+printf('\n Y = %s \n\n',Y);//displaing result
diff --git a/45/CH11/EX11.5/example_11_5.sce b/45/CH11/EX11.5/example_11_5.sce
new file mode 100755
index 000000000..94a464120
--- /dev/null
+++ b/45/CH11/EX11.5/example_11_5.sce
@@ -0,0 +1,29 @@
+//example 11.5
+clc;
+clear;
+disp('Original table :'); //displaying original table
+disp('Present State Next State Present Output');
+disp(' X=0 X=1 ');
+disp(' a a b 0 ');
+disp(' √b c d 0 ');
+disp(' c d e 1 ');
+disp(' √d c b 0 ');
+disp(' e b c 1 ');
+disp('For states b and d except for next state X=1 rest are same. NOw b and d would have been equivalent if these next states are equivalent. For b next state is d and d, next state is b. Thus bd are equivalent if next states db are equivalent which can always be true. Thus b and d are equivlent and state b is retained.')
+disp('Table after first row elimination :'); //after first row elimination
+disp('Present State Next State Present Output');
+disp(' X=0 X=1 ');
+disp(' a a b 0 ');
+disp(' b c b 0 ');
+disp(' √c b e 1 ');
+disp(' √e b c 1 ');
+disp('Now repeating the same above step for c and e. Retaining c and replacing arll c''s with e we get the below table ');
+disp('Table after second row elimination :');//after second row elimination
+disp('Present State Next State Present Output');
+disp(' X=0 X=1 ');
+disp(' a a b 0 ');
+disp(' b c b 0 ');
+disp(' c b c 1 ');
+
+disp('Implication table method'); // by implication method
+printf('d:d\nc:d(ce)\nb:d(Ce)(bd)\na:(ce)(bd)a\nP=(ce)(bd)(a)');
diff --git a/45/CH11/EX11.6/example_11_6.sce b/45/CH11/EX11.6/example_11_6.sce
new file mode 100755
index 000000000..7cb20f7dc
--- /dev/null
+++ b/45/CH11/EX11.6/example_11_6.sce
@@ -0,0 +1,10 @@
+//example 11.6
+clc;
+clear;
+disp('To analye the circuit we consider x = X(t-τ) where τ is the cummulative propagatin delay from input side up to X.For all possible combbinations of xAB we get X and Y following the logic relation as shown in the circuit and prepare the following Karnaugh map');
+disp('Karnaugh map'); // displaying the kmap
+disp(' AB')
+disp('x 00 01 11 10');
+disp('0 0''/0 0''/0 1/0 0''/0');
+disp('1 0/0 0/1 1''/1 1''/0');
+disp('State where X = x are stable and primed. Outputs corresponding to ech state and inpt combination are shown beside.');
diff --git a/45/CH11/EX11.7/example_11_7.sce b/45/CH11/EX11.7/example_11_7.sce
new file mode 100755
index 000000000..e4ac0031c
--- /dev/null
+++ b/45/CH11/EX11.7/example_11_7.sce
@@ -0,0 +1,10 @@
+//example 11.7
+clc;
+clear;
+disp('Given karnaugh map '); //given kmap
+disp(' 00 01 11 10');
+disp('00 11 00'' 11 00''');
+disp('01 01'' 11 11 01''');
+disp('11 10 11 11'' 10');
+disp('10 10'' 10'' 11 11');
+disp('Yes, the circuit may face problem in its operation. When the circuit is at stable state xyAB = 1111 and input AB changes from 11 --> 10 the circuit oscillates between xyAB = 1110 and xy AB = 1010. Also there can be a criticl race problem if at stable state xyAB = 0001, input AB chnge from 01 to 00. The circuit may settle at xyAB = 0100 or xyAB = 1000 depending on which of x and y changes first at the feedbck path. Non-critical race situatuion occurs if at stable state xyAB = 0010 the input AB change from 10 to 00. '); \ No newline at end of file
diff --git a/45/CH11/EX11.8/example_11_8.sce b/45/CH11/EX11.8/example_11_8.sce
new file mode 100755
index 000000000..8b9656cec
--- /dev/null
+++ b/45/CH11/EX11.8/example_11_8.sce
@@ -0,0 +1,16 @@
+//example 11.8
+// this program requires
+//kmp3abx.sci
+//noof.sci
+//noof0.sci
+//above three functions are first execute before executing this program
+clc;
+disp('State table through karnaugh map'); // state table through kmap
+disp(' 00 01 11 10');
+disp('a a'' a'' b b');
+disp('b a b'' b'' b''');
+disp('If we represent current state a as x = 0 and b as x =1 the noutput X can be expressed as ');
+j=[0 0 1 1 ; 0 1 1 1];
+J= kmap3abx(j); // finding the minimized expresion using 3-variable kmap
+disp('The minimised expression J');
+disp(J); // displaying the minimized expression \ No newline at end of file