summaryrefslogtreecommitdiff
path: root/45
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /45
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 '45')
-rwxr-xr-x45/CH1/EX1.1/example_1_1.sce8
-rwxr-xr-x45/CH1/EX1.2/example_1_2.sce6
-rwxr-xr-x45/CH10/EX10.1/example_10_1.sce10
-rwxr-xr-x45/CH10/EX10.10/example_10_10.sce4
-rwxr-xr-x45/CH10/EX10.12/example_10_12.sce42
-rwxr-xr-x45/CH10/EX10.13/example_10_13.sce28
-rwxr-xr-x45/CH10/EX10.14/example_10_14.sce63
-rwxr-xr-x45/CH10/EX10.15/example_10_15.sce18
-rwxr-xr-x45/CH10/EX10.2/example_10_2.sce17
-rwxr-xr-x45/CH10/EX10.3/10_3.jpgbin0 -> 36428 bytes
-rwxr-xr-x45/CH10/EX10.3/example_10_3.sce96
-rwxr-xr-x45/CH10/EX10.5/example_10_5.sce4
-rwxr-xr-x45/CH10/EX10.6/example_10_6.sce5
-rwxr-xr-x45/CH10/EX10.7/example_10_7.sce16
-rwxr-xr-x45/CH10/EX10.8/example_10_8.sce12
-rwxr-xr-x45/CH10/EX10.9/10_9.jpgbin0 -> 33176 bytes
-rwxr-xr-x45/CH10/EX10.9/example_10_9.sce86
-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
-rwxr-xr-x45/CH12/EX12.1/example_12_1.sce19
-rwxr-xr-x45/CH12/EX12.10/example_12_10.sce6
-rwxr-xr-x45/CH12/EX12.11/example_12_11.sce17
-rwxr-xr-x45/CH12/EX12.13/example_12_13.sce6
-rwxr-xr-x45/CH12/EX12.2/example_12_2.sce25
-rwxr-xr-x45/CH12/EX12.3/example_12_3.sce8
-rwxr-xr-x45/CH12/EX12.4/example_12_4.sce18
-rwxr-xr-x45/CH12/EX12.5/example_12_5.sce10
-rwxr-xr-x45/CH12/EX12.6/example_12_6.sce13
-rwxr-xr-x45/CH12/EX12.8/example_12_8.sce5
-rwxr-xr-x45/CH12/EX12.9/example_12_9.sce8
-rwxr-xr-x45/CH13/EX13.2/example_13_2.sce10
-rwxr-xr-x45/CH13/EX13.3/example_13_3.sce12
-rwxr-xr-x45/CH14/EX14.1/example_14_1.sce18
-rwxr-xr-x45/CH14/EX14.2/example_14_2.sce11
-rwxr-xr-x45/CH14/EX14.3/example_14_3.sce22
-rwxr-xr-x45/CH14/EX14.4/example_14_4.sce11
-rwxr-xr-x45/CH15/EX15.1/example_15_1.sce17
-rwxr-xr-x45/CH15/EX15.10/example_15_10.sce12
-rwxr-xr-x45/CH15/EX15.11/example_15_11.sce4
-rwxr-xr-x45/CH15/EX15.12/example_15_12.sce4
-rwxr-xr-x45/CH15/EX15.4/example_15_4.sce22
-rwxr-xr-x45/CH15/EX15.5/example_15_5.sce3
-rwxr-xr-x45/CH15/EX15.6/example_15_6.sce15
-rwxr-xr-x45/CH15/EX15.9/example_15_9.sce19
-rwxr-xr-x45/CH16/EX16.1/example_16_1.sce17
-rwxr-xr-x45/CH16/EX16.6/example_16_6.sce11
-rwxr-xr-x45/CH2/EX2.1/2_1.jpgbin0 -> 27849 bytes
-rwxr-xr-x45/CH2/EX2.1/example_2_1.sce40
-rwxr-xr-x45/CH2/EX2.10/example_2_10.sce22
-rwxr-xr-x45/CH2/EX2.11/2_11.jpgbin0 -> 35004 bytes
-rwxr-xr-x45/CH2/EX2.11/example_2_11.sce99
-rwxr-xr-x45/CH2/EX2.12/example_2_12.sce23
-rwxr-xr-x45/CH2/EX2.13/example_2_13.sce24
-rwxr-xr-x45/CH2/EX2.14/2_14.jpgbin0 -> 36963 bytes
-rwxr-xr-x45/CH2/EX2.14/example_2_14.sce106
-rwxr-xr-x45/CH2/EX2.15/example_2_15.sce23
-rwxr-xr-x45/CH2/EX2.2/2_2.jpgbin0 -> 28070 bytes
-rwxr-xr-x45/CH2/EX2.2/example_2_2.sce40
-rwxr-xr-x45/CH2/EX2.3/example_2_3.sce17
-rwxr-xr-x45/CH2/EX2.4/example_2_4.sce16
-rwxr-xr-x45/CH2/EX2.9/example_2_9.sce24
-rwxr-xr-x45/CH3/EX3.1/example_3_1.sce7
-rwxr-xr-x45/CH3/EX3.10/example_3_10.sce9
-rwxr-xr-x45/CH3/EX3.11/example_3_11.sce14
-rwxr-xr-x45/CH3/EX3.12/example_3_12.sce13
-rwxr-xr-x45/CH3/EX3.13/example_3_13.sce126
-rwxr-xr-x45/CH3/EX3.14/3_14.jpgbin0 -> 37383 bytes
-rwxr-xr-x45/CH3/EX3.14/example_3_14.sce136
-rwxr-xr-x45/CH3/EX3.2/example_3_2.sce11
-rwxr-xr-x45/CH3/EX3.3/example_3_3.sce30
-rwxr-xr-x45/CH3/EX3.4/example_3_4.sce26
-rwxr-xr-x45/CH3/EX3.5/example_3_5.sce13
-rwxr-xr-x45/CH3/EX3.6/example_3_6.sce8
-rwxr-xr-x45/CH3/EX3.7/example_3_7.sce13
-rwxr-xr-x45/CH3/EX3.8/example_3_8.sce12
-rwxr-xr-x45/CH3/EX3.9/example_3_9.sce28
-rwxr-xr-x45/CH4/EX4.1/exmple_4_1.sce10
-rwxr-xr-x45/CH4/EX4.10/exmple_4_10.sce15
-rwxr-xr-x45/CH4/EX4.11/exmple_4_11.sce45
-rwxr-xr-x45/CH4/EX4.2/exmple_4_2.sce74
-rwxr-xr-x45/CH4/EX4.3/exmple_4_3.sce8
-rwxr-xr-x45/CH4/EX4.4/exmple_4_4.sce17
-rwxr-xr-x45/CH4/EX4.7/exmple_4_7.sce10
-rwxr-xr-x45/CH4/EX4.8/exmple_4_8.sce9
-rwxr-xr-x45/CH4/EX4.9/exmple_4_9.sce25
-rwxr-xr-x45/CH5/EX5.1/example_5_1.sce40
-rwxr-xr-x45/CH5/EX5.10/example_5_10.sce22
-rwxr-xr-x45/CH5/EX5.11/example_5_11.sce22
-rwxr-xr-x45/CH5/EX5.2/example_5_2.sce40
-rwxr-xr-x45/CH5/EX5.3/example_5_3.sce7
-rwxr-xr-x45/CH5/EX5.4/example_5_4.sce33
-rwxr-xr-x45/CH5/EX5.5/example_5_5.sce7
-rwxr-xr-x45/CH5/EX5.6/example_5_6.sce34
-rwxr-xr-x45/CH5/EX5.7/example_5_7.sce21
-rwxr-xr-x45/CH5/EX5.8/example_5_8.sce8
-rwxr-xr-x45/CH5/EX5.9/example_5_9.sce21
-rwxr-xr-x45/CH6/EX6.1/example_6_1.sce52
-rwxr-xr-x45/CH6/EX6.10/example_6_10.sce110
-rwxr-xr-x45/CH6/EX6.12/example_6_12.sce24
-rwxr-xr-x45/CH6/EX6.2/example_6_2.sce53
-rwxr-xr-x45/CH6/EX6.3/example_6_3.sce62
-rwxr-xr-x45/CH6/EX6.4/example_6_4.sce73
-rwxr-xr-x45/CH6/EX6.5/example_6_5.sce76
-rwxr-xr-x45/CH6/EX6.6/example_6_6.sce75
-rwxr-xr-x45/CH6/EX6.7/example_6_7.sce76
-rwxr-xr-x45/CH6/EX6.8/example_6_8.sce74
-rwxr-xr-x45/CH6/EX6.9/example_6_9.sce64
-rwxr-xr-x45/CH7/EX7.1/example_7_1.sce13
-rwxr-xr-x45/CH7/EX7.10/7_10_a.jpgbin0 -> 25888 bytes
-rwxr-xr-x45/CH7/EX7.10/7_10_b.jpgbin0 -> 22503 bytes
-rwxr-xr-x45/CH7/EX7.10/example_7_10.sce62
-rwxr-xr-x45/CH7/EX7.11/example_7_11.sce11
-rwxr-xr-x45/CH7/EX7.2/example_7_2.sce9
-rwxr-xr-x45/CH7/EX7.3/example_7_3.sce14
-rwxr-xr-x45/CH7/EX7.4/7_4.jpgbin0 -> 29557 bytes
-rwxr-xr-x45/CH7/EX7.4/example_7_4.sce38
-rwxr-xr-x45/CH7/EX7.5/example_7_5.sce12
-rwxr-xr-x45/CH7/EX7.6/example_7_6.sce17
-rwxr-xr-x45/CH7/EX7.7/example_7_7.sce9
-rwxr-xr-x45/CH7/EX7.8/example_7_8.sce9
-rwxr-xr-x45/CH7/EX7.9/7_9_a.jpgbin0 -> 25931 bytes
-rwxr-xr-x45/CH7/EX7.9/7_9_b.jpgbin0 -> 23752 bytes
-rwxr-xr-x45/CH7/EX7.9/example_7_9.sce53
-rwxr-xr-x45/CH8/EX8.10/example_8_10.sce83
-rwxr-xr-x45/CH8/EX8.12/example_8_12.sce22
-rwxr-xr-x45/CH8/EX8.13/example_8_13.sce5
-rwxr-xr-x45/CH8/EX8.4/example_8_4.sce21
-rwxr-xr-x45/CH8/EX8.5/example_8_5.sce10
-rwxr-xr-x45/CH8/EX8.6/example_8_6.sce10
-rwxr-xr-x45/CH8/EX8.7/example_8_7.sce5
-rwxr-xr-x45/CH8/EX8.9/8_9.jpgbin0 -> 23418 bytes
-rwxr-xr-x45/CH8/EX8.9/example_8_9.sce40
-rwxr-xr-x45/CH9/EX9.1/example_9_1.sce45
-rwxr-xr-x45/CH9/EX9.2/9_2.jpgbin0 -> 34045 bytes
-rwxr-xr-x45/CH9/EX9.2/example_9_2.sce128
-rwxr-xr-x45/CH9/EX9.4/example_9_4.sce11
-rwxr-xr-x45/CH9/EX9.5/example_9_5.sce10
-rwxr-xr-x45/CH9/EX9.8/example_9_8.sce8
-rwxr-xr-x45/CH9/EX9.9/example_9_9.sce4
-rwxr-xr-x45/DEPENDENCIES/donkmapij.sci279
-rwxr-xr-x45/DEPENDENCIES/kmap.sci283
-rwxr-xr-x45/DEPENDENCIES/kmap2.sci59
-rwxr-xr-x45/DEPENDENCIES/kmap3.sci150
-rwxr-xr-x45/DEPENDENCIES/kmap3a.sci152
-rwxr-xr-x45/DEPENDENCIES/kmap3abx.sci159
-rwxr-xr-x45/DEPENDENCIES/kmappos.sci332
-rwxr-xr-x45/DEPENDENCIES/kmapsx.sci285
-rwxr-xr-x45/DEPENDENCIES/noof.sci10
-rwxr-xr-x45/DEPENDENCIES/noof0.sci10
-rwxr-xr-x45/DEPENDENCIES/noof1.sci10
154 files changed, 5365 insertions, 0 deletions
diff --git a/45/CH1/EX1.1/example_1_1.sce b/45/CH1/EX1.1/example_1_1.sce
new file mode 100755
index 000000000..e7fef44d3
--- /dev/null
+++ b/45/CH1/EX1.1/example_1_1.sce
@@ -0,0 +1,8 @@
+//Example 1.1
+clc;
+clear;
+f= 5 * 10^6 ; //given
+T=1/f; // caculating the time period .
+H = 0.05 * 10^-6 / T ;
+printf('Time period of the waveform is T = %f us\n',T); //displaying results
+printf(" Duty cycle H = %f %%",H*100);
diff --git a/45/CH1/EX1.2/example_1_2.sce b/45/CH1/EX1.2/example_1_2.sce
new file mode 100755
index 000000000..71602b264
--- /dev/null
+++ b/45/CH1/EX1.2/example_1_2.sce
@@ -0,0 +1,6 @@
+//Example 1.2
+clc;
+clear;
+n=8; // given no of flip flops
+max_count = 2^n -1 ;
+printf("Maximum count = %d",max_count); \ No newline at end of file
diff --git a/45/CH10/EX10.1/example_10_1.sce b/45/CH10/EX10.1/example_10_1.sce
new file mode 100755
index 000000000..dcd7c8130
--- /dev/null
+++ b/45/CH10/EX10.1/example_10_1.sce
@@ -0,0 +1,10 @@
+//example 10.1
+clc;
+clear;
+//c= input('Enter the period of the waveform at C in micro seconds : ');
+c=24;// given period of waveform
+clk= c/8;
+clkf = 1/(clk*10^-3);
+printf('The clock period is %f micro seconds \n',clk);//displaying the results
+printf('The clock frequenc must be %f KHz ', clkf);
+
diff --git a/45/CH10/EX10.10/example_10_10.sce b/45/CH10/EX10.10/example_10_10.sce
new file mode 100755
index 000000000..1dde98ea0
--- /dev/null
+++ b/45/CH10/EX10.10/example_10_10.sce
@@ -0,0 +1,4 @@
+//example 10.10
+clc;
+clear;
+printf('The correct expresion is ""8"" = Qd Qc'' Qb Qa'''); \ No newline at end of file
diff --git a/45/CH10/EX10.12/example_10_12.sce b/45/CH10/EX10.12/example_10_12.sce
new file mode 100755
index 000000000..258fea5ba
--- /dev/null
+++ b/45/CH10/EX10.12/example_10_12.sce
@@ -0,0 +1,42 @@
+//example 10.12
+clc
+clear
+//pro= ('Enter the value to whic counter should progress:');
+pro =11; // given input
+q=1;
+aa=pro;
+for i=1:4 //converting the given number in to binary
+ x=modulo(aa,2);
+ b(q)=x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+
+bi=' '; // then printing the NAND gate inputs
+for i=1:4
+ if i==1 & b(i)==1 then
+ bi=strcat([bi 'Qa']);
+ elseif i==1 & b(i)== 0 ;
+ bi=strcat([bi 'Qa''']);
+ end
+ if i==2 & b(i)==1 then
+ bi=strcat([bi 'Qb']);
+ elseif i==2 & b(i)== 0 ;
+ bi=strcat([bi 'Qb''']);
+ end
+ if i==3 & b(i)==1 then
+ bi=strcat([bi 'Qc']);
+ elseif i==3 & b(i)== 0 ;
+ bi=strcat([bi 'Qc''']);
+ end
+ if i==4 & b(i)==1 then
+ bi=strcat([bi 'Qd']);
+ elseif i==4 & b(i)== 0 ;
+ bi=strcat([bi 'Qd''']);
+ end
+
+end
+disp('The NAND gate inputs must be :');
+disp(bi)
+
diff --git a/45/CH10/EX10.13/example_10_13.sce b/45/CH10/EX10.13/example_10_13.sce
new file mode 100755
index 000000000..6e5020d7d
--- /dev/null
+++ b/45/CH10/EX10.13/example_10_13.sce
@@ -0,0 +1,28 @@
+//example 10.13
+clc;
+clear
+//pre=input("Enter the number where the counter is preset");
+pre = 1001; // given preset value
+q=1;
+b=0;
+f=0;
+a=pre;
+while(a>0) //converting to decimal
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+disp("The counter will count down to 15 , Then preset back to %d, The resulting state diagram is shown below");
+for k=1:3
+for i=9:-1:0 // this will print the states
+printf('%d ',i);
+end;
+printf('15 ');
+
+end; \ No newline at end of file
diff --git a/45/CH10/EX10.14/example_10_14.sce b/45/CH10/EX10.14/example_10_14.sce
new file mode 100755
index 000000000..4a5ecfc4e
--- /dev/null
+++ b/45/CH10/EX10.14/example_10_14.sce
@@ -0,0 +1,63 @@
+//example 10.14
+//this program uses the following functions
+//kmap3.sci
+//noof.sci and noof0.sci
+//the above programs should be executed before executing these programs
+clc;
+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 : 5
+ n1(i,:)= n(i+1,:)
+ end
+ for i=6:8
+ n1(i,:)=[0 0 0]
+ end;
+ p=1;
+ for i= 1:3 //making the state table
+ for j = 1:8
+ if n(j,i)== 0
+ jf(j,p)= n1(j,i);
+ jf(j,p+1)= 2;
+ elseif n(j,i) == 1
+ jf(j,p)=2;
+ jf(j,p+1)=bitcmp(n1(j,i),1);
+ end
+ end
+ p=p+2
+end;
+disp('State tabel for mod 6 counter:'); //displaying the state table
+di= [n n1 jf];
+disp(' Cn Bn An Cn1 Bn1 An1 Jc Kc Jb Kb Ja Ka');
+disp(di);
+disp('Here ''2'' represents a don''t care condition');
+disp('These below Karnaugh maps give the design equations');
+
+jc=[0 0 1 0;2 2 2 2] //Krnaugh Maps for the design equations
+JC=kmap3(jc); //calling the 3-variable kmap
+printf('\n\nJC = %s \n',JC); //displaying the result
+
+kc=[2 2 2 2;0 1 1 1]
+KC=kmap3(kc);//calling the 3-variable kmap
+printf('\n\nKC = %s \n',KC); //displaying the result
+
+jb=[0 1 2 2;0 0 2 2]
+JB=kmap3(jb);//calling the 3-variable kmap
+printf('\n\nJB = %s \n',JB); //displaying the result
+
+kb=[2 2 1 0;2 2 1 1]
+KB=kmap3(kb);//calling the 3-variable kmap
+printf('\n\nKB = %s \n',KB); //displaying the result
+
+ja=[1 2 2 1;1 2 2 0]
+JA=kmap3(ja);//calling the 3-variable kmap
+printf('\n\nJA = %s \n',JA); //displaying the result
+
+ka=[2 1 1 2;2 1 1 2]
+KA=kmap3(ka);//calling the 3-variable kmap
+printf('\n\nKA = %s \n',KA); //displaying the result
diff --git a/45/CH10/EX10.15/example_10_15.sce b/45/CH10/EX10.15/example_10_15.sce
new file mode 100755
index 000000000..3c69197bb
--- /dev/null
+++ b/45/CH10/EX10.15/example_10_15.sce
@@ -0,0 +1,18 @@
+//example 10.15
+//this program use kmap2.sci
+//kmap2.sci should be executed before executing this program
+clc;
+a= [0 0 1 1]
+b= [0 1 0 1]
+y= [1 1 0 1]
+k= [1 1 ; 0 1]
+bi = kmap2(k); // calling 2-variable kmap
+disp(" A B Y");
+for i=1:3
+ Y(i,1) = a(i);
+ Y(i,2) = b(i);
+ Y(i,3) = y(i);
+end
+disp(Y);
+disp('The minimised expression from karnaugh map is');// displaying the result
+disp(bi); \ No newline at end of file
diff --git a/45/CH10/EX10.2/example_10_2.sce b/45/CH10/EX10.2/example_10_2.sce
new file mode 100755
index 000000000..6994f5600
--- /dev/null
+++ b/45/CH10/EX10.2/example_10_2.sce
@@ -0,0 +1,17 @@
+//example 10.2
+clc;
+clc
+c=128; // given counters
+d=32;
+e=64;
+fc=log2(c);//making necessar calculations
+fd=log2(d);
+printf('A mod-128 conter should have %d flipflops\n', fc);
+printf(' A mod-32 conter should have %d flipflops\n', fd); //displaying the results
+fe=log2(e);
+n=2^fe - 1 ;
+printf(' The largest decimal no that can be stored in a mod-64 counter is %d',n);
+
+
+
+
diff --git a/45/CH10/EX10.3/10_3.jpg b/45/CH10/EX10.3/10_3.jpg
new file mode 100755
index 000000000..efe9c9562
--- /dev/null
+++ b/45/CH10/EX10.3/10_3.jpg
Binary files differ
diff --git a/45/CH10/EX10.3/example_10_3.sce b/45/CH10/EX10.3/example_10_3.sce
new file mode 100755
index 000000000..c27633205
--- /dev/null
+++ b/45/CH10/EX10.3/example_10_3.sce
@@ -0,0 +1,96 @@
+clc;
+clear;
+close;
+t=320;
+p=1;
+while p<t*1 //making arrays for ploting
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ qd(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ qd(p)=1;
+ p=p+1;
+ end
+end
+t=160;
+p=1;
+while p<t*2
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ qc(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ qc(p)=1;
+ p=p+1;
+ end
+end
+t=80;
+p=1;
+while p<t*4
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ qb(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ qb(p)=1;
+ p=p+1;
+ end
+end
+t=40;
+p=1;
+while p<t*8
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ qa(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ qa(p)=1;
+ p=p+1;
+ end
+end
+t=20;
+p=1;
+while p<t*16
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ clk(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ clk(p)=1;
+ p=p+1;
+ end
+end
+for i=320:350
+ clk(i)=0;
+ qa(i)=0;
+ qb(i)=0;
+ qc(i)=0;
+ qd(i)=0;
+end;
+y=[3 3]; //ploting the graphs
+subplot(5,1,1)
+title('Clock')
+plot(clk)
+plot(y)
+subplot(5,1,2)
+title('Qa')
+plot(qa)
+plot(y)
+subplot(5,1,3)
+title('Qb')
+plot(qb)
+plot(y)
+subplot(5,1,4)
+title('Qc')
+plot(qc)
+plot(y)
+subplot(5,1,5)
+title('Qd')
+plot(qd)
+plot(y) \ No newline at end of file
diff --git a/45/CH10/EX10.5/example_10_5.sce b/45/CH10/EX10.5/example_10_5.sce
new file mode 100755
index 000000000..43a79cc5d
--- /dev/null
+++ b/45/CH10/EX10.5/example_10_5.sce
@@ -0,0 +1,4 @@
+//example 10.5
+clc;
+clear;
+printf('The correct expression is : (count-up clock)''(Qa)(Qb)(Qc)'); \ No newline at end of file
diff --git a/45/CH10/EX10.6/example_10_6.sce b/45/CH10/EX10.6/example_10_6.sce
new file mode 100755
index 000000000..eaf9d8e75
--- /dev/null
+++ b/45/CH10/EX10.6/example_10_6.sce
@@ -0,0 +1,5 @@
+//example 10.6
+
+clc;
+clear;
+printf('The correct logic expression is : (down-up)''(Qa)(Qb)(Qc)(enable)'''); \ No newline at end of file
diff --git a/45/CH10/EX10.7/example_10_7.sce b/45/CH10/EX10.7/example_10_7.sce
new file mode 100755
index 000000000..45edcce0f
--- /dev/null
+++ b/45/CH10/EX10.7/example_10_7.sce
@@ -0,0 +1,16 @@
+//example 10.7
+clc;
+clear;
+mod = input("Enter the n value in your desired mod-n counter:");//taking the input
+m=mod;
+while 1
+ n= log2(mod); //checking whether the given number is a power of 2
+ k=modulo(n,1);
+ if k==0 then
+ printf('The number of flip flops used in mod-%d counter are:',m); // if yes the print th outpu.
+ printf('%d',n);
+ return;
+ end
+ mod =mod+1;
+ end
+
diff --git a/45/CH10/EX10.8/example_10_8.sce b/45/CH10/EX10.8/example_10_8.sce
new file mode 100755
index 000000000..6da38fcd5
--- /dev/null
+++ b/45/CH10/EX10.8/example_10_8.sce
@@ -0,0 +1,12 @@
+//example 10.8
+clc;
+clear;
+//ff = input('Enter the no of flip-flops :');
+ff=4; //given input
+k=2^ff;
+if(k==2) then //output display
+ printf('With given flipflop we can only count 2, we can have a modulus 2 counter');
+ else
+printf('With given number of flip-flops the counter will have a natural count of %d\n',k);
+printf('We can thus construct any counter that has a modulus between %d and 2',k )
+end; \ No newline at end of file
diff --git a/45/CH10/EX10.9/10_9.jpg b/45/CH10/EX10.9/10_9.jpg
new file mode 100755
index 000000000..6f3c02999
--- /dev/null
+++ b/45/CH10/EX10.9/10_9.jpg
Binary files differ
diff --git a/45/CH10/EX10.9/example_10_9.sce b/45/CH10/EX10.9/example_10_9.sce
new file mode 100755
index 000000000..d59245d48
--- /dev/null
+++ b/45/CH10/EX10.9/example_10_9.sce
@@ -0,0 +1,86 @@
+//example 10.9
+
+clc;
+clear;
+close;
+c = [0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0]; //taking the values for a mod -6 counter
+q = [0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0];
+a = [0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0];
+b = [0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0];
+y1=q;
+y2=a;
+y3=b;
+y11p=1;
+y22p=1;
+y33p=1;
+y44p=1;
+cp=1;
+yf1p=1;
+for i=1:25 // making arrays to draw the output
+ if y1(i)==1 then
+ for o=1:100
+ y11(y11p)=1;
+ y11p=y11p+1;
+ end
+ else
+ for o=1:100
+ y11(y11p)=0;
+ y11p=y11p+1;
+ end
+
+end
+if y2(i)==1 then
+ for o=1:100
+ y21(y22p)=1;
+ y22p=y22p+1;
+ end
+ else
+ for o=1:100
+ y21(y22p)=0;
+ y22p=y22p+1;
+ end
+
+end
+if y3(i)==1 then
+ for o=1:100
+ y31(y33p)=1;
+ y33p=y33p+1;
+ end
+ else
+ for o=1:100
+ y31(y33p)=0;
+ y33p=y33p+1;
+ end
+
+end
+if c(i)==1 then
+ for o=1:100
+ c1(cp)=1;
+ cp=cp+1;
+ end
+ else
+ for o=1:100
+ c1(cp)=0;
+ cp=cp+1;
+ end
+end
+
+end
+z=[2 2];
+subplot(4,1,1); //ploting the out put
+title('Timing Diagram');
+plot(c1);
+plot(z);
+ylabel('C');
+subplot(4,1,2);
+plot(y11);
+ylabel('Q');
+plot(z);
+subplot(4,1,3);
+plot(y21);
+ylabel('A');
+plot(z);
+subplot(4,1,4);
+plot(z);
+ylabel('B');
+plot(y31);
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
diff --git a/45/CH12/EX12.1/example_12_1.sce b/45/CH12/EX12.1/example_12_1.sce
new file mode 100755
index 000000000..d2832224e
--- /dev/null
+++ b/45/CH12/EX12.1/example_12_1.sce
@@ -0,0 +1,19 @@
+//chapter 12
+//Example 12.1
+//Q.Find the binary equivalent of each bit in a 4-bit system
+//solution:
+clc;
+clear;
+LSB = 1/(2^4-1); // calculating binary weights
+LSB2 = 2*1/(2^4-1);
+LSB3 = 4*1/(2^4-1);
+MSB = 8*1/(2^4-1);
+disp("Binary weight of each bit in a 4-bit system');
+disp("LSB ="); // displaing the result
+disp(LSB);
+disp("LSB2 =");
+disp(LSB2)
+disp("LSB3 =");
+disp(LSB3)
+disp("MSB =");
+disp(MSB) ; \ No newline at end of file
diff --git a/45/CH12/EX12.10/example_12_10.sce b/45/CH12/EX12.10/example_12_10.sce
new file mode 100755
index 000000000..1d0270cb6
--- /dev/null
+++ b/45/CH12/EX12.10/example_12_10.sce
@@ -0,0 +1,6 @@
+//Example 12.10
+clc;
+clear;
+disp("The LSB of an 11-bit system has a resolution of 1/2048");
+re =ceil(10000/2048); // calculting the resolution
+printf("\n\n 1/2048 x 10 = %d mV",re);
diff --git a/45/CH12/EX12.11/example_12_11.sce b/45/CH12/EX12.11/example_12_11.sce
new file mode 100755
index 000000000..cdfce25f9
--- /dev/null
+++ b/45/CH12/EX12.11/example_12_11.sce
@@ -0,0 +1,17 @@
+//Example 12.11
+clc;
+clear;
+//bit = input("Specify the converter bit length :")
+//fre = input("specify the clock frequency in kHz :")
+bit =8;
+fre = 500
+max_conv_time = 2^bit * (1/(fre*1000));
+avg_conv_time = 0.5 *max_conv_time;
+max_conv_rate = 1/max_conv_time;
+disp("Maximum Conversion Time = ");
+disp(max_conv_time);
+disp("Average Conversion Time =");
+disp(avg_conv_time);
+disp("Maximum Conversion Rate =");
+disp(max_conv_rate);
+
diff --git a/45/CH12/EX12.13/example_12_13.sce b/45/CH12/EX12.13/example_12_13.sce
new file mode 100755
index 000000000..1e1ae4da2
--- /dev/null
+++ b/45/CH12/EX12.13/example_12_13.sce
@@ -0,0 +1,6 @@
+//Example 12.13
+clc
+clear
+quat_err = 1/1024 *100 ;
+disp("If the analog portion to be constructed ti an accuracy of 0.1")
+printf("\nThe overall accuracy is in percentage = %f",0.1 + quat_err)
diff --git a/45/CH12/EX12.2/example_12_2.sce b/45/CH12/EX12.2/example_12_2.sce
new file mode 100755
index 000000000..717eca1e5
--- /dev/null
+++ b/45/CH12/EX12.2/example_12_2.sce
@@ -0,0 +1,25 @@
+//Example 12.2
+clc;
+clear;
+LSB = 1/(2^5-1); // calculating weights
+LSB2 = 2*1/(2^5-1);
+LSB3 = 4*1/(2^5-1);
+change_LSB = 10 *LSB;
+change_LSB2 = 10 *LSB2;
+change_LSB3 = 10*LSB3;
+op_vol= (10*2^0 + 0*2^1 + 10*2^2 +0*2^3 +10*2^4)/(2^5-1); // calculating output voltage
+disp("(a) LSB =");
+disp(LSB);
+disp("(b)Second LSB =");
+disp(LSB2)
+disp(" Third LSB3 =");
+disp(LSB3)
+disp('(c) change in output voltage caused by ');
+disp("change in LSB =");
+disp(change_LSB);
+disp("change in second LSB =");
+disp(change_LSB2)
+disp("change in third LSB =");
+disp(change_LSB3)
+disp("(d)output voltage for a digital input of 10101 =");
+disp(op_vol) ;
diff --git a/45/CH12/EX12.3/example_12_3.sce b/45/CH12/EX12.3/example_12_3.sce
new file mode 100755
index 000000000..f5794c621
--- /dev/null
+++ b/45/CH12/EX12.3/example_12_3.sce
@@ -0,0 +1,8 @@
+//Example 12.3
+clc;
+clear;
+for i=1:5
+ op_v(1,i)= 10/2^i; // calculating otput voltages corresponding to each bit
+end
+disp("output voltages corresponding to each bit are ") //displaying result
+disp(op_v); \ No newline at end of file
diff --git a/45/CH12/EX12.4/example_12_4.sce b/45/CH12/EX12.4/example_12_4.sce
new file mode 100755
index 000000000..16ba150ff
--- /dev/null
+++ b/45/CH12/EX12.4/example_12_4.sce
@@ -0,0 +1,18 @@
+//Example 12.4
+clc
+clear
+V_A=0
+//a=input("Enter the binary digit(5 bits) :" );
+a=11010
+for i=1:5
+ r=modulo(a,10);
+ b(1,i)=r;
+ a=a/10;
+ a=floor(a);
+end
+for j=1:5
+V_A = V_A + 10*b(1,j)*2^(j-1);
+end;
+V_A=V_A/2^5;
+disp("The output voltage in volts is ');
+disp(V_A); // displaying the value \ No newline at end of file
diff --git a/45/CH12/EX12.5/example_12_5.sce b/45/CH12/EX12.5/example_12_5.sce
new file mode 100755
index 000000000..3bd6dcbcb
--- /dev/null
+++ b/45/CH12/EX12.5/example_12_5.sce
@@ -0,0 +1,10 @@
+//Example 12.5
+clc;
+clear;
+ful_scale_voltage = 0 ;
+for i=1:5
+ op_v(1,i)= 10/2^i;
+ ful_scale_voltage = ful_scale_voltage + op_v(1,i); // calculating the full scale voltage
+end
+disp("full scale output voltage in volts is =");
+disp(ful_scale_voltage)
diff --git a/45/CH12/EX12.6/example_12_6.sce b/45/CH12/EX12.6/example_12_6.sce
new file mode 100755
index 000000000..a7606bb04
--- /dev/null
+++ b/45/CH12/EX12.6/example_12_6.sce
@@ -0,0 +1,13 @@
+//Example 12.6
+clc;
+clear;
+I=10/(3*10^3);
+printf("Current each input digital voltage must be capable of supplying is =%f mA\n",I*1000)
+ful_scale_voltage = 0 ;
+for i=1:5
+ op_v(1,i)= 10/2^i;
+ ful_scale_voltage = ful_scale_voltage + op_v(1,i);
+end
+V_A=ful_scale_voltage * (2*1000)/(1000+(2*1000));
+printf("\n Output voltage Va = %f V",V_A);
+ \ No newline at end of file
diff --git a/45/CH12/EX12.8/example_12_8.sce b/45/CH12/EX12.8/example_12_8.sce
new file mode 100755
index 000000000..ffd31365e
--- /dev/null
+++ b/45/CH12/EX12.8/example_12_8.sce
@@ -0,0 +1,5 @@
+//Example 12.8
+clc;
+clear;
+V0= 10*((1/2)+(1/4)+(1/32)+(1/128)); // calculating voltage when 1,2,5,7 re high
+printf("Output voltage = %f V",V0)//displayin result
diff --git a/45/CH12/EX12.9/example_12_9.sce b/45/CH12/EX12.9/example_12_9.sce
new file mode 100755
index 000000000..902a1db0a
--- /dev/null
+++ b/45/CH12/EX12.9/example_12_9.sce
@@ -0,0 +1,8 @@
+//Example 12.9
+clc;
+clear
+resol = 1/512 * 100 ; // calculating resol
+vol_resol = 1/512 *5 *1000;
+printf("Resoluition in percentage = %f",resol);
+
+printf("\n\n Voltage resolution = %f mV",vol_resol);
diff --git a/45/CH13/EX13.2/example_13_2.sce b/45/CH13/EX13.2/example_13_2.sce
new file mode 100755
index 000000000..ac35a177c
--- /dev/null
+++ b/45/CH13/EX13.2/example_13_2.sce
@@ -0,0 +1,10 @@
+//example 13.2
+clc;
+clear;
+close;
+//cp = input('enter the capacity of the memory system in bits :');
+cp=1024; // given capacity
+n= log2(cp);
+printf('The no of bits in the address word are : %d\n',n);
+printf('The number of required rows are : %d\n',2^(n/2));
+printf('The number of required columns are : %d',2^(n/2));
diff --git a/45/CH13/EX13.3/example_13_3.sce b/45/CH13/EX13.3/example_13_3.sce
new file mode 100755
index 000000000..2c73709c0
--- /dev/null
+++ b/45/CH13/EX13.3/example_13_3.sce
@@ -0,0 +1,12 @@
+//example 13.3
+clc
+clear
+//bin(1,1) = input('Enter the first half string of binary number :');
+//bin(1,2) = input('Enter the second half string of binary number :');
+bin=['10110' '01101']; // given binry address
+dec=bin2dec(bin); // finding decimal equivlent
+hex=dec2hex(dec); //findin hexdecimal equivalent
+disp('The decimal address is :');
+disp(dec);
+disp('The hexadecimal address is :');
+disp(hex);
diff --git a/45/CH14/EX14.1/example_14_1.sce b/45/CH14/EX14.1/example_14_1.sce
new file mode 100755
index 000000000..d3ef4d094
--- /dev/null
+++ b/45/CH14/EX14.1/example_14_1.sce
@@ -0,0 +1,18 @@
+//example 14.1
+clc;
+clear;
+close;
+vdc = input('Enter the value of DC voltage Vdc in volts :');
+r = input('Enter the value of resistace in K ohms :');
+v = input(' Enter the value of voltage across diode in volts :');
+
+i = (vdc-v)/r ;
+format('v',4);
+if(i>0) // checking whether the diode is forward or reverse biased by checking current
+ disp('The diode is in forward bias');
+ disp('The diode current in mA is :');
+ disp(i);
+else
+ disp('The diode is in Reverse bias');
+ disp('The diode current in mA is : 0.0');
+end; \ No newline at end of file
diff --git a/45/CH14/EX14.2/example_14_2.sce b/45/CH14/EX14.2/example_14_2.sce
new file mode 100755
index 000000000..3535efbe8
--- /dev/null
+++ b/45/CH14/EX14.2/example_14_2.sce
@@ -0,0 +1,11 @@
+//example 14.2
+clc;
+clear;
+close;
+vdc = input('Enter the value of DC voltage Vdc in volts :');
+r = input('Enter the value of resistace in K ohms :');
+//v = input(' Enter the value of voltage across diode in volts:');
+v= 1.6;
+i = (vdc-v)/r ; /// calculating the current
+ disp('The diode current in mA is :');
+ disp(i);
diff --git a/45/CH14/EX14.3/example_14_3.sce b/45/CH14/EX14.3/example_14_3.sce
new file mode 100755
index 000000000..0fdab6408
--- /dev/null
+++ b/45/CH14/EX14.3/example_14_3.sce
@@ -0,0 +1,22 @@
+//example 14.3
+clc;
+clear;
+close;
+v1 = input('Enter the value of V1 in volts :'); // taking the inpt voltage
+disp('CASE - a');// case a
+if (v1==0) then
+ disp('V2 = 5 V');
+ disp('I = 0 mA');
+ else
+ disp('V2 = 0 V')
+ disp('I = 5 mA ')
+end
+disp('CASE - b'); // case b
+if (v1==0) then
+ disp('V2 = 5 V')
+ disp('I = 5 mA' )
+else
+ disp('V2 = 0 V');
+ disp('I = 0 mA');
+
+end
diff --git a/45/CH14/EX14.4/example_14_4.sce b/45/CH14/EX14.4/example_14_4.sce
new file mode 100755
index 000000000..bc824cc43
--- /dev/null
+++ b/45/CH14/EX14.4/example_14_4.sce
@@ -0,0 +1,11 @@
+//example 14.4
+clc;
+clear;
+v1 = input('Enter the value of V1 in volts :'); //part a : v1 =0 ; part b : v1 =5v
+if (v1==0) then // checking for V1
+ disp('V2 = 5 V');
+ disp('I = 0 mA');
+ else
+ disp('V2 = 0 V');
+ disp('I = 0.5 mA ');
+end
diff --git a/45/CH15/EX15.1/example_15_1.sce b/45/CH15/EX15.1/example_15_1.sce
new file mode 100755
index 000000000..6344f56e6
--- /dev/null
+++ b/45/CH15/EX15.1/example_15_1.sce
@@ -0,0 +1,17 @@
+//example 15.1
+//timing for a six digit display
+clc;
+clear;
+//f=input('Enter the repetition rate in Hz :');
+//d= input('Enter the length of display :');
+f=125; // given inputs
+d=6;
+format('v',5); //changing the precision of the calculation
+k=1000/f;
+l=1000/(f*d);//making neccesary calculations
+m=k-l;
+printf('All digits must be serviced once every %f milliseconds \n',k);
+printf('Each digit will be ON for : %f milliseconds\n',l) ;
+printf('and OFF for : %f milliseconds',m); //displaying results
+
+
diff --git a/45/CH15/EX15.10/example_15_10.sce b/45/CH15/EX15.10/example_15_10.sce
new file mode 100755
index 000000000..beb2c0fba
--- /dev/null
+++ b/45/CH15/EX15.10/example_15_10.sce
@@ -0,0 +1,12 @@
+//example 15.10
+clc;
+clear;
+//v = input('Enter the reference voltage in volts :');
+//an = input('Enter the analog input voltage in volts :');
+v=2; // taking given input
+an=1.25;
+count = 2000*an/v ;
+count = round(count);
+printf('The ccount held in the counter for given analog input will be : %f',count);
+d= an/v;
+printf('\nThe duty cycle is : %f',d);
diff --git a/45/CH15/EX15.11/example_15_11.sce b/45/CH15/EX15.11/example_15_11.sce
new file mode 100755
index 000000000..038a563d3
--- /dev/null
+++ b/45/CH15/EX15.11/example_15_11.sce
@@ -0,0 +1,4 @@
+// example 15.11
+clc;
+clear;
+disp('The full scale count for ADC3511 is 1999 and for the ADC3711 is 3999. So, the largest value possible for the MSD in either case is 3 = 0011. clearly the MSB is not needed for th magnitue of the MSD. It is thus convenient to specif positive number when this bit is a 0 and a negtive number when this bit is a 1 .');
diff --git a/45/CH15/EX15.12/example_15_12.sce b/45/CH15/EX15.12/example_15_12.sce
new file mode 100755
index 000000000..e2eefb66f
--- /dev/null
+++ b/45/CH15/EX15.12/example_15_12.sce
@@ -0,0 +1,4 @@
+//exmple 15.12
+clc ;
+clear;
+disp('These two components establish the internal oscillator frequency used as the clock frequency in the cnverter according to the relationship fi=0.6/RC. In this case fi=320 kHz.'); \ No newline at end of file
diff --git a/45/CH15/EX15.4/example_15_4.sce b/45/CH15/EX15.4/example_15_4.sce
new file mode 100755
index 000000000..632a0589c
--- /dev/null
+++ b/45/CH15/EX15.4/example_15_4.sce
@@ -0,0 +1,22 @@
+//example 15.4
+clc;
+clear;
+//f=input('Enter the input square wave signal frequency in kHz:');
+//t=input('Enter the gate enble time in seconds ' );
+//first part :
+f=7.50;
+t=0.1;
+format('v',18);
+m=t*f*1000; //making neccesary calculations
+printf('For t = %f seconds\n',t); // displaying results
+printf('The counter will count up to : %f\n',m);
+//part2
+t=1;
+printf('\n\nFor t = %f seconds\n',t);
+m=t*f*1000;
+printf('The counter will count up to : %f\n',m);
+//part3
+t=10;
+m=t*f*1000;
+printf('\n\nFor t = %f seconds\n',t);
+printf('The counter will count up to : %f\n',m);
diff --git a/45/CH15/EX15.5/example_15_5.sce b/45/CH15/EX15.5/example_15_5.sce
new file mode 100755
index 000000000..150084040
--- /dev/null
+++ b/45/CH15/EX15.5/example_15_5.sce
@@ -0,0 +1,3 @@
+//example 15.5
+clc;
+disp('Assuming the counter began at 0000, the display would read 200 at the end of the first measurment period.It will read 400,then 600 and so on at the end of succeeding periods. This is because the counter capacity is exceeded each time, and it simply recycles through 0000.');
diff --git a/45/CH15/EX15.6/example_15_6.sce b/45/CH15/EX15.6/example_15_6.sce
new file mode 100755
index 000000000..d4288d07f
--- /dev/null
+++ b/45/CH15/EX15.6/example_15_6.sce
@@ -0,0 +1,15 @@
+//example 15.6
+clc;
+clear;
+//s= input('Enter the clk freqency in kHz : ');
+//f=input('Enter the frequency of the unknown input in Hz :');
+s=100;// taking the inputs
+f=200;
+g=1000000/f; // making neccesary calculations
+c=g*s/1000;
+c=round(c);
+p=c*1000/s;
+disp('Assuming that the conter and the display are initially at 00000');//displaying results
+printf('Enable gate time in micro secnds will be : %d\n',g);
+printf('During the gate time the counter will be advced by (number of counts ) %d \n',c);
+printf('The time period of the unknown input in micro-seconds is : %d',p);
diff --git a/45/CH15/EX15.9/example_15_9.sce b/45/CH15/EX15.9/example_15_9.sce
new file mode 100755
index 000000000..128413430
--- /dev/null
+++ b/45/CH15/EX15.9/example_15_9.sce
@@ -0,0 +1,19 @@
+//example 15.9
+clc ;
+clear;
+//part (a)
+//an=input('Enter the analog input in volts :');
+format('v',12);// changing the precision of calculation
+an=2.5;
+k=an*1000/19.53;
+k= round(k);
+m=dec2bin(k); // converting from decmal to binary
+printf('The digital output is :%s\n',m);
+//part(b)
+//dg=input('Enter the digital output as a string:');
+dg='00100010';
+f=bin2dec(dg); // converting binary to decimal
+y=f*19.53*10^-3;
+printf(' The analog input in volts is :%f',y);
+
+
diff --git a/45/CH16/EX16.1/example_16_1.sce b/45/CH16/EX16.1/example_16_1.sce
new file mode 100755
index 000000000..24044d68f
--- /dev/null
+++ b/45/CH16/EX16.1/example_16_1.sce
@@ -0,0 +1,17 @@
+//example 16.1
+clc
+clear
+//len = input('Enter the length of each memory location in bits :');
+//op = input('Enter the length of Opcode:');
+len =16;
+op=4;
+nop= 2^4; // calculating
+nab = len-op;
+memloc = 2^nab;
+memsize = memloc*16;
+mem=memsize/1024;
+printf('(a)Maximum Number of Opcodes = %d \n',nop); // displaying
+printf(' (b)Size of memory in Kilo bits = %d \n',mem);
+printf(' (c)Size of PC and MAR = %d \n',nab );
+printf(' Size of IR = %d\n',op);
+printf(' Size of ACC and MDR = %d \n',len); \ No newline at end of file
diff --git a/45/CH16/EX16.6/example_16_6.sce b/45/CH16/EX16.6/example_16_6.sce
new file mode 100755
index 000000000..9b90c1c7d
--- /dev/null
+++ b/45/CH16/EX16.6/example_16_6.sce
@@ -0,0 +1,11 @@
+//example 16.6
+lda= input('Enter the number of LDA instructions :'); // accepting the input from the user
+add= input('Enter the number of ADD instructions :');
+sub= input('Enter the number of SUB instructions :');
+sta= input('Enter the number of STA instructions :');
+shl= input('Enter the number of SHL instructions :');
+hlt= input('Enter the number of HLT instructions :');
+k= lda+add+sub+sta;
+l=shl+hlt;
+c= k*5 + l*4; // calculating the total no.of clck cycles required
+printf('Total clock cycles required to execute are = %d ',c); //displaying result. \ No newline at end of file
diff --git a/45/CH2/EX2.1/2_1.jpg b/45/CH2/EX2.1/2_1.jpg
new file mode 100755
index 000000000..29b6388dd
--- /dev/null
+++ b/45/CH2/EX2.1/2_1.jpg
Binary files differ
diff --git a/45/CH2/EX2.1/example_2_1.sce b/45/CH2/EX2.1/example_2_1.sce
new file mode 100755
index 000000000..664675c3d
--- /dev/null
+++ b/45/CH2/EX2.1/example_2_1.sce
@@ -0,0 +1,40 @@
+//exmaple 2.1
+//7404
+clc
+close
+clear
+//frq= input('Enter the square wave frequency in KHz :');
+frq=1 ;// frequency in KHz
+t=(1/frq)*100;
+t=round(t)
+for r=1:t*10
+ inputc(r)=0;
+ outputc(r)=0;
+end
+p=1;
+while p<t*10 // making arrays to plot the curve
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ inputc(p+k)=0;
+ outputc(p+k)=1;
+ end
+ p=p+t/2;
+ else
+ inputc(p)=1;
+ outputc(p)=0;
+ p=p+1;
+ end
+end
+y=[3 3];
+subplot(2,1,1) //ploting the curves
+title('input at pin 1')
+xlabel('Time X 10^-5 seconds');
+ylabel('Magnitude')
+plot(inputc)
+plot(y)
+subplot(2,1,2)
+title('output at pin 2')
+xlabel('Time X 10^-5 seconds');
+ylabel('Magnitude')
+plot(outputc)
+plot(y) \ No newline at end of file
diff --git a/45/CH2/EX2.10/example_2_10.sce b/45/CH2/EX2.10/example_2_10.sce
new file mode 100755
index 000000000..a998a05a1
--- /dev/null
+++ b/45/CH2/EX2.10/example_2_10.sce
@@ -0,0 +1,22 @@
+// exmple 2.10
+clc
+clear
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16
+ x=bitor(a(i),b(i));
+ y=bitor(c(i),d(i));
+ r(i)=bitand(x,y);
+end
+disp('Truth table :');
+disp(' A B C D Y')
+for i = 1 : 16 //displaying truth table
+ Y(i,1)=a(i);
+ Y(i,2)=b(i);
+ Y(i,3)=c(i);
+ Y(i,4)=d(i);
+ Y(i,5)=r(i);
+ end
+disp(Y);
diff --git a/45/CH2/EX2.11/2_11.jpg b/45/CH2/EX2.11/2_11.jpg
new file mode 100755
index 000000000..911a8d20e
--- /dev/null
+++ b/45/CH2/EX2.11/2_11.jpg
Binary files differ
diff --git a/45/CH2/EX2.11/example_2_11.sce b/45/CH2/EX2.11/example_2_11.sce
new file mode 100755
index 000000000..cd85ad755
--- /dev/null
+++ b/45/CH2/EX2.11/example_2_11.sce
@@ -0,0 +1,99 @@
+// exmple 2.11
+clc
+clear
+close
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16
+ x=bitor(a(i),b(i));
+ y=bitor(c(i),d(i));
+ r(i)=bitand(x,y);
+end
+Y=r
+ap=1;
+bp=1;
+cp=1;
+dp=1;Yp=1;
+for i=1:16 //Making array to plot the timing diagram
+ if a(i)==1 then
+ for o=1:100
+ a1(ap)=1;
+ ap=ap+1;
+ end
+ else
+ for o=1:100
+ a1(ap)=0;
+ ap=ap+1;
+ end
+end
+if b(i)==1 then
+ for o=1:100
+ b1(bp)=1;
+ bp=bp+1;
+ end
+ else
+ for o=1:100
+ b1(bp)=0;
+ bp=bp+1;
+ end
+
+end
+if c(i)==1 then
+ for o=1:100
+ c1(cp)=1;
+ cp=cp+1;
+ end
+ else
+ for o=1:100
+ c1(cp)=0;
+ cp=cp+1;
+ end
+end
+if d(i)==1 then
+ for o=1:100
+ d1(dp)=1;
+ dp=dp+1;
+ end
+ else
+ for o=1:100
+ d1(dp)=0;
+ dp=dp+1;
+ end
+ end
+if Y(i)==1 then
+ for o=1:100
+ Y1(Yp)=1;
+ Yp=Yp+1;
+ end
+ else
+ for o=1:100
+ Y1(Yp)=0;
+ Yp=Yp+1;
+ end
+ end
+end
+z=[2 2];
+subplot(5,1,1); //plotting timing diagram
+title('Timing Diagrm');
+plot(z);
+plot(a1);
+ylabel('A');
+subplot(5,1,2);
+plot(z);
+ylabel('B');
+plot(b1);
+subplot(5,1,3);
+plot(z);
+ylabel('C');
+plot(c1);
+subplot(5,1,4);
+plot(z);
+ylabel('D');
+plot(d1);
+subplot(5,1,5);
+plot(z);
+ylabel('Y');
+xlabel('Time in milli seconds');
+plot(Y1); \ No newline at end of file
diff --git a/45/CH2/EX2.12/example_2_12.sce b/45/CH2/EX2.12/example_2_12.sce
new file mode 100755
index 000000000..276bbd6e2
--- /dev/null
+++ b/45/CH2/EX2.12/example_2_12.sce
@@ -0,0 +1,23 @@
+//Example 2.12
+clc
+clear
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16 // finding Y and y1 for all possible inpt cases
+ x=bitand(a(i),b(i));
+ y=bitand(c(i),d(i));
+ r(i)=bitor(x,y);
+ x1=bitcmp(x,1);
+ y1=bitcmp(y,1);
+ z=bitand(x1,y1);
+ r1(i)=bitcmp(z,1);
+end
+disp(' Y Y1');
+for i = 1 : 16 // displaying result
+ Y(i,1)=r(i);
+ Y(i,2)=r1(i);
+ end
+disp(Y);
+disp('Both are logically equivalent');
diff --git a/45/CH2/EX2.13/example_2_13.sce b/45/CH2/EX2.13/example_2_13.sce
new file mode 100755
index 000000000..518f63305
--- /dev/null
+++ b/45/CH2/EX2.13/example_2_13.sce
@@ -0,0 +1,24 @@
+// exmple 2.13
+//NAND - NAND
+clc
+clear
+close
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16
+ x=bitand(a(i),b(i));
+ y=bitand(c(i),d(i));
+ r(i)=bitor(x,y);
+end
+disp('Truth table :');
+disp(' A B C D Y')
+for i = 1 : 16 // displaying the truth table
+ Y(i,1)=a(i);
+ Y(i,2)=b(i);
+ Y(i,3)=c(i);
+ Y(i,4)=d(i);
+ Y(i,5)=r(i);
+end
+disp(Y); \ No newline at end of file
diff --git a/45/CH2/EX2.14/2_14.jpg b/45/CH2/EX2.14/2_14.jpg
new file mode 100755
index 000000000..4b22b1f6f
--- /dev/null
+++ b/45/CH2/EX2.14/2_14.jpg
Binary files differ
diff --git a/45/CH2/EX2.14/example_2_14.sce b/45/CH2/EX2.14/example_2_14.sce
new file mode 100755
index 000000000..e089acb69
--- /dev/null
+++ b/45/CH2/EX2.14/example_2_14.sce
@@ -0,0 +1,106 @@
+// exmple 2.14
+clc
+clear
+close
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16
+ x=bitand(a(i),b(i));
+ y=bitand(c(i),d(i));
+ r(i)=bitor(x,y);
+end
+Y=r
+ap=1;
+bp=1;
+cp=1;
+dp=1;Yp=1;
+for i=1:16 //Making arrays to plot the timing diagram
+ if a(i)==1 then
+ for o=1:100
+ a1(ap)=1;
+ ap=ap+1;
+ end
+ else
+ for o=1:100
+ a1(ap)=0;
+ ap=ap+1;
+ end
+
+end
+if b(i)==1 then
+ for o=1:100
+ b1(bp)=1;
+ bp=bp+1;
+ //z(bp)=3
+ end
+ else
+ for o=1:100
+ b1(bp)=0;
+ bp=bp+1;
+ //z(bp)=3
+ end
+
+end
+if c(i)==1 then
+ for o=1:100
+ c1(cp)=1;
+ cp=cp+1;
+ end
+ else
+ for o=1:100
+ c1(cp)=0;
+ cp=cp+1;
+ end
+
+end
+if d(i)==1 then
+ for o=1:100
+ d1(dp)=1;
+ dp=dp+1;
+ end
+ else
+ for o=1:100
+ d1(dp)=0;
+ dp=dp+1;
+ end
+
+ end
+if Y(i)==1 then
+ for o=1:100
+ Y1(Yp)=1;
+ Yp=Yp+1;
+ end
+ else
+ for o=1:100
+ Y1(Yp)=0;
+ Yp=Yp+1;
+ end
+
+ end
+
+end
+z=[2 2];
+subplot(5,1,1); //plotting timing diagram
+title('Timing Diagrm');
+plot(z);
+plot(a1);
+ylabel('A');
+subplot(5,1,2);
+plot(z);
+ylabel('B');
+plot(b1);
+subplot(5,1,3);
+plot(z);
+ylabel('C');
+plot(c1);
+subplot(5,1,4);
+plot(z);
+ylabel('D');
+plot(d1);
+subplot(5,1,5);
+plot(z);
+ylabel('Y');
+xlabel('Time in milli seconds');
+plot(Y1);
diff --git a/45/CH2/EX2.15/example_2_15.sce b/45/CH2/EX2.15/example_2_15.sce
new file mode 100755
index 000000000..2fd06a11c
--- /dev/null
+++ b/45/CH2/EX2.15/example_2_15.sce
@@ -0,0 +1,23 @@
+//example 2.15
+clc
+clear
+s=0; // s from the register
+s(1)=input('Enter the value at S0 :')
+s(2)=input('Enter the value at S1 :')
+s(3)=input('Enter the value at S2 :')
+s(4)=input('Enter the value at S3 :')
+s(5)=input('Enter the value at S4 :')
+s(6)=input('Enter the value at S5 :')
+s(7)=input('Enter the value at S6 :')
+s(8)=input('Enter the value at S7 :')
+count =0;
+for i =1 :8 //loop to detect a '1'
+ if s(i)==1 then
+ disp('ZERO is LOW');
+ break;
+ end
+ count =count+1;
+end
+if count==8 then
+ disp('ZERO is HIGH');
+end; \ No newline at end of file
diff --git a/45/CH2/EX2.2/2_2.jpg b/45/CH2/EX2.2/2_2.jpg
new file mode 100755
index 000000000..26f788c09
--- /dev/null
+++ b/45/CH2/EX2.2/2_2.jpg
Binary files differ
diff --git a/45/CH2/EX2.2/example_2_2.sce b/45/CH2/EX2.2/example_2_2.sce
new file mode 100755
index 000000000..e438dfc46
--- /dev/null
+++ b/45/CH2/EX2.2/example_2_2.sce
@@ -0,0 +1,40 @@
+//exmaple 2.2
+//7404
+clc
+close
+clear
+//frq= input('Enter the square wave frequency in KHz :');
+frq=0.5 ;//KHz
+t=(1/frq)*100;
+t=round(t)
+for r=1:t*10
+ inputc(r)=0;
+ outputc(r)=0;
+end
+p=1;
+while p<t*10 // making arrays t plot the curve
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ inputc(p+k)=0;
+ outputc(p+k)=1;
+ end
+ p=p+t/2;
+ else
+ inputc(p)=1;
+ outputc(p)=0;
+ p=p+1;
+ end
+end
+y=[3 3];
+subplot(2,1,1) //ploting the graphs
+title('input at pin 1')
+xlabel('Time X 10^-5 seconds');
+ylabel('Magnitude')
+plot(inputc)
+plot(y)
+subplot(2,1,2)
+title('output at pin 2')
+xlabel('Time X 10^-5 seconds');
+ylabel('Magnitude')
+plot(outputc)
+plot(y) \ No newline at end of file
diff --git a/45/CH2/EX2.3/example_2_3.sce b/45/CH2/EX2.3/example_2_3.sce
new file mode 100755
index 000000000..b98eb2309
--- /dev/null
+++ b/45/CH2/EX2.3/example_2_3.sce
@@ -0,0 +1,17 @@
+// exmple 2.3
+clc
+clear
+close
+a=[0 0 1 1];
+b=[0 1 0 1];
+for i=1:4
+ r(i)= bitor(bitcmp(a(i),1), bitcmp(b(i),1)) // given expression
+end
+disp(' A B Y')
+for i = 1 : 4
+ Y(i,1)=a(i);
+ Y(i,2)=b(i);
+ Y(i,3)=r(i);
+ end
+disp(Y); //displaying truth table
+disp('''1'' represents a HIGH(H) and ''0'' represents a LOW(L)') \ No newline at end of file
diff --git a/45/CH2/EX2.4/example_2_4.sce b/45/CH2/EX2.4/example_2_4.sce
new file mode 100755
index 000000000..1db20ba81
--- /dev/null
+++ b/45/CH2/EX2.4/example_2_4.sce
@@ -0,0 +1,16 @@
+// exmple 2.4
+clear
+clc
+a=[0 0 1 1];
+b=[0 1 0 1];
+for i=1:4
+ r(i)= bitand(bitcmp(a(i),1), bitcmp(b(i),1)) //given expression
+end
+disp(' A B Y')
+for i = 1 : 4
+ Y(i,1)=a(i);
+ Y(i,2)=b(i);
+ Y(i,3)=r(i);
+ end
+disp(Y); //displaying truth table
+disp('''1'' represents a HIGH(H) and ''0'' represents a LOW(L)') \ No newline at end of file
diff --git a/45/CH2/EX2.9/example_2_9.sce b/45/CH2/EX2.9/example_2_9.sce
new file mode 100755
index 000000000..eb481f16d
--- /dev/null
+++ b/45/CH2/EX2.9/example_2_9.sce
@@ -0,0 +1,24 @@
+//Example 2.9
+clc
+clear
+close
+a=[0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1];
+b=[0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1];
+c=[0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1];
+d=[0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1];
+for i=1:16 // finding Y for all 16 cases
+ x=bitor(a(i),b(i));
+ y=bitor(c(i),d(i));
+ r(i)=bitand(x,y);
+ x1=bitcmp(x,1);
+ y1=bitcmp(y,1);
+ z=bitor(x1,y1);
+ r1(i)=bitcmp(z,1);
+end
+disp(' Y Y1');
+for i = 1 : 16
+ Y(i,1)=r1(i);
+ Y(i,2)=r(i);
+ end
+disp(Y); //displaying result
+disp('Both are logically equivalent');
diff --git a/45/CH3/EX3.1/example_3_1.sce b/45/CH3/EX3.1/example_3_1.sce
new file mode 100755
index 000000000..7192354a3
--- /dev/null
+++ b/45/CH3/EX3.1/example_3_1.sce
@@ -0,0 +1,7 @@
+//example 3.1
+clc;
+clear;
+disp("we can minimize the given equation as:");
+disp('Y = AB'' + AB = A(B'' + B)');
+disp('Therefore, Y = A(1) = A');
+disp('this says that output Y equals to A, so all we hve to do is connect a wire between input A and output Y.'); \ No newline at end of file
diff --git a/45/CH3/EX3.10/example_3_10.sce b/45/CH3/EX3.10/example_3_10.sce
new file mode 100755
index 000000000..2e227ef5f
--- /dev/null
+++ b/45/CH3/EX3.10/example_3_10.sce
@@ -0,0 +1,9 @@
+//example 3.10
+// this program needs kmappos.sci and noof.sci
+
+k=[0 0 0 0;0 0 0 1; 1 1 1 1;1 1 1 1];
+disp("The minimal expression of Y from the following Kmap is :');
+kmap(k);
+disp('After complimenting and simplifying the Krarnugh map we get Y =:');
+k=[1 1 1 1;1 1 1 0; 0 0 0 0;0 0 0 0 ];
+kmap(k); //calling the Kmap function \ No newline at end of file
diff --git a/45/CH3/EX3.11/example_3_11.sce b/45/CH3/EX3.11/example_3_11.sce
new file mode 100755
index 000000000..f59fa1cd8
--- /dev/null
+++ b/45/CH3/EX3.11/example_3_11.sce
@@ -0,0 +1,14 @@
+//example 3.11
+// this program needs kmappos.sci and noof.sci
+
+clc
+disp('The given kmap is '); //displaying the given kmap
+disp(' C''D'' C''D CD CD''');
+disp('A''B'' 0 0 0 0');
+disp('A''B 0 0 0 1');
+disp('AB 1 1 1 1');
+disp('AB'' 1 1 1 1');
+disp("The simplest POS form of following Kmap is :');
+
+k= [0 0 0 0;0 0 0 1 ;1 1 1 1; 1 1 1 1];
+kmappos(k);//calling the Kmappos function
diff --git a/45/CH3/EX3.12/example_3_12.sce b/45/CH3/EX3.12/example_3_12.sce
new file mode 100755
index 000000000..db573a883
--- /dev/null
+++ b/45/CH3/EX3.12/example_3_12.sce
@@ -0,0 +1,13 @@
+//example 3.12
+clc
+disp('The given kmap is '); //displaying the given kmap
+disp(' C''D'' C''D CD CD''');
+disp('A''B'' 0 0 1 0');
+disp('A''B 0 0 1 1');
+disp('AB x x x 1');
+disp('AB'' x x x 0');
+disp('In a Karnaugh map if don''t care condition exits, we may consider them as zeros if that gives a larger group size.');
+disp("The simplest POS form of following Kmap is :');
+
+k= [0 0 1 0;0 0 1 1 ;0 0 1 1; 0 0 1 0];
+kmappos(k); //calling the Kmappos function
diff --git a/45/CH3/EX3.13/example_3_13.sce b/45/CH3/EX3.13/example_3_13.sce
new file mode 100755
index 000000000..7b2d4423b
--- /dev/null
+++ b/45/CH3/EX3.13/example_3_13.sce
@@ -0,0 +1,126 @@
+//example 3.1
+clc;
+clear;
+a=[0 0 0 0 1 1 1 1;0 0 1 1 0 0 1 1;0 1 0 1 0 1 0 1]; //from the truth table given
+y=[0 0 1 0 0 0 1 1];
+j=1;
+for i=1:8 // finding for which input conditions the output is high
+ if y(i) == 1 then
+ x(j,:)= [a(1,i) a(2,i) a(3,i)];
+ j=j+1;
+ end
+end
+for i=1:j-1; // finding the first stage
+ f(i)=0;
+ c=0;
+ for m=3:-1:1
+ f(i) = f(i) + x(i,m)*(2^c);
+ c=c+1;
+end
+end
+disp('stage 1'); //displaying first stage
+x(:,4)=f;
+disp(' A B C');
+disp(x)
+count=zeros(j-2,j-2)
+pos=count;
+for i=1:j-2 // for second stage comparing with each other
+ for k=1:j-i-1
+ for m=1:3
+ if x(i,m)==x(i+k,m) then
+ count(i,k)=count(i,k)+1;
+ else
+ pos(i,k)=m
+ end
+ end
+end
+end
+r=1;
+for i=1:j-2 //making a list of second stage elements
+ for m=1:j-2
+ if count(i,m)==2 then
+ posi(r) = pos(i,m);
+ sest(r,1) = x(i,4);
+ sest(r,2) = x(i+m,4);
+ r=r+1;
+ end
+ end
+end
+disp('stage 2'); //displaying second stage
+disp(sest);
+o=size(sest);
+fin(1)=sest(1,1);
+fin(2)=sest(1,2);
+p=3;
+for i=2:o(1,1) //removing redundancy in second stage
+ t=0;
+ ts=0;
+ for w=1:p-1
+ if fin(w)== sest(i,1) then
+ t=30;
+ end;
+ if fin(w) == sest(i,2) then
+ ts=40;
+ end
+ end
+ if t==0 then
+ fin(p)=sest(i,1);
+ finn(p-2)=i;
+ p=p+1;
+ end
+ if ts==0 then
+ fin(p)=sest(i,2)
+ finn(p-2)=i;
+ p=p+1;
+ end
+end
+ppp=size(finn) //selecting the prime implicants
+l=1
+fina(l)= finn(l);
+for i=2:ppp(1,1)
+ q=0;
+ for b=1:l
+ if fina(b) == finn(i) then
+ q=89 ;
+ end
+ end
+ if q==0 then
+ fina(l+1)=finn(i);
+ l=l+1;
+ q=0;
+ end
+end
+kkk=size(fina);
+i=1;
+jj=0;
+bi(1)=' ';
+x(i)
+po=1;
+for k=1:kkk(1,1)+1
+for p=1:3 //appending a string to make the expression
+ if p ~= posi(i) then
+ if p == 1 & x(i,p)==1 then
+ bi(po)=strcat([bi(po) 'A']);
+ elseif p== 1 &x(i,p)==0 then
+ bi(po)=strcat([bi(po) 'A''']);
+ end
+ if p == 2 & x(i,p)==1 then
+ bi(po)=strcat([bi(po) 'B']);
+ elseif p== 2 &x(i,p)==0 then
+ bi(po)=strcat([bi(po) 'B''']);
+ end
+ if p == 3 & x(i,p)==1 then
+ bi(po)=strcat([bi(po) 'C']);
+ elseif p== 3 &x(i,p)==0 then
+ bi(po)=strcat([bi(po) 'C''']);
+ end
+ end
+end
+jj=jj+1;
+if jj<=kkk(1,1) then
+i=fina(jj);
+bi(po)=strcat([bi(po) ' + ']);
+end
+end;
+disp('The minimised expression is ');
+disp(bi); \ No newline at end of file
diff --git a/45/CH3/EX3.14/3_14.jpg b/45/CH3/EX3.14/3_14.jpg
new file mode 100755
index 000000000..ce6cf7028
--- /dev/null
+++ b/45/CH3/EX3.14/3_14.jpg
Binary files differ
diff --git a/45/CH3/EX3.14/example_3_14.sce b/45/CH3/EX3.14/example_3_14.sce
new file mode 100755
index 000000000..b4e44dd02
--- /dev/null
+++ b/45/CH3/EX3.14/example_3_14.sce
@@ -0,0 +1,136 @@
+//example 3.9
+clc;
+clear;
+close;
+c = [1 1 0 0 0 0 0]; //given values
+a= [1 1 1 1 1 1 1];
+b= [1 1 1 1 1 1 1] ;
+for i=1:7
+ y1(i)=0
+ y2(i)=1
+ y3(i)=0
+ y4(i)=1
+ y(i)=0
+end
+for(i=1: 7) // finding the Y values for next clock periods
+y1(i+1) = bitcmp(c(i),1);
+y2(i+1) = bitand(a(i),c(i));
+end;
+for i=1: 5
+y3(i+2) = bitand(y1(i+1),b(i));
+end;
+for i=1:4
+y4(i+3) = bitor(y3(i+2),y2(i+2));
+end;
+for i=1:3
+y(i+4) = bitand(y4(i+3),y1(i+3));
+end;
+y11p=1;
+y22p=1;
+y33p=1;
+y44p=1;
+cp=1;
+yf1p=1;
+for i=1:7 // ploting all of them in to graph
+ if y1(i)==1 then
+ for o=1:100
+ y11(y11p)=1;
+ y11p=y11p+1;
+ end
+ else
+ for o=1:100
+ y11(y11p)=0;
+ y11p=y11p+1;
+ end
+end
+if y2(i)==1 then
+ for o=1:100
+ y21(y22p)=1;
+ y22p=y22p+1;
+ //z(bp)=3
+ end
+ else
+ for o=1:100
+ y21(y22p)=0;
+ y22p=y22p+1;
+ //z(bp)=3
+ end
+end
+if y3(i)==1 then
+ for o=1:100
+ y31(y33p)=1;
+ y33p=y33p+1;
+ //z(bp)=3
+ end
+ else
+ for o=1:100
+ y31(y33p)=0;
+ y33p=y33p+1;
+ //z(bp)=3
+ end
+end
+if y4(i)==1 then
+ for o=1:100
+ y41(y44p)=1;
+ y44p=y44p+1;
+ //z(bp)=3
+
+ end
+ else
+ for o=1:100
+ y41(y44p)=0;
+ y44p=y44p+1;
+ //z(bp)=3
+ end
+end
+if c(i)==1 then
+ for o=1:100
+ c1(cp)=1;
+ cp=cp+1;
+ end
+ else
+ for o=1:100
+ c1(cp)=0;
+ cp=cp+1;
+ end
+end
+if y(i)==1 then
+ for o=1:100
+ yf1(yf1p)=1;
+ yf1p=yf1p+1;
+ end
+ else
+ for o=1:100
+ yf1(yf1p)=0;
+ yf1p=yf1p+1;
+ end
+ end
+end
+z=[2 2]; //ploting the results
+subplot(6,1,1);
+title('Timing Diagrm');
+plot(c1);
+plot(z);
+ylabel('C');
+subplot(6,1,2);
+plot(y11);
+ylabel('Y1');
+plot(z);
+subplot(6,1,3);
+plot(y21);
+ylabel('Y2');
+plot(z);
+subplot(6,1,4);
+plot(z);
+ylabel('Y3');
+plot(y31);
+subplot(6,1,5);
+plot(z);
+ylabel('Y4');
+xlabel('Time in milli seconds');
+plot(y41);
+subplot(6,1,6);
+plot(z);
+ylabel('Y');
+xlabel('Time in milli seconds');
+plot(yf1);
diff --git a/45/CH3/EX3.2/example_3_2.sce b/45/CH3/EX3.2/example_3_2.sce
new file mode 100755
index 000000000..82994c8e7
--- /dev/null
+++ b/45/CH3/EX3.2/example_3_2.sce
@@ -0,0 +1,11 @@
+//example 3.2
+
+clc;
+clear;
+disp("Multipl the factors of the foregoing equation to get");
+disp('Y = A''A + A''B + BA +BB');
+disp('it becomes, Y = A''B + AB + B ');
+disp('We can factor the foregooing equation as follows :');
+disp('Y = B(A'' + A) + B = B + B = B ');
+disp('this says that output Y equals to B, so all we have to do is connect a wire between input B and output Y.');
+
diff --git a/45/CH3/EX3.3/example_3_3.sce b/45/CH3/EX3.3/example_3_3.sce
new file mode 100755
index 000000000..dc946a74e
--- /dev/null
+++ b/45/CH3/EX3.3/example_3_3.sce
@@ -0,0 +1,30 @@
+//example 3.3
+clc;
+clear;
+//disp(' Enter the inputs for AND gate ');
+//for i=1:7
+//printf("Enter wether the led %d is on or off (1 or 0) :",i);
+//a(i)=input('');
+//end;
+//disp('Enter the inputs for OR gate' )
+//for i=1:7
+//printf("Enter wether the led %d is on or off (1 or 0) :",i);
+//b(i)=input('');
+//end;
+a= [0 1 0 1 1 0 0]; //lights on a logic clip
+b= [0 0 0 0 1 1 0];
+k=bitand(a(1),a(2));
+k2 = bitand(a(4),a(5));
+k3=bitor(b(1),b(2));
+k4 = bitor(b(4),b(5));
+if a(3) ~= k then // checking which gate is faulty
+ disp("The first AND gate is diffective ");
+elseif a(6) ~= k2 then
+ disp("The second AND gate is diffective ");
+ elseif b(3) ~= k3 then
+ disp("The first OR gate is diffective ");
+elseif b(6) ~= k4 then
+ disp("The second OR gate is diffective ");
+ else
+ disp('All the gates are working correctly');
+end \ No newline at end of file
diff --git a/45/CH3/EX3.4/example_3_4.sce b/45/CH3/EX3.4/example_3_4.sce
new file mode 100755
index 000000000..fb0e60847
--- /dev/null
+++ b/45/CH3/EX3.4/example_3_4.sce
@@ -0,0 +1,26 @@
+//example 3.4
+clc;
+clear;
+disp('Given the truth table has high output for following conditons :');
+a=[0 0 0 ; 0 1 0 ; 1 0 0 ; 1 1 0 ] //given iput conditions for which output is high
+disp(a)
+for (i=1:4)
+ 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('When you OR these products you get :') //displaying sum of products
+x=strcat([b(1,1) b(1,2) b(1,3) " + " b(2,1) b(2,2) b(2,3) " + " b(3,1) b(3,2) b(3,3) " + " b(4,1) b(4,2) b(4,3)]);
+disp(x) \ No newline at end of file
diff --git a/45/CH3/EX3.5/example_3_5.sce b/45/CH3/EX3.5/example_3_5.sce
new file mode 100755
index 000000000..be7feb933
--- /dev/null
+++ b/45/CH3/EX3.5/example_3_5.sce
@@ -0,0 +1,13 @@
+//example 3.5
+clc;
+clear;
+disp('The boolean equation is :');
+disp('Y = A''B''C'' + A''BC'' + AB''C'' + ABC''');
+disp('Since C'' is common to each term, factor as follows :');
+disp('Y = (A''B + A''B + AB'' AB)C''');
+disp('Again, factor to get :');
+disp('Y = [A''(B'' + B) + A(B'' + B)]C''');
+disp('Now, simplify the foregoing as follows :');
+disp('Y=[A''(1) + A(1)]C'' = (A'' + A)C''');
+disp(' or Y= C''');
+disp('This final equation means that you don''t even need a logic circuit. All you need is a wire connecting input C'' to output Y.'); \ No newline at end of file
diff --git a/45/CH3/EX3.6/example_3_6.sce b/45/CH3/EX3.6/example_3_6.sce
new file mode 100755
index 000000000..d5f6a7545
--- /dev/null
+++ b/45/CH3/EX3.6/example_3_6.sce
@@ -0,0 +1,8 @@
+//example 3.6
+// this program needs kmap.sci and noof.sci
+ clc
+ Y=[7 9 10 11 12 13 14 15];//given logic equation
+ k=[0 0 0 0;0 0 1 0 ; 1 1 1 1; 0 1 1 1]; // minimizing it using 4-variable kmap
+ disp("The minimal expression of Y from the following Kmap is :');
+ kmap(k); //calling the Kmap function
+ \ No newline at end of file
diff --git a/45/CH3/EX3.7/example_3_7.sce b/45/CH3/EX3.7/example_3_7.sce
new file mode 100755
index 000000000..e50f02bef
--- /dev/null
+++ b/45/CH3/EX3.7/example_3_7.sce
@@ -0,0 +1,13 @@
+//example 3.7
+// this program needs kmap.sci and noof.sci
+clc;
+disp('The kanaurgh map for given truth table will be :');
+disp(' C''D'' C''D CD CD'''); //displaying the given kmap
+disp('A''B'' 1 0 0 0');
+disp('A''B 0 0 0 0');
+disp('AB x x x x');
+disp('AB'' 0 0 x x');
+disp('The truth table has output one only for the input condition 0000. The corresponding fundamental product is A''B''C''D''');
+k=[1 0 0 0 ; 0 0 0 0; 0 0 0 0;0 0 0 0];
+kmap(k);//calling the Kmap function
+
diff --git a/45/CH3/EX3.8/example_3_8.sce b/45/CH3/EX3.8/example_3_8.sce
new file mode 100755
index 000000000..2dd2a34e2
--- /dev/null
+++ b/45/CH3/EX3.8/example_3_8.sce
@@ -0,0 +1,12 @@
+//example 3.8
+// this program needs kmap.sci and noof.sci
+clc;
+disp(' C''D'' C''D CD CD''');//displaying the given kmap
+disp('A''B'' 0 0 0 0');
+disp('A''B 0 0 1 0');
+disp('AB x x x x');
+disp('AB'' 0 0 x x');
+k=[0 0 0 0;0 0 1 0;0 0 1 0;0 0 0 0];
+disp('In a Karnaugh map if don''t care condition exits, we may consider them as ones if that gives a larger group size.');
+disp('The minimal expression from the given kmap is ');
+kmap(k); //calling the kamp function \ No newline at end of file
diff --git a/45/CH3/EX3.9/example_3_9.sce b/45/CH3/EX3.9/example_3_9.sce
new file mode 100755
index 000000000..a281560a9
--- /dev/null
+++ b/45/CH3/EX3.9/example_3_9.sce
@@ -0,0 +1,28 @@
+//example 3.4
+clc;
+clear;
+disp('Given the truth table has high output for following conditons :');
+a=[0 0 0 ; 0 0 1 ; 0 1 0 ] //given truth table
+disp(a)
+
+for (i=1:3) //finding the terms in pos
+ if a(i,1)==0 then
+ b(i,1)= 'A'
+ else
+ b(i,1)= 'A^'
+ end
+ if a(i,2)==0 then
+ b(i,2)= 'B'
+ else
+ b(i,2)= 'B^'
+ end
+ if a(i,3)==0 then
+ b(i,3)= 'C'
+ else
+ b(i,3)= 'C^'
+ end
+end
+disp(b)
+disp('The product-of-sums equation is :') //displaying the POS
+x=strcat(["(" b(1,1) " + " b(1,2) " + " b(1,3) ")" "(" b(2,1) " + " b(2,2) " + " b(2,3) ")" "(" b(3,1) " + " b(3,2) " + " b(3,3) ")" ]);
+disp(x) \ No newline at end of file
diff --git a/45/CH4/EX4.1/exmple_4_1.sce b/45/CH4/EX4.1/exmple_4_1.sce
new file mode 100755
index 000000000..c3bbd9141
--- /dev/null
+++ b/45/CH4/EX4.1/exmple_4_1.sce
@@ -0,0 +1,10 @@
+//example 4.1
+clc;
+clear;
+disp('Logic equation for 2-to-1 Multiplexer :')
+printf(' Y = A''D0 + AD1\n');
+disp('Logic equation for 4-to-1 Multiplexer :')
+printf(' Y = A''B''D0 + A''BD1 + AB''D2 + ABD3\n');
+disp('This can be rewritten as,')
+printf(' Y= A''(B''D0 + BD1) + A(B''D2 + BD3)\n');
+disp('Compare this with equation of 2-to-1 mux. We need two 2-to-1 multiplexer to realize the bracketed terms where B serves as select input. The output of these two multiplexers can be sent to a third multiplexer as data inputs where A serves as select input and we get the 4-to-1 multiplexer.'); \ No newline at end of file
diff --git a/45/CH4/EX4.10/exmple_4_10.sce b/45/CH4/EX4.10/exmple_4_10.sce
new file mode 100755
index 000000000..68697dc2c
--- /dev/null
+++ b/45/CH4/EX4.10/exmple_4_10.sce
@@ -0,0 +1,15 @@
+//example 4.10
+clc;
+clear;
+//sel= input('Enter which is pressed(1 - 9) : ');
+sel=6;
+aa=sel;
+for i=4:-1:1 //converting the sel input to binary notation
+ a(1,i)=modulo(aa,2);
+ b(1,i)=bitcmp(a(1,i),1);
+ aa=aa/2;
+ aa=floor(aa);
+end
+printf('When switch %d is pressed the ABCD output is :',sel);
+disp(b); //displaying the result
+printf(' Which is equivalent to %d when the output is complimented.In the output above a ''0'' represents a LOW and a ''1'' represents a HIGH. ',sel );
diff --git a/45/CH4/EX4.11/exmple_4_11.sce b/45/CH4/EX4.11/exmple_4_11.sce
new file mode 100755
index 000000000..465ba215f
--- /dev/null
+++ b/45/CH4/EX4.11/exmple_4_11.sce
@@ -0,0 +1,45 @@
+//example 4.11
+//uses functions kmap.sci and noof.sci so run them before running this program ..
+clc;
+s=[0 1 1 1 1 ];
+x1=[0 1 0 0 0 ];
+x2=[0 0 1 0 0 ];
+x3=[0 0 0 1 0 ];
+for i=1:5
+ if s(i)==1 then // finding output A and B
+ if x1(i) == 1 then
+ a(i)=0;
+ b(i)=1;
+ elseif x2(i) == 1 then
+ a(i)=1;
+ b(i)=0;
+ elseif x3(i) == 1 then
+ a(i)=1;
+ b(i)=1;
+ else
+ a(i)=0;
+ b(i)=0;
+ end
+else
+ a(i)=0;
+ b(i)=0;
+end
+end
+for i = 1 : 5 //printin the state table
+ Y(i,1)=s(i);
+ Y(i,2)=x1(i);
+ Y(i,3)=x2(i);
+ Y(i,4)=x3(i);
+ Y(i,5)=a(i);
+ Y(i,6)=b(i);
+ end
+disp(' Input Output ');
+disp(' S X1 X2 X3 A B ');
+ disp(Y);
+kmp =[0 0 0 0;0 0 0 1 ;0 0 0 1;0 0 0 1]; //finding minimized expressin using 4-varible kmap
+ disp("The minimal expression of A from the following Kmap is :');
+ kmapsx(kmp);
+ kmp=[0 0 1 0;0 0 1 1 ;0 0 1 0;0 0 1 0]; //finding minimized expressin using 4-varible kmap
+ printf('\n');
+ disp( 'The minimal expression of B from the following Kmap is :')
+ kmapsx(kmp); \ No newline at end of file
diff --git a/45/CH4/EX4.2/exmple_4_2.sce b/45/CH4/EX4.2/exmple_4_2.sce
new file mode 100755
index 000000000..49b8a2827
--- /dev/null
+++ b/45/CH4/EX4.2/exmple_4_2.sce
@@ -0,0 +1,74 @@
+//example 4.2
+clc;
+clear
+a(1,1)=0 // taking input in this form 1 if A, 0if A' and 2 if no A in the term
+a(1,2)=1
+a(1,3)=2
+a(2,1)=2
+a(2,2)=0
+a(2,3)=0
+a(3,1)=1
+a(3,2)=1
+a(3,3)=1
+p=3;
+for i=1:3 // finding the minterms here
+ coun =0;
+ for j=1:3
+ if a(i,j)==2 then
+ coun = coun+1
+ end
+ end
+ if coun == 2 then
+ p=p+3
+ else if coun==1 then
+ p=p+1
+ end
+end
+end
+n=4;
+for m=4:p
+ for l=1:3
+ a(m,l)=0;
+ end
+end
+for i= 1:p
+ for j=1:3
+ if a(i,j) ==2 then
+ for k=1:3
+ a(n,k)=a(i,k)
+ end
+ a(i,j) = 0;
+ a(n,j)=1;
+ n=n+1;
+ end
+ end
+end
+for h=1:p
+ f(h)=0
+ c=2;
+for m=1:3 //finding equivlent decimal values for the minterms
+ f(h)= f(h) + a(h,m)*(2^c);
+ c=c-1;
+end
+end
+disp('The min terms are :') //displaying the min terms
+disp(' A B C')
+disp(a)
+l=1
+o(1,l)= f(l); // removing the repetations in minterms
+for i=2:p
+ q=0;
+ for b=1:l
+ if o(1,b) == f(i) then
+ q=89 ;
+ end
+ end
+ if q==0 then
+ o(1,l+1)=f(i);
+ l=l+1;
+ q=0;
+ end
+end
+disp('The following data lines are to be given ''1'' and remaining should be given ''0'); // displying the decimal equivlent of minterms
+disp(o);
+disp('For a 4-1 mux, we should give D0 =C'',D1 = ''1'',D2 = C'' and D3 = C with A and B as data selector inputs '); \ No newline at end of file
diff --git a/45/CH4/EX4.3/exmple_4_3.sce b/45/CH4/EX4.3/exmple_4_3.sce
new file mode 100755
index 000000000..f42cf998e
--- /dev/null
+++ b/45/CH4/EX4.3/exmple_4_3.sce
@@ -0,0 +1,8 @@
+//example 4.3
+clc;
+clear;
+m(1)=32;//tking the given values
+m(2)=log2(m(1)) // making necessary calculations
+m(3)=m(2)-1;
+m(4)=m(1)/2;
+printf('A %d-to-1 multiplexer requires',m(1));printf(' %d select lines, The lower',m(2));printf(' %d select lines choose',m(3));printf(' %d-to-1 multiplexer outputs. The 2-to-1 multiplexers chooses one of the outpt of two',m(4));printf(' %d-to-1 multiplexers depending on what appears in the',m(4));printf(' %dth select line.', m(2)); //displaying the result \ No newline at end of file
diff --git a/45/CH4/EX4.4/exmple_4_4.sce b/45/CH4/EX4.4/exmple_4_4.sce
new file mode 100755
index 000000000..c3243ff94
--- /dev/null
+++ b/45/CH4/EX4.4/exmple_4_4.sce
@@ -0,0 +1,17 @@
+//example 4.4
+clc;
+clear;
+r= input('Enter the value of R (0 or 1) :'); // accepting the inputs from the user
+t= input('Enter the value of T (0 or 1) :');
+sel = input('Enter the values of ABCD :');
+strb = bitcmp(bitand(r,t),1);
+if strb==0 then // checking whether strobe is high or low
+ if sel ==1100 then
+ y='The two pulses are steered to the Y12 output';
+ else
+ y='The output Y12 remains in the High state';
+ end
+ else
+ y='The output Y12 remains in the High state';
+end
+disp(y) //displaying result \ No newline at end of file
diff --git a/45/CH4/EX4.7/exmple_4_7.sce b/45/CH4/EX4.7/exmple_4_7.sce
new file mode 100755
index 000000000..b69987486
--- /dev/null
+++ b/45/CH4/EX4.7/exmple_4_7.sce
@@ -0,0 +1,10 @@
+//example 4.7
+clc;
+clear;
+n=input('Enter the no.of terms in ur expression :');//accepting input from user
+for i=1:n
+a(1,i)=input('Enter the term (0-9) :');
+end;
+disp ('Since at the decoder output we get all the minterms we use them to get the required boolean functions by giving the output lines numbered ' );
+disp(a); //displying the result
+disp('to a mlti-input OR gate.');
diff --git a/45/CH4/EX4.8/exmple_4_8.sce b/45/CH4/EX4.8/exmple_4_8.sce
new file mode 100755
index 000000000..8fb95509f
--- /dev/null
+++ b/45/CH4/EX4.8/exmple_4_8.sce
@@ -0,0 +1,9 @@
+//example 4.8
+clc;
+clear;
+//r=input('Enter the values of resistance in Kohms :');
+//v=input('Enter the forward voltage drop of LED(in volts) :' );
+r=1//taking the given values for r and v
+v=2
+i=5-v/r; //calculating I
+printf('The current through a LED is : %f mA', i); //displaying I
diff --git a/45/CH4/EX4.9/exmple_4_9.sce b/45/CH4/EX4.9/exmple_4_9.sce
new file mode 100755
index 000000000..8bafd0a6f
--- /dev/null
+++ b/45/CH4/EX4.9/exmple_4_9.sce
@@ -0,0 +1,25 @@
+//example 4.9
+clc;
+clear;
+
+sel = input(' Enter the values of ABCD :');
+a=sel;
+q=1;
+while(a>0) // finding the decimal equivlent
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+f=0;
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+if f >9 then //checking the invalid condition
+ disp('Its a invalid input. Therefore,none of the LEDs is on because all outputs lines are high' );
+else //displaying the LED no if the inputs are valid
+ printf('\n LED %d lights up all. All other LEDs remain off because the other outputs are high.',f);
+end
+
diff --git a/45/CH5/EX5.1/example_5_1.sce b/45/CH5/EX5.1/example_5_1.sce
new file mode 100755
index 000000000..47b0cc281
--- /dev/null
+++ b/45/CH5/EX5.1/example_5_1.sce
@@ -0,0 +1,40 @@
+//Example 5.1
+clc //clears the command window
+clear //clears all the variables
+p=1; //initialising variables
+q=1;
+z=0;
+b=0;
+w=0;
+f=0;
+format('v',18); //increasing the precision to 18 .
+//bin= input ("Enter the binary no to be converted to its decimal equivalent : ") // accepting the binary input from user
+bin=110.001;
+d= modulo(bin,1); //separating the decimal part and the integer part
+d=d*10^10;
+a=floor(bin); //removing the decimal part
+while(a>0) //Loop to take the binary bits of integer in to a matrix
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1 //multipliying the bits of integer with their position values and adding
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+while(d>0) //Loop to take the binary bits of decimal in to a matrix
+ e=modulo(d,2)
+ w(1,p)=e
+ d=d/10;
+ d=floor(d)
+ p=p+1;
+ end
+for n=1:p-1 //multipliying the bits of decimal with their position values and adding
+ z=z+w(1,n)*(0.5)^(11-n);
+end
+z=z*10000; //rounding of to 4 decimal values
+z=round(z);
+z=z/10000;
+printf("The Decimal equivalent of the Binary number given is = %f",f+z); //Displaying the final result \ No newline at end of file
diff --git a/45/CH5/EX5.10/example_5_10.sce b/45/CH5/EX5.10/example_5_10.sce
new file mode 100755
index 000000000..7ce381e52
--- /dev/null
+++ b/45/CH5/EX5.10/example_5_10.sce
@@ -0,0 +1,22 @@
+//Example 5.10
+clc //clears the command window
+clear //clears the variables
+q=0;
+b=0;
+//a=input("enter the decimal no:")
+a=56000; // giving the value specified in the problem
+temp=a;
+format('v',18) //increasing the precision to 18
+a=floor(a);
+h=dec2hex(a);
+while(a>0) // converting to binary
+ x=modulo(a,2);
+ b= b + (10^q)*x;
+ a=a/2;
+ a=floor(a);
+ q=q+1;
+end
+printf("Given decimal number is : %d\n",temp)
+printf("The hexadecimal equivalent is = %s\n",h)
+ //displaying the results
+printf("The binary equivalent is = %f\n",b);
diff --git a/45/CH5/EX5.11/example_5_11.sce b/45/CH5/EX5.11/example_5_11.sce
new file mode 100755
index 000000000..80d8d5bfa
--- /dev/null
+++ b/45/CH5/EX5.11/example_5_11.sce
@@ -0,0 +1,22 @@
+//chapter 5
+//Example 5.11
+//Q.convert decimal numbers to its hexadecimal and binary equivalent ?
+//solution :
+clc //clears the command window
+clear //clears the variables
+q=0;
+b=0;
+a=input("Enter the decimal no:") //Enter the decimal nuber
+format('v',18) //increasing the precision to 18
+a=floor(a);
+h=dec2hex(a);
+while(a>0) // converting to binary
+ x=modulo(a,2);
+ b= b + (10^q)*x;
+ a=a/2;
+ a=floor(a);
+ q=q+1;
+end
+printf("The hexadecimal equivalent is = %s\n",h)
+ //displaying the results
+printf("The binary equivalent is = %f",b)
diff --git a/45/CH5/EX5.2/example_5_2.sce b/45/CH5/EX5.2/example_5_2.sce
new file mode 100755
index 000000000..659aaa8ce
--- /dev/null
+++ b/45/CH5/EX5.2/example_5_2.sce
@@ -0,0 +1,40 @@
+//Example 5.2
+clc //clears the command window
+clear //clears all the variables
+p=1; //initialising variables
+q=1;
+z=0;
+b=0;
+w=0;
+f=0;
+format('v',18); //increasing the precision to 18 .
+//bin= input ("Enter the binary no to be converted to its decimal equivalent : ") // accepting the binary input from user
+bin=1011.11;
+d= modulo(bin,1); //separating the decimal part and the integer part
+d=d*10^10;
+a=floor(bin); //removing the decimal part
+while(a>0) //Loop to take the binary bits of integer in to a matrix
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1 //multipliying the bits of integer with their position values and adding
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+while(d>0) //Loop to take the binary bits of decimal in to a matrix
+ e=modulo(d,2)
+ w(1,p)=e
+ d=d/10;
+ d=floor(d)
+ p=p+1;
+ end
+for n=1:p-1 //multipliying the bits of decimal with their position values and adding
+ z=z+w(1,n)*(0.5)^(11-n);
+end
+z=z*10000; //rounding of to 4 decimal values
+z=round(z);
+z=z/10000;
+printf("The Decimal equivalent of the Binary number given is = %f",f+z); //Displaying the final result \ No newline at end of file
diff --git a/45/CH5/EX5.3/example_5_3.sce b/45/CH5/EX5.3/example_5_3.sce
new file mode 100755
index 000000000..a0418d98a
--- /dev/null
+++ b/45/CH5/EX5.3/example_5_3.sce
@@ -0,0 +1,7 @@
+//Example 5.3
+clc //clears the command window .
+clear //clears all the variables .
+format('v',18); //increasing the precision to 18 .
+n=2; /// given 2 mb
+dec = n * 2^20 ;
+printf("The decimal equivalent of 2Mb is = %f ",dec); //displaying the value.
diff --git a/45/CH5/EX5.4/example_5_4.sce b/45/CH5/EX5.4/example_5_4.sce
new file mode 100755
index 000000000..afe9156f1
--- /dev/null
+++ b/45/CH5/EX5.4/example_5_4.sce
@@ -0,0 +1,33 @@
+//Example 5.3
+clc //clears the command window
+clear //clears all the variables
+q=0;
+b=0;
+s=0;
+format('v',18); //increasing the precision to 18 .
+//a=input("Enter the decimal no to be converted to its binary equivalent : "); // accepting the decimal input from user
+a=23.6;
+d=modulo(a,1); //separating the decimal part and the integer part
+a=floor(a); //removing the decimal part
+
+while(a>0) //taking integer part in to a matrix and convert to equivalent binary
+ x=modulo(a,2);
+ b= b + (10^q)*x;
+ a=a/2;
+ a=floor(a);
+ q=q+1;
+end
+
+
+
+for i=1:10 // For values after decimal point converting to binary
+ d=d*2;
+ q=floor(d);
+ s=s+q/(10^i);
+ if d>=1 then
+ d=d-1;
+ end
+ end
+ k=b+s;
+printf("The binary equivalent of the given decimal number is = %f",k); // displaying the final result.
+ \ No newline at end of file
diff --git a/45/CH5/EX5.5/example_5_5.sce b/45/CH5/EX5.5/example_5_5.sce
new file mode 100755
index 000000000..450d8cd41
--- /dev/null
+++ b/45/CH5/EX5.5/example_5_5.sce
@@ -0,0 +1,7 @@
+//Example 5.5
+clc //clears the command window
+clear //clears all the variables
+format('v',18) //increasing the precision
+n=32; // given 32 1's
+dec=2^n - 1 ;
+printf("The decimal equivalent of 32 bit number with all 1s is = %f ",dec); // displaying the result
diff --git a/45/CH5/EX5.6/example_5_6.sce b/45/CH5/EX5.6/example_5_6.sce
new file mode 100755
index 000000000..ad9dd2880
--- /dev/null
+++ b/45/CH5/EX5.6/example_5_6.sce
@@ -0,0 +1,34 @@
+//Example 5.6
+clc //clears the command window
+clear //clears all the variables
+q=0;
+b=0;
+s=0;
+format('v',18); //increasing the precision to 18 .
+//a=input("Enter the decimal no to be converted to its binary equivalent : "); // accepting the decimal input from user
+a=363; //taking the value given in problem
+d=modulo(a,1); //separating the decimal part and the integer part
+a=floor(a); //removing the decimal part
+
+while(a>0) //taking integer part in to a matrix and convert to equivalent binary
+ x=modulo(a,2);
+ b= b + (10^q)*x;
+ a=a/2;
+ a=floor(a);
+ q=q+1;
+end
+
+
+
+for i=1:10 // For values after decimal point converting to binary
+ d=d*2;
+ q=floor(d);
+ s=s+q/(10^i);
+ if d>=1 then
+ d=d-1;
+ end
+ end
+ k=b+s;
+ disp("The give decimal number is 363")
+printf(" The binary equivalent of the given decimal number is = %f",k); // displaying the final result.
+ \ No newline at end of file
diff --git a/45/CH5/EX5.7/example_5_7.sce b/45/CH5/EX5.7/example_5_7.sce
new file mode 100755
index 000000000..3726a3193
--- /dev/null
+++ b/45/CH5/EX5.7/example_5_7.sce
@@ -0,0 +1,21 @@
+//Example 5.7
+clc //clears the command window
+clear //clears all the variables
+q=1;
+b=0;
+f=0;
+bin=input("Enter the 8-bit binary address :"); // Taking the input binary bits from the user
+a=floor(bin)
+while(a>0) //Loop to take the binary bits in to a matrix(array)
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1 // converrting to decimal
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+c=dec2hex(f);
+printf("The hexadecimal equivalent of the given binary number is : %s",c); //displaying the value \ No newline at end of file
diff --git a/45/CH5/EX5.8/example_5_8.sce b/45/CH5/EX5.8/example_5_8.sce
new file mode 100755
index 000000000..79996b5aa
--- /dev/null
+++ b/45/CH5/EX5.8/example_5_8.sce
@@ -0,0 +1,8 @@
+//Example 5.8
+clc //clear the command window
+clear //clear the variables
+a=input("Enter the hexadecimal number to be converted into decimal(enter in a single quotation) : ") // taking the input from user
+d=hex2dec(a);
+printf("The decimal equivalent is : %d",d); //displaying the output
+
+
diff --git a/45/CH5/EX5.9/example_5_9.sce b/45/CH5/EX5.9/example_5_9.sce
new file mode 100755
index 000000000..406b61f7d
--- /dev/null
+++ b/45/CH5/EX5.9/example_5_9.sce
@@ -0,0 +1,21 @@
+//Example 5.9
+clc //clears the command window
+clear //clears the variables
+q=0;
+b=0;
+//a=input("enter the decimal no:")
+a=65535; // giving the value specified in the problem
+temp =a;
+format('v',18) //increasing the precision to 18
+a=floor(a);
+h=dec2hex(a);
+while(a>0) // converting to binary
+ x=modulo(a,2);
+ b= b + (10^q)*x;
+ a=a/2;
+ a=floor(a);
+ q=q+1;
+end
+printf("Given decimal number is : %d\n",temp)
+printf('The hexadecimal equivalent is = %s\n',h); //displaying the results
+printf('The binary equivalent is = %f',b ); \ No newline at end of file
diff --git a/45/CH6/EX6.1/example_6_1.sce b/45/CH6/EX6.1/example_6_1.sce
new file mode 100755
index 000000000..a568e8ae8
--- /dev/null
+++ b/45/CH6/EX6.1/example_6_1.sce
@@ -0,0 +1,52 @@
+//exmple 6.1
+clc;
+clear;
+//a=input("enter the first 8 bit number :");
+//b=input("enter the second 8 bit number :");
+a=01010111; // taking given inputs
+b=00110101;
+for i=1:8
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+car(1)=0;
+for i=1:8 // adding both the inputs (binary addition)
+ c1(i)=car(i)+a1(i)+ b1(i);
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(9)=car(9);
+re=0;
+format('v',18);
+for i=1:9
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf('The sum of given two binary numbers is %d\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) // converting the result to a hexadecimal no
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf(' The sum in hexadecimal notation is %s \n',hex); //displaying result \ No newline at end of file
diff --git a/45/CH6/EX6.10/example_6_10.sce b/45/CH6/EX6.10/example_6_10.sce
new file mode 100755
index 000000000..896897f84
--- /dev/null
+++ b/45/CH6/EX6.10/example_6_10.sce
@@ -0,0 +1,110 @@
+//example 6.10
+clc;
+clear;
+format('v',18);
+//bb=input('enter the first number(in decimal):' );
+//aaa=input('enter the second number(negative) :');
+aaa=-12618
+bb=18357;
+aa=-1*aaa;
+a=0;
+q=0;
+while(aa>0) // finding the binary equivalents
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+r=0;
+b=0;
+while(bb>0)
+ x=modulo(bb,2);
+ b= b + (10^r)*x;
+ bb=bb/2;
+ bb=floor(bb);
+ r=r+1;
+end
+m=b
+for i=1:16
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ p1(i)=0;
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+p1(1)=1;
+for i=1:16 // finding the 2's compliment of second number
+ a1(i)=bitcmp(a1(i),1);
+ end
+ car(1)=0;
+for i=1:16
+ c1(i)=car(i)+a1(i)+ p1(i);
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end;
+end;
+re=0;
+ for i=1:16
+ re=re+(c1(i)*(10^(i-1)))
+ end;
+ printf(' The binary representation of first number is ');
+ disp(m);
+ printf(' The 2''s compliment of second nmber is');
+ disp(re);
+a1=c1;
+ar(1)=0;
+for i=1:8
+ c1(i)=ar(i)+a1(i)+ b1(i); // addin both the nmbers (binary addition)
+ if c1(i)== 2 then // lower byte
+ ar(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ ar(i+1)= 1;
+ c1(i)=1;
+ else
+ ar(i+1)=0;
+ end
+end
+c1(9)=ar(9)
+re=0;
+format('v',18);
+for i=1:8
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The sum of lower bytes of two binary numbers is %d\n',re );
+printf(' with a carry is %d\n',ar(9));
+for i=9:16
+ c1(i)=ar(i)+a1(i)+ b1(i);// upper byte
+ if c1(i)== 2 then
+ ar(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ ar(i+1)= 1;
+ c1(i)=1;
+ else
+ ar(i+1)=0;
+ end
+end
+c1(17)=ar(17);
+format('v',25);
+ree=0;
+for i=9:16
+ ree=ree+(c1(i)*(10^(i-9)));
+end
+for i=9:16
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The sum of upper bytes of the given numbers is %d\n',ree);
+printf(' with a carry is %d\n',ar(17));//displaying results
+printf(' The total sum is ' );
+disp(re);
+printf(' with a carry %d',ar(17));
diff --git a/45/CH6/EX6.12/example_6_12.sce b/45/CH6/EX6.12/example_6_12.sce
new file mode 100755
index 000000000..c64f8fb44
--- /dev/null
+++ b/45/CH6/EX6.12/example_6_12.sce
@@ -0,0 +1,24 @@
+//exmple 6.12
+clc;
+clear;
+//a=input('Enter the first number A (4 bit ) :');
+//b=input('Enter the first number B (4 bit ) :');
+a=1111;// given values for a and b
+b=0001;
+for i=1:4
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+for i=1:4 //finding the generate and propagate values for ech bit
+ g(i)=bitand(a1(i),b1(i));
+ p(i)=bitor(a1(i),b1(i));
+end
+c(1)=0;
+for i=1:4 // finding the carry
+ c(i+1)= bitor(g(i),bitand(p(i),c(i)));
+end
+printf('The final carry is C3 = %d', c(5));//displaying the result \ No newline at end of file
diff --git a/45/CH6/EX6.2/example_6_2.sce b/45/CH6/EX6.2/example_6_2.sce
new file mode 100755
index 000000000..20010a293
--- /dev/null
+++ b/45/CH6/EX6.2/example_6_2.sce
@@ -0,0 +1,53 @@
+//exmple 6.2
+clc;
+clear;
+//a=input("enter the first 16 bit binary number :");
+//b=input("enter the second 16 bit binarynumber :");
+a=0000111110101100;
+b=0011100001111111;
+for i=1:16
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+car(1)=0;
+for i=1:16 /// adding both the 16-bit inputs (binary addition)
+ c1(i)=car(i)+a1(i)+ b1(i);
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(17)=car(17);
+re=0;
+format('v',25);
+for i=1:17
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf('The sum of given two binary numbers is %f\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) // converting the result to a hexadecimal no
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf(' Sum in decimal notation is %d\n',f);
+printf(' Sum in hexadecimal notation is %s \n',hex); //displaying result \ No newline at end of file
diff --git a/45/CH6/EX6.3/example_6_3.sce b/45/CH6/EX6.3/example_6_3.sce
new file mode 100755
index 000000000..04ad4b7c9
--- /dev/null
+++ b/45/CH6/EX6.3/example_6_3.sce
@@ -0,0 +1,62 @@
+//example 6.3
+clc;
+clear;
+//a=input("enter the first 8 bit number :");
+//b=input("enter the second 8 bit number :");
+a=0000111110101100;
+b=0011100001111111;
+for i=1:16
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+car(1)=0;
+for i=1:8
+ c1(i)=car(i)+a1(i)+ b1(i); // adding the Higher bytes
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(9)=car(9)
+re=0;
+format('v',18);
+for i=1:9
+ re=re+(c1(i)*(10^(i-1)))
+end
+
+printf('The sum of lower bytes of two binary numbers is %d\n',re );
+printf(' with a carry is %d\n',car(9));
+re=re-(c1(9)*(10^(8)))
+for i=9:16 // adding the Higher bytes
+ c1(i)=car(i)+a1(i)+ b1(i);
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(17)=car(17);
+format('v',25);
+ree=0;
+for i=9:17
+ ree=ree+(c1(i)*(10^(i-9)));
+end
+for i=9:17
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The sum of upper bytes of the given numbers is %d\n',ree);
+printf(' with a carry is %d\n',car(17)); // displaying results
+printf(' The total sum is %f',re ); \ No newline at end of file
diff --git a/45/CH6/EX6.4/example_6_4.sce b/45/CH6/EX6.4/example_6_4.sce
new file mode 100755
index 000000000..55e81691a
--- /dev/null
+++ b/45/CH6/EX6.4/example_6_4.sce
@@ -0,0 +1,73 @@
+//exmple 6.4
+clc;
+clear;
+a=0;
+b=0;
+q=0;
+//bb=input(" Enter the first no (in decimal) :");
+//aa=input(" Enter the number from which first no has to substracted:");
+aa=200; // taking the given input
+bb=125;
+while(aa>0) // converting the inputs in to binary numbers
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+q=0;
+while(bb>0)
+ x=modulo(bb,2);
+ b= b + (10^q)*x;
+ bb=bb/2;
+ bb=floor(bb);
+ q=q+1;
+end
+printf(' \nThe binary equivalent of first no is %f\n\n',b);
+printf(' The binary equivalent of secnd no is %f\n\n',a);
+for i=1:40
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+bro(1)=0;
+for i=1:40
+ c1(i)=a1(i)- b1(i)-bro(i); // finding the difference of the given inputs
+ if c1(i)== -1 then
+ bro(i+1)= 1;
+ c1(i)=1;
+ elseif c1(i)==-2 then
+ bro(i+1)= 1;
+ c1(i)=0;
+ else
+ bro(i+1)=0;
+ end
+
+end
+re=0;
+format('v',18);
+for i=1:40
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The diference of given two numbers is %f\n\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0)
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf(' Sum in decimal notation is %d\n\n',f); // displaying the results
+printf(' Sum in hexadecimal notation is %s \n',hex); \ No newline at end of file
diff --git a/45/CH6/EX6.5/example_6_5.sce b/45/CH6/EX6.5/example_6_5.sce
new file mode 100755
index 000000000..72dde71a2
--- /dev/null
+++ b/45/CH6/EX6.5/example_6_5.sce
@@ -0,0 +1,76 @@
+//example 6.5
+
+clc;
+clear;
+a=0;
+b=0;
+q=0;
+
+//aa=input(" Enter the first no (in decimal) :");
+//bb=input(" Enter the number from which first no has to substracted:");
+aa=150;
+bb=85;
+while(aa>0) // converting the inputs in to binary numbers
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+q=0;
+while(bb>0)
+ x=modulo(bb,2);
+ b= b + (10^q)*x;
+ bb=bb/2;
+ bb=floor(bb);
+ q=q+1;
+end
+printf(' \n The binary equivalent of first no is %f\n\n',a);
+printf(' The binary equivalent of secnd no is %f\n\n',b);
+for i=1:40
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+
+car(1)=0;
+for i=1:40
+ c1(i)=car(i)+a1(i)+ b1(i); // addng both the inputs
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(41)=car(41);
+re=0;
+format('v',18);
+for i=1:41
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The sum of given two binary numbers is %f\n\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0)
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+printf(' Sum in decimal notation is %d\n\n',f); // displaying results
+hex=dec2hex(f);
+printf(' The sum in hexadecimal notation is %sH \n',hex); \ No newline at end of file
diff --git a/45/CH6/EX6.6/example_6_6.sce b/45/CH6/EX6.6/example_6_6.sce
new file mode 100755
index 000000000..b53cfe5e8
--- /dev/null
+++ b/45/CH6/EX6.6/example_6_6.sce
@@ -0,0 +1,75 @@
+//exmple 6.6
+clc;
+clear;
+a=0;
+b=0;
+q=0;
+//bb=input(" Enter the first no (in decimal) :");
+//aa=input(" Enter the number from which first no has to substracted:");
+aa=150;
+bb=85;
+while(aa>0) //// converting the inputs in to binary numbers
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+nn=a
+q=0;
+while(bb>0)
+ x=modulo(bb,2);
+ b= b + (10^q)*x;
+ bb=bb/2;
+ bb=floor(bb);
+ q=q+1;
+end
+printf(' \nThe binary equivalent of first no is %f\n\n',b);
+printf(' The binary equivalent of secnd no is %f\n\n',a);
+for i=1:40
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+
+bro(1)=0;
+for i=1:40
+ c1(i)=a1(i)- b1(i)-bro(i);
+ if c1(i)== -1 then
+ bro(i+1)= 1;
+ c1(i)=1;
+ elseif c1(i)==-2 then
+ bro(i+1)= 1;
+ c1(i)=0;
+ else
+ bro(i+1)=0;
+ end
+
+end
+re=0;
+format('v',18);
+for i=1:40
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf(' The diference of given two numbers is %f\n\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) // converting the binary result to decimal then to hexadecimal
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf(' Sum in decimal notation is %d\n\n',f);
+printf(' Sum in hexadecimal notation is %s \n',hex); \ No newline at end of file
diff --git a/45/CH6/EX6.7/example_6_7.sce b/45/CH6/EX6.7/example_6_7.sce
new file mode 100755
index 000000000..3f9409619
--- /dev/null
+++ b/45/CH6/EX6.7/example_6_7.sce
@@ -0,0 +1,76 @@
+//example 6.7
+clc;
+clear;
+a=0;
+b=0;
+q=0;
+//aa=input(" Enter the first no (in decimal) :");
+//bb=input(" Enter the number from which first no has to substracted:");
+aa=175;
+bb=118;
+while(aa>0) // converting the inputs in to binary numbers
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+q=0;
+while(bb>0)
+ x=modulo(bb,2);
+ b= b + (10^q)*x;
+ bb=bb/2;
+ bb=floor(bb);
+ q=q+1;
+end
+printf(' \n The binary equivalent of first no is %f\n\n',a);
+printf(' The binary equivalent of secnd no is %f\n\n',b);
+for i=1:8
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=modulo(b,10);
+ b=b/10;
+ b=round(b);
+end
+
+car(1)=0;
+for i=1:8
+ c1(i)=car(i)+a1(i)+ b1(i);//adding the binary numbers (binary addtion)
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end
+end
+c1(9)=car(9);
+re=0;
+format('v',18);
+for i=1:8
+ re=re+(c1(i)*(10^(i-1)))
+end
+printf('If only 8 bits are taken the result will be as shown below \n\n');
+printf(' and the sum of given two binary numbers will be %f\n\n',re );
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) //converting the binary output to hexadecimal
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1;
+ f = f + b(1,m)*(2^c);
+end
+printf(' Sum in decimal notation is %d\n\n',f);
+hex=dec2hex(f);
+printf(' The sum in hexadecimal notation is %sH \n',hex);
+printf(' \n with an overflow of %d\n\n',car(9)); \ No newline at end of file
diff --git a/45/CH6/EX6.8/example_6_8.sce b/45/CH6/EX6.8/example_6_8.sce
new file mode 100755
index 000000000..cf9a6b752
--- /dev/null
+++ b/45/CH6/EX6.8/example_6_8.sce
@@ -0,0 +1,74 @@
+//example 6.8
+clc;
+clear;
+re=0;
+aaa=input('enter the number(in decimal) :');// taking the signed number
+m=aaa;
+if aaa<0 then
+ aa=-1*aaa;
+ else aa=aaa;
+end
+a=0;
+q=0;
+while(aa>0) //converting from decimal to binary
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+mm=a;
+for i=1:8
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=0;
+end
+b1(1)=1;
+if aaa<0 then // making two's complement if the number is less than zero
+ for i=1:8
+ a1(i)=bitcmp(a1(i),1);
+ end
+ car(1)=0;
+for i=1:8
+ c1(i)=car(i)+a1(i)+ b1(i); // adding one (as a part of finding 2's compliment
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end;
+end;
+c1(9)=car(9);
+re=0;
+format('v',18);
+ for i=1:9
+ re=re+(c1(i)*(10^(i-1)))
+ end;
+ printf('\nThe binary contents are %d\n\n',re );
+else
+ re=mm;
+ end;
+ if(aaa>0)
+ printf('\nThe biary contents are %d\n\n',mm);
+end;
+q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) // converting the result to decimal then to hexadecimal
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf('The Hexadecimal contents are %sH',hex) ;//displayin the result \ No newline at end of file
diff --git a/45/CH6/EX6.9/example_6_9.sce b/45/CH6/EX6.9/example_6_9.sce
new file mode 100755
index 000000000..610c08666
--- /dev/null
+++ b/45/CH6/EX6.9/example_6_9.sce
@@ -0,0 +1,64 @@
+//example 6.9
+clc;
+clear;
+//aaa=input('enter the number(in decimal) :');
+aaa=-19750 // given input
+aa=-1*aaa;
+format('v',18);
+a=0;
+q=0;
+while(aa>0) // converting it to binary
+ x=modulo(aa,2);
+ a= a + (10^q)*x;
+ aa=aa/2;
+ aa=floor(aa);
+ q=q+1;
+end
+for i=1:16
+ a1(i)=modulo(a,10);
+ a=a/10;
+ a=round(a);
+ b1(i)=0;
+end
+b1(1)=1;
+for i=1:16 /// finding the 2's compliment
+ a1(i)=bitcmp(a1(i),1);
+ end
+ car(1)=0;
+for i=1:16
+ c1(i)=car(i)+a1(i)+ b1(i);
+ if c1(i)== 2 then
+ car(i+1)= 1;
+ c1(i)=0;
+ elseif c1(i)==3 then
+ car(i+1)= 1;
+ c1(i)=1;
+ else
+ car(i+1)=0;
+ end;
+end;
+c1(17)=car(17);
+re=0;
+ for i=1:17
+ re=re+(c1(i)*(10^(i-1)))
+ end;
+ printf('\n The 2''s compliment is');
+ disp(re);
+ q=1;
+b=0;
+f=0;
+a=re;
+while(a>0) // converting to hexadecimal
+ r=modulo(a,10);
+ b(1,q)=r;
+ a=a/10;
+ a=floor(a);
+ q=q+1;
+end
+for m=1:q-1
+ c=m-1
+ f = f + b(1,m)*(2^c);
+end
+hex=dec2hex(f);
+printf('\n In Hexadecimal notation is %sH\n\n',hex) ;// displaying the result
+disp('As the memory of a first generation microcumputer is orgnised in bytes . The lower byte is stored in 2000 address and the higher byte is stored in 2001 address.'); \ No newline at end of file
diff --git a/45/CH7/EX7.1/example_7_1.sce b/45/CH7/EX7.1/example_7_1.sce
new file mode 100755
index 000000000..14ed48c98
--- /dev/null
+++ b/45/CH7/EX7.1/example_7_1.sce
@@ -0,0 +1,13 @@
+//example 7.1
+clear;
+clc;
+ //for 50 kHz clock
+ clk_frq1 = 50000;
+ c_t_500 = 1000/clk_frq1;
+ //for 8-MHz clock
+ clk_frq2 = 8000000;
+ c_t_8 = 10000000/clk_frq2;
+ printf('Cycle time for 500-kHz clock is %f milliseconds \n',c_t_500);//displaying results
+ printf(' Cycle time for 8-MHz clock is %f micro seconds',c_t_8);
+
+ \ No newline at end of file
diff --git a/45/CH7/EX7.10/7_10_a.jpg b/45/CH7/EX7.10/7_10_a.jpg
new file mode 100755
index 000000000..8dc9268e9
--- /dev/null
+++ b/45/CH7/EX7.10/7_10_a.jpg
Binary files differ
diff --git a/45/CH7/EX7.10/7_10_b.jpg b/45/CH7/EX7.10/7_10_b.jpg
new file mode 100755
index 000000000..a3b3b2e55
--- /dev/null
+++ b/45/CH7/EX7.10/7_10_b.jpg
Binary files differ
diff --git a/45/CH7/EX7.10/example_7_10.sce b/45/CH7/EX7.10/example_7_10.sce
new file mode 100755
index 000000000..646389005
--- /dev/null
+++ b/45/CH7/EX7.10/example_7_10.sce
@@ -0,0 +1,62 @@
+//example 7.10
+clear
+clc
+close
+//R = input('Enter the value of the resistance R in Kohms :');
+//C =input('Enter the value of the Capacitance C in micro farads :');
+sp = input('Enter the spacing between two input pulses in micro seconds :');
+R=10;
+C=0.01;
+//sp=50;
+//sp=10;
+t= 330*R*C; // calculating time constant
+printf('The output pulse width will be about %f micro seconds ',t);
+tt=t*10;
+p=1;
+len=sp*60+1;
+q=1;
+for j=1:len // making arrays to plot the graphs
+ lo = sp*10;
+ f=modulo(j,lo);
+ if f==0 then
+ inpu(j)=1;
+ else
+ inpu(j)=0;
+ end
+ inpu(1)=1;
+o(j)=5;
+end
+if sp<40 then
+while q<2*len
+ result(q)=0;
+ q=q+1;
+end
+else
+while q<1.2*len
+ result(q)=0;
+ q=q+1;
+end
+end
+while p<len
+ if inpu(p)==1 then
+ for k=1:tt
+ result(p+k)=3;
+ end
+ p=p+1;
+ else
+ p=p+1;
+ end
+
+ end
+subplot(2,1,1); // ploting bothe graphs in same window
+plot(o);
+plot(inpu);
+xlabel('time X10^-7 seconds');
+ylabel('Manitude') ;
+title('input pulses');
+ subplot(2,1,2);
+ plot(o);
+plot(result);
+xlabel('time X10^-7 seconds');
+ylabel('Manitude') ;
+title('Output');
diff --git a/45/CH7/EX7.11/example_7_11.sce b/45/CH7/EX7.11/example_7_11.sce
new file mode 100755
index 000000000..0babf1c3c
--- /dev/null
+++ b/45/CH7/EX7.11/example_7_11.sce
@@ -0,0 +1,11 @@
+//example 7.11
+clc
+clear
+//R = input('Enter the value of the resistance R in Kohms :');
+//pw =input('Enter the value of required pulse width in millisecndseconds :');
+R=0.5;//tking the given values
+format('v',18);
+pw = 1 * 10^-3;
+C = pw/(0.33*R); //calculating C
+printf('The required value of capacitance is %f microfarads\n',C);
+printf('The pulse delay capacitor is %f microfarads',(2*C));
diff --git a/45/CH7/EX7.2/example_7_2.sce b/45/CH7/EX7.2/example_7_2.sce
new file mode 100755
index 000000000..5ea24f2f8
--- /dev/null
+++ b/45/CH7/EX7.2/example_7_2.sce
@@ -0,0 +1,9 @@
+//example 7.2
+clc;
+clear;
+//prop_delay = input('Enter the propagation delay in nano seconds:');
+prop_dely=24; // taking the given input
+ format('v',18); //setting the precision
+max_clk_frq = 1/prop_delay; // making necessary calculations
+max_clk_frq = max_clk_frq*10^3;
+printf('maximum clock frequency is %f KHz',max_clk_frq); // displaying the result
diff --git a/45/CH7/EX7.3/example_7_3.sce b/45/CH7/EX7.3/example_7_3.sce
new file mode 100755
index 000000000..3d9304a95
--- /dev/null
+++ b/45/CH7/EX7.3/example_7_3.sce
@@ -0,0 +1,14 @@
+//example 7.3
+clc;
+clear;
+//ppm = input('Enter the stability in parts per million(PPM):');
+//clk_frq = input('Enter the clock frequency in MHz:' );
+ppm= 5//taking the given values
+clk_frq= 5
+mill= clk_frq; //making necessary calculations
+pp = mill*ppm;
+pp = round(pp);
+clk_frq = clk_frq*10^6;
+o(1,1)=clk_frq-pp;
+o(1,2)=clk_frq+pp;
+printf('The clock frequency will be somewhere between %d and %d Hz',o);//displaying the result \ No newline at end of file
diff --git a/45/CH7/EX7.4/7_4.jpg b/45/CH7/EX7.4/7_4.jpg
new file mode 100755
index 000000000..c330b3505
--- /dev/null
+++ b/45/CH7/EX7.4/7_4.jpg
Binary files differ
diff --git a/45/CH7/EX7.4/example_7_4.sce b/45/CH7/EX7.4/example_7_4.sce
new file mode 100755
index 000000000..2800b381e
--- /dev/null
+++ b/45/CH7/EX7.4/example_7_4.sce
@@ -0,0 +1,38 @@
+//example 7.4
+//schmitt trigger inverter
+clear;
+clc;
+close;
+//peak= input('Enter the peak voltage of sine wave in volts :');
+//utp = input('Enter the upper trigger point in volts :');
+//ltp = input('Enter the lower trigger point in volts :');
+peak =2; // taking given values for inputs
+utp=1.7;
+ltp=0.9;
+for i=1:4000
+ sinn(i) = peak * sin(i*2*3.1416/1000); //drawing a sin wave with given amplitude
+end
+for j=1:4000 // making calculations to plot output
+ if modulo(j,1000)< 250 then
+ if sinn(j)<utp then
+ result(j)=3.4;
+ else
+ result(j)=0.2;
+ end
+ elseif sinn(j)>ltp then
+ result(j)=0.2
+ else
+ result(j)=3.4;
+ end
+end
+subplot(2,1,1)
+plot(sinn); //ploting the input and output curves
+xlabel('n');
+title('input')
+ylabel('volts');
+
+subplot(2,1,2);
+plot(result,'r');
+xlabel('n');
+title('output')
+ylabel('volts');
diff --git a/45/CH7/EX7.5/example_7_5.sce b/45/CH7/EX7.5/example_7_5.sce
new file mode 100755
index 000000000..276db3903
--- /dev/null
+++ b/45/CH7/EX7.5/example_7_5.sce
@@ -0,0 +1,12 @@
+//example 7.5
+clc
+clear
+//Ra = input('Enter the value of the resistance RA in Kohms :');
+//Rb = input('Enter the value of the resistance RB in Kohms :');
+//C =input('Enter the value of the Capacitance C in micro farads :');
+Ra=1 //taking the given input
+Rb=1
+C= 1 *10^-3
+T= (Ra + 2*Rb)*C;
+frq = 1.44 * (1/T); //substituting in the eqution
+printf('Freqency of oscillation is %f KHz',frq); //displaying result \ No newline at end of file
diff --git a/45/CH7/EX7.6/example_7_6.sce b/45/CH7/EX7.6/example_7_6.sce
new file mode 100755
index 000000000..228e91db6
--- /dev/null
+++ b/45/CH7/EX7.6/example_7_6.sce
@@ -0,0 +1,17 @@
+//example 7.6
+clc
+clear
+//rb=input('Enter the value of the resistance RB in Kohms :');
+//dc =input('Enter required duty cycle in % :');
+//clk = input('Enter the provided clock frequency in MHz:');
+rb=0.75//taking the given values for input
+dc=25
+clk=1
+ra = (rb*100/dc) - 2*rb;//mking neccesary calculations
+ format('v',18);
+t2 = dc/(clk*10^8);
+C = t2/(693*rb)
+C=C*10^12;
+//C=round(C);
+printf('The value of RA is %f Kohms\n',ra);//displaying the output
+printf('The value of C is %f pico farads',C);
diff --git a/45/CH7/EX7.7/example_7_7.sce b/45/CH7/EX7.7/example_7_7.sce
new file mode 100755
index 000000000..fee496c3a
--- /dev/null
+++ b/45/CH7/EX7.7/example_7_7.sce
@@ -0,0 +1,9 @@
+//example 7.7
+clc
+clear
+//Ra = input('Enter the value of the resistance RA in Kohms :');
+//C =input('Enter the value of the Capacitance C in micro farads :');
+Ra=10//taking given values
+C=0.1
+pw = 1.1*Ra*C //substituting in the equation
+printf('pulse width is %f milliseconds',pw);//displaying result
diff --git a/45/CH7/EX7.8/example_7_8.sce b/45/CH7/EX7.8/example_7_8.sce
new file mode 100755
index 000000000..7d36067d7
--- /dev/null
+++ b/45/CH7/EX7.8/example_7_8.sce
@@ -0,0 +1,9 @@
+//example 7.8
+clc
+clear
+//Ra = input('Enter the value of the resistance RA in Kohms :');
+//pw =input('Enter the value of required pulse width in millisecndseconds :');
+Ra=10//taking given values
+pw=10
+C = pw/(1.1*Ra); //substituting in the equation
+printf('The required value of capacitance is %f microfarads',C);//displaying result \ No newline at end of file
diff --git a/45/CH7/EX7.9/7_9_a.jpg b/45/CH7/EX7.9/7_9_a.jpg
new file mode 100755
index 000000000..81424c8b2
--- /dev/null
+++ b/45/CH7/EX7.9/7_9_a.jpg
Binary files differ
diff --git a/45/CH7/EX7.9/7_9_b.jpg b/45/CH7/EX7.9/7_9_b.jpg
new file mode 100755
index 000000000..c6b3ae403
--- /dev/null
+++ b/45/CH7/EX7.9/7_9_b.jpg
Binary files differ
diff --git a/45/CH7/EX7.9/example_7_9.sce b/45/CH7/EX7.9/example_7_9.sce
new file mode 100755
index 000000000..d9ac607db
--- /dev/null
+++ b/45/CH7/EX7.9/example_7_9.sce
@@ -0,0 +1,53 @@
+//example 7.9
+clear
+clc
+close
+//R = input('Enter the value of the resistance R in Kohms :');
+//C =input('Enter the value of the Capacitance C in micro farads :');
+sp = input('Enter the spacing between two input pulses in micro seconds :');
+R=1; //taking give values
+C=0.01;
+t= 693*R*C; // calculting time constant
+tt=t*10;
+p=1;
+len=sp*60-1;
+q=1;
+for j=1:len //plotin the graphs
+ lo = sp*10;
+ f=modulo(j,lo);
+ if f==0 then
+ inpu(j)=1;
+ else
+ inpu(j)=0;
+ end
+ inpu(1)=1;
+o(j)=2;
+end
+while q<len
+ result(q)=0;
+ q=q+1;
+end
+while p<len
+ if inpu(p)==1 then
+ for k=1:tt
+ result(p+k)=1;
+ end
+ p=p+tt;
+ else
+ result(p)=0;
+ p=p+1;
+ end
+ end
+subplot(2,1,1); // ploting bothe graphs in same window
+plot(o);
+plot(inpu);
+xlabel('time X10^-7 seconds');
+ylabel('Manitude') ;
+title('input pulses');
+ subplot(2,1,2);
+ plot(o);
+plot(result);
+xlabel('time X10^-7 seconds');
+ylabel('Manitude') ;
+title('Output');
+
diff --git a/45/CH8/EX8.10/example_8_10.sce b/45/CH8/EX8.10/example_8_10.sce
new file mode 100755
index 000000000..d0ca88639
--- /dev/null
+++ b/45/CH8/EX8.10/example_8_10.sce
@@ -0,0 +1,83 @@
+//Example 8.10
+clc
+clear
+close
+b=[0 1 0 1 0 1 0 1];//given truth tble for the fictitious flip flop
+a = [0 0 1 1 0 0 1 1];
+qn = [0 0 0 0 1 1 1 1];
+for i=1:8
+if(a(i)==0 & b(i)==0) then
+ qn1(i) = 0;
+ end;
+if (a(i)==1 & b(i)== 1) then
+ qn1(i) = 1 ;
+ end;
+ if (a(i)==1 & b(i)== 0) then
+ qn1(i) = bitcmp(qn(i),1) ;
+ end;
+ if (a(i)==0 & b(i)== 1) then
+ qn1(i) = (qn(i)) ;
+ end;
+end;
+for i = 1 : 8 // printin the truth table
+ Y(i,1)=qn(i);
+ Y(i,2)=a(i);
+ Y(i,3)=b(i);
+ Y(i,4)=qn1(i);
+ end
+disp('The given truth table is :');
+disp(' Qn A B Qn+1');
+disp(Y);
+disp('The transitions are shown below');
+c1=0;
+c2=0;
+c3=0;
+c4=0;
+for j=1:8 //checking all possible cases to make a transition table
+ if(qn(j)==0) then
+ if(qn1(j) == 0) then
+ if(c1==0) then
+ disp('transition from 0 ----> 0');
+ disp(' A B ');
+ c1=1;
+ end;
+ disp(Y(j,2:3));
+ end;
+ end;
+end;
+for j=1:8
+ if(qn(j)==0) then
+ if(qn1(j) == 1) then
+ if(c2==0) then
+ disp('transition from 0 ----> 1');
+ disp(' A B ');
+ c2=1;
+ end;
+ disp(Y(j,2:3));
+ end;
+ end;
+end;
+for j=1:8
+ if(qn(j)==1) then
+ if(qn1(j) == 0) then
+ if(c3==0) then
+ disp('transition from 1 ----> 0');
+ disp(' A B ');
+ c3=1;
+ end;
+ disp (Y(j,2:3));
+ end;
+ end;
+end;
+for j=1:8
+ if(qn(j)==1) then
+ if(qn1(j) == 1) then
+ if(c4==0) then
+ disp('transition from 1 ----> 1');
+ disp(' A B ');
+ c4=1;
+ end;
+ disp(Y(j,2:3));
+ end;
+ end;
+end; \ No newline at end of file
diff --git a/45/CH8/EX8.12/example_8_12.sce b/45/CH8/EX8.12/example_8_12.sce
new file mode 100755
index 000000000..b7bf823fd
--- /dev/null
+++ b/45/CH8/EX8.12/example_8_12.sce
@@ -0,0 +1,22 @@
+//example 8.12
+
+clc;
+clear;
+close;
+qn=[0,0,1,1];
+x=[0,1,0,1];
+for i=1:4 // calculating Y for all possible cases
+ d(i)= bitxor(x(i),qn(i));
+ qn1(i) =d(i);
+ y(i)=bitand(x(i),bitcmp(qn(i),1));
+end;
+for i = 1 : 4 // displaying the state table
+ Y(i,1)=qn(i);
+ Y(i,2)=x(i);
+ Y(i,3)=d(i);
+ Y(i,4)=qn1(i);
+ Y(i,5)= y(i);
+ end
+disp('The state table is :');
+disp(' Qn X D Qn+1 Y');
+disp(Y);
diff --git a/45/CH8/EX8.13/example_8_13.sce b/45/CH8/EX8.13/example_8_13.sce
new file mode 100755
index 000000000..878ac7799
--- /dev/null
+++ b/45/CH8/EX8.13/example_8_13.sce
@@ -0,0 +1,5 @@
+//example 8.13
+clc;
+clear;
+disp('For SR flip flop Qn+1 = S + R`Qn and for D flip-flop Qn+1 = D .');
+disp('Thus with D = S + R`Qn we get circuit which behaves like SR flip-flop.');
diff --git a/45/CH8/EX8.4/example_8_4.sce b/45/CH8/EX8.4/example_8_4.sce
new file mode 100755
index 000000000..a74548385
--- /dev/null
+++ b/45/CH8/EX8.4/example_8_4.sce
@@ -0,0 +1,21 @@
+//example 8.4
+clc;
+clear;
+en=input("Enter the enable input level(1 or 0) : ") ;
+r=input("enter the R input level(1 or 0) : " );//accepting the inputs from the user
+s=input("enter the S input level(1 or 0) : " );
+qn=input("Enter the previous output value(1 or 0) : ");
+
+if en == 0 then // clculating the output
+ op = qn;
+elseif (s==0 & r==0) then
+ op=qn;
+elseif(s==1&r==1) then
+ disp('The inputs are illegal');
+ return;
+else
+ op=s;
+
+end
+
+printf('\n \noutput (Qn+1) = %d ',op);//displaying the output \ No newline at end of file
diff --git a/45/CH8/EX8.5/example_8_5.sce b/45/CH8/EX8.5/example_8_5.sce
new file mode 100755
index 000000000..93c694298
--- /dev/null
+++ b/45/CH8/EX8.5/example_8_5.sce
@@ -0,0 +1,10 @@
+//example 8.5
+clc;
+clear;
+disp('Here what happens at each point in time' );
+disp('Time t0: S = 0, R = 0, no change in Q (Q remains 0)');
+disp('Time t1: S = 1, R = 0, Q changes from 0 to 1');
+disp('Time t2: S = 0, R = 1, Q resets to 0');
+disp('Time t3: S = 1, R = 0, Q sets to 1 ');
+disp('Time t4: S = 0, R = 0, no change in Q (Q remains 1)');
+disp('Notice that either R or S, or both, are allowed to change state at any time, whether C is high or low. The only time both R and S must be stable (unchanging) is during the short PTs of the clock.'); \ No newline at end of file
diff --git a/45/CH8/EX8.6/example_8_6.sce b/45/CH8/EX8.6/example_8_6.sce
new file mode 100755
index 000000000..bd44c4fb5
--- /dev/null
+++ b/45/CH8/EX8.6/example_8_6.sce
@@ -0,0 +1,10 @@
+//example 8.6
+clc;
+clear;
+disp('Here what happens at each point in time' );
+disp('Time t0: S = 0, R = 0, no change in Q (Q remains 0)');
+disp('Time t1: S = 1, R = 0, Q changes from 0 to 1');
+disp('Time t2: S = 0, R = 1, Q resets to 0');
+disp('Time t3: S = 1, R = 0, Q sets to 1 ');
+disp('Time t4: S = 0, R = 0, no change in Q (Q remains 1)');
+disp('Notice that either R or S, or both, are allowed to change state at any time, whether C is high or low. The only time both R and S must be stable (unchanging) is during the short NTs of the clock.'); \ No newline at end of file
diff --git a/45/CH8/EX8.7/example_8_7.sce b/45/CH8/EX8.7/example_8_7.sce
new file mode 100755
index 000000000..d8c1b36d7
--- /dev/null
+++ b/45/CH8/EX8.7/example_8_7.sce
@@ -0,0 +1,5 @@
+//example 8.7
+clc;
+clear;
+close;
+printf("For input J and K = 0 otput Qn+1 = Qn i.e output does not change its state And for J = K = 1, The Output Qn+1 = Qn` i.e output toggles " ); \ No newline at end of file
diff --git a/45/CH8/EX8.9/8_9.jpg b/45/CH8/EX8.9/8_9.jpg
new file mode 100755
index 000000000..e5a3a3b62
--- /dev/null
+++ b/45/CH8/EX8.9/8_9.jpg
Binary files differ
diff --git a/45/CH8/EX8.9/example_8_9.sce b/45/CH8/EX8.9/example_8_9.sce
new file mode 100755
index 000000000..a9b24313b
--- /dev/null
+++ b/45/CH8/EX8.9/example_8_9.sce
@@ -0,0 +1,40 @@
+//example 8.9
+clc
+close
+clear
+disp("since J=K=1, the flip-flop simply toggles ech time the clock goes low, The waveform at Q has a period twice of that of the wavefrm. In other words, the frequency of Q id only one-half of that of . This circuit acts as a frequency divider --the output frequency divide by 2. Note that Q changes state on NTs of the clock. The waveforms are as shown in the figure ");
+t=50; // taken time period
+p=1;
+while p<t*10 // tking values for ploting the graph
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ cin(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ cin(p)=1;
+ p=p+1;
+ end
+end
+t=100;
+p=1;
+while p<t*5
+ if p==1 | modulo(p,t)==0 then
+ for k=1:t/2
+ dout(p+k)=0;
+ end
+ p=p+t/2;
+ else
+ dout(p)=1;
+ p=p+1;
+ end
+end
+y=[3 3];
+subplot(2,1,1) //plotin both the plots in a single window
+title('input at pin C')
+plot(cin)
+plot(y)
+subplot(2,1,2)
+title('out put at pin D')
+plot(dout)
+plot(y) \ No newline at end of file
diff --git a/45/CH9/EX9.1/example_9_1.sce b/45/CH9/EX9.1/example_9_1.sce
new file mode 100755
index 000000000..df9680653
--- /dev/null
+++ b/45/CH9/EX9.1/example_9_1.sce
@@ -0,0 +1,45 @@
+//example 9.1
+clc;
+clear;
+close ;
+//s = input ('Enter the number to be serially shifted in to the shift register');
+s=0100; // given serial input
+for i = 4:-1:1
+ se(i) =modulo(s,10);
+ s=s/10;
+ s=round(s);
+end
+se(i+4)=0;
+k=0;
+for i = 2:6 // making state table
+ clk(k+1) = k;
+ q(i)=se(i-1);
+ if i>1 then
+ r(i) = q(i-1);
+ else
+ r(i) =0;
+ end;
+ if i>2 then
+ s(i) = r(i-1);
+ else
+ s(i) =0;
+ end;
+ if i>3 then
+ t(i) =s(i-1);
+ else
+ t(i) =0;
+ end;
+ k=k+1;
+end
+for i = 1 : 5 // printing the state table
+ Y(i,1)=clk(i);
+ Y(i,2)=se(i);
+ Y(i,3)=q(i);
+ Y(i,4)=r(i);
+ Y(i,5)= s(i);
+ Y(i,6)=t(i);
+ end
+disp('The state table is :');
+disp('Clock Input Q R S T');
+disp(Y);
+
diff --git a/45/CH9/EX9.2/9_2.jpg b/45/CH9/EX9.2/9_2.jpg
new file mode 100755
index 000000000..e7bdd8dd3
--- /dev/null
+++ b/45/CH9/EX9.2/9_2.jpg
Binary files differ
diff --git a/45/CH9/EX9.2/example_9_2.sce b/45/CH9/EX9.2/example_9_2.sce
new file mode 100755
index 000000000..6e49a55f4
--- /dev/null
+++ b/45/CH9/EX9.2/example_9_2.sce
@@ -0,0 +1,128 @@
+//example 9.2
+clc
+clear
+close
+t1=100; // clock period
+s=0100; //given serial input
+for i = 4:-1:1
+ se(i) = modulo(s,10);
+ s=s/10;
+ s=round(s);
+end
+se(i+4)=0;
+k=0;
+for i = 2:6 //initially making a state table
+ clk(k+1) = k;
+ q(i)=se(i-1);
+ if i>1 then
+ r(i) = q(i-1);
+ else
+ r(i) =0;
+ end;
+ if i>2 then
+ s(i) = r(i-1);
+ else
+ s(i) =0;
+ end;
+ if i>3 then
+ t(i) =s(i-1);
+ else
+ t(i) =0;
+ end;
+ k=k+1;
+end
+for m=1:5 // drawing the graph
+ if(se(m)==1) then
+ v= ((m-1).*t1)
+ for u= 1: t1
+ se1(u+v)=1;
+ end
+ else
+ v= ((m-1)*t1)
+ for u= 1: t1
+ se1(u+v)=0;
+ end
+ end;
+
+ if(q(m)==1) then
+ v= ((m-1).*t1)
+ for u= 1: t1
+ q1(u+v)=1;
+ end
+ else
+ v= ((m-1)*t1)
+ for u= 1: t1
+ q1(u+v)=0;
+ end
+ end;
+ if(r(m)==1) then
+ v= ((m-1).*t1)
+ for u= 1: t1
+ r1(u+v)=1;
+ end
+ else
+ v= ((m-1)*t1)
+ for u= 1: t1
+ r1(u+v)=0;
+ end
+ end;
+ if(s(m)==1) then
+ v= ((m-1).*t1)
+ for u= 1: t1
+ s1(u+v)=1;
+ end
+ else
+ v= ((m-1)*t1)
+ for u= 1: t1
+ s1(u+v)=0;
+ end
+ end;
+ if(t(m)==1) then
+ v= ((m-1).*t1)
+ for u= 1: t1
+ t11(u+v)=1;
+ end
+ else
+ v= ((m-1)*t1)
+ for u= 1: t1
+ t11(u+v)=0;
+ end
+ end;
+ end;
+p=1;
+while p<t1*5
+ if p==1 | modulo(p,t1) == 1 then
+ for k=1:t1/2
+ cin(p+k)=0;
+ end
+ p=p+t1/2;
+ else
+ cin(p)=1;
+ p=p+1;
+ end
+end
+y=[3 3];
+subplot(6,1,1) // making subplots to draw all graphs in a single window
+title('Clock')
+plot(cin)
+plot(y)
+subplot(6,1,2)
+title('Serial input')
+plot(se1)
+plot(y)
+subplot(6,1,3)
+title('Q')
+plot(q1)
+plot(y)
+subplot(6,1,4)
+title('R')
+plot(r1)
+plot(y)
+subplot(6,1,5)
+title('S')
+plot(s1)
+plot(y)
+subplot(6,1,6)
+title('T')
+plot(t11)
+plot(y) \ No newline at end of file
diff --git a/45/CH9/EX9.4/example_9_4.sce b/45/CH9/EX9.4/example_9_4.sce
new file mode 100755
index 000000000..a53ae096f
--- /dev/null
+++ b/45/CH9/EX9.4/example_9_4.sce
@@ -0,0 +1,11 @@
+//example 9.4
+clc;
+clear;
+//b= input('Enter the number of bits :');
+//c= input('Enter the clock frequency in Mhz :');
+b= 8; // given values
+c=10;
+t= 1000/c;
+printf('One clock period takes %d ns\n',t); //displying the results
+tt=t*b;
+printf(' Time required by total bits required is %d ns',tt);
diff --git a/45/CH9/EX9.5/example_9_5.sce b/45/CH9/EX9.5/example_9_5.sce
new file mode 100755
index 000000000..eb86c820c
--- /dev/null
+++ b/45/CH9/EX9.5/example_9_5.sce
@@ -0,0 +1,10 @@
+//example 9.5
+clc;
+clear;
+close;
+//c= input('Enter the clock frequency in Mhz :');
+c=10; //given clock frequency
+t= 1000/c;
+printf('The data must be stable for 30 ns\n'); //displaying results
+tc = t-30;
+printf(' The data may be changing in %d ns',tc); \ No newline at end of file
diff --git a/45/CH9/EX9.8/example_9_8.sce b/45/CH9/EX9.8/example_9_8.sce
new file mode 100755
index 000000000..f61945f84
--- /dev/null
+++ b/45/CH9/EX9.8/example_9_8.sce
@@ -0,0 +1,8 @@
+//exaple 9.8
+clc;
+clear;
+//s=input("Enter the setup time in ns :");
+//h=input("Enter the hold time in ns :");
+s=20; //given input values
+h=5;
+printf('The data input levels must be held steady foor a minimum of %d ns',(s+h)); // displayin the results
diff --git a/45/CH9/EX9.9/example_9_9.sce b/45/CH9/EX9.9/example_9_9.sce
new file mode 100755
index 000000000..f26bd9f51
--- /dev/null
+++ b/45/CH9/EX9.9/example_9_9.sce
@@ -0,0 +1,4 @@
+//example 9.9
+clc;
+clear;
+disp('The mode control line must be high. The data lines must be stable for more than 10 ns prior to the clock NTs . If the clock is stopped after the transition time T, the levels n the input data lines may be changed. However , if the clock is not stopped, the input data levels must be mainted.') \ No newline at end of file
diff --git a/45/DEPENDENCIES/donkmapij.sci b/45/DEPENDENCIES/donkmapij.sci
new file mode 100755
index 000000000..e6cb65ee3
--- /dev/null
+++ b/45/DEPENDENCIES/donkmapij.sci
@@ -0,0 +1,279 @@
+//4-Variable KMAP
+//returns a string of the minimized expression
+//requires noof1.sci
+//noof1.sci should be executed before executing this function
+function bi = donkmapij(k)
+ n=4;
+ k(:,:,2)=zeros(n,n);
+ var=['I' 'J' 'Bn' 'An'];
+ p1=['I''J''' 'I''J' 'IJ' 'IJ'''];
+ p2=['Bn''An''';'Bn''An';'BnAn';'BnAn'''];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ bi= ' ';
+ disp(k(:,:,1));
+ for i=1:n
+ for j=1:n
+ if(k(i,j)~=1 | k(i,j)~=2)
+ temp=0;
+ break;
+ end
+ end
+ end
+ if(temp==1)
+ printf("1");
+ abort;
+ end
+ //checking the 8 cells cases
+ z1=ones(2,4);
+ z2=ones(4,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for i=1:n
+ if(i==4)
+ t=1;
+ else
+ t=i+1;
+ end
+ z=[k(i,:,1);k(t,:,1)];
+ if(noof1(z,0)==0 & noof1(z,1)>1)
+ k(i,:,2)=[1 1 1 1];
+ k(t,:,2)=[1 1 1 1];
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(in) '''']);
+ bi = strcat([bi " + "]);
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(in)]);
+ bi = strcat([bi " + "]);
+ break;
+ end
+ end
+ end
+ end
+end
+ for j=1:n
+ if(j==4)
+ t=1;
+ else
+ t=j+1;
+ end
+ z=[k(:,j,1) k(:,t,1)];
+ if(noof1(z,0)==0 & noof1(z,1)>0)
+ k(:,j,2)=[1;1;1;1];
+ k(:,t,2)=[1;1;1;1];
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(2+in) '''']);
+ bi = strcat([bi " + "]);
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(2+in)]);
+ bi = strcat([bi " + "]);
+ break;
+ end
+ end
+ end
+ end
+ end
+ //checking the 4 cells cases
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for t=1:n
+ z=k(t,:,1);
+ no=noof1(k(t,:,2),1);
+ if(noof1(z,0)==0 & no<cmn4 & noof1(z,1)>0)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ bi = strcat([bi var(in) '''']);
+ end
+ if(a(in)=='1')
+ bi = strcat([bi var(in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ for t=1:n
+ z=k(:,t,1);
+ no=noof1(k(:,t,2),1);
+ if(noof1(z,0)==0 & no<cmn4 & noof1(z,1)>0)
+ k(:,t,2)=z2;
+ a=strsplit(temp2(t,1));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ bi = strcat([bi var(2+in) '''']);
+ end
+ if(a(in)=='1')
+ bi = strcat([bi var(2+in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof1(z5,1);
+ if(noof1(z4,0)==0 & no<cmn4 & noof1(z4,1)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi ,var(in) '''']);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(in)]);
+ end
+ end
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi ,var(2+in) '''']);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(2+in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ //2 cells
+ z6=[1 1];
+ z7=z6';
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof1(z9,1);
+ if(noof1(z8,0)==0 & no1<cmn2 & noof1(z8,1)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi p1(1,i)]);
+ bi = strcat([bi ,var(2+in) '''']);
+ bi = strcat([bi " + "]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi p1(1,i)]);
+ bi = strcat([bi var(2+in)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof1(z11,1);
+ if(noof1(z10,0)==0 & no2<cmn2 & noof1(z10,1)>0)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi var(in) '''']);
+ bi = strcat([bi " + "]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi var(in)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ end
+ end
+ //checking the single cell cases
+ for i=1:n
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp2(i,1));
+ for in=1:max(size(a(:,1)))
+ if(a(in,1)=='1')
+ bi = strcat([bi var(in+2)]);
+ else
+ if(a(in,1)=='0')
+ bi = strcat([bi var(2+in) '''']);
+ end
+ end
+ end
+ for in=1:max(size(b(:,1)))
+ if(b(in,1)=='1')
+ bi = strcat([bi var(in)]);
+ else
+ if(b(in,1)=='0')
+ bi = strcat([bi var(in) '''']);
+ end
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ bi = strcat([bi "0 "]);
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmap.sci b/45/DEPENDENCIES/kmap.sci
new file mode 100755
index 000000000..ba8b7c0c9
--- /dev/null
+++ b/45/DEPENDENCIES/kmap.sci
@@ -0,0 +1,283 @@
+
+//this funtion prints the minimal expression of a given 4-vriable kmap
+//this program requires noof.sci
+function []=kmap(k)
+ n=4;
+ k(:,:,2)=zeros(n,n);
+ var=['A' 'B' 'C' 'D'];
+p1=['A''B''' 'A''B' 'AB' 'AB''']
+p2=['C''D''';'C''D';'CD';'CD'''];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ disp(k(:,:,1));
+ disp("is :");
+ disp(" ")
+ //checking for 16 cells
+ for i=1:n
+ for j=1:n
+ if(k(i,j)~=1)
+ temp=0;
+ break;
+ end
+ end
+ end
+ printf(' ');
+ if(temp==1)
+ printf("1");
+ abort;
+ end
+ //checking 8 cells cases
+ z1=ones(2,4);
+ z2=ones(4,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for i=1:n
+ if(i==4)
+ t=1;
+ else
+ t=i+1;
+ end
+ z=[k(i,:,1);k(t,:,1)];
+ if(z==z1)
+ k(i,:,2)=[1 1 1 1];
+ k(t,:,2)=[1 1 1 1];
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(in));
+ printf(' + ');
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf(var(in));
+ printf(' + ');
+ break;
+ end
+ end
+ end
+ end
+ end
+ for j=1:n
+ if(j==4)
+ t=1;
+ else
+ t=j+1;
+ end
+ z=[k(:,j,1) k(:,t,1)];
+ if(z==z2)
+ k(:,j,2)=[1;1;1;1];
+ k(:,t,2)=[1;1;1;1];
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(2+in));
+ printf(' + ');
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf(var(2+in));
+ printf(' + ');
+ break;
+ end
+ end
+ end
+ end
+ end
+ //checking all 4 cells cases
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for t=1:n
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(z==z1 & no<cmn4)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ printf('%s''',var(in));
+ end
+ if(a(in)=='1')
+ printf(var(in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ for t=1:n
+ z=k(:,t,1);
+ no=noof(k(:,t,2));
+ if(z==z2 & no<cmn4)
+ k(:,t,2)=z2;
+ a=strsplit(temp2(t,1));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ printf('%s''',var(2+in));
+ end
+ if(a(in)=='1')
+ printf(var(2+in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(z4==z3 & no<cmn4)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(var(in));
+ end
+ end
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(2+in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(var(2+in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ end
+ //checking all 2 cells cases
+ z6=[1 1];
+ z7=z6';
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(z8==z6 & no1<cmn2 )
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p1(1,i));
+ printf('%s''',var(2+in));
+ printf(" + ");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p1(1,i));
+ printf(var(2+in));
+ printf(" + ");
+ end
+ end
+ end
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(z10==z7 & no2<cmn2)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p2(j,1));
+ printf('%s''',var(in));
+ printf(" + ");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p2(j,1));
+ printf(var(in));
+ printf(" + ");
+ end
+ end
+ end
+ end
+ end
+ //checking for isolated cell
+ for i=1:n
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp2(i,1));
+ for in=1:max(size(a(:,1)))
+ if(a(in,1)=='1')
+ printf(var(in+2));
+ else
+ if(a(in,1)=='0')
+ printf('%s''',var(2+in));
+ end
+ end
+ end
+ for in=1:max(size(b(:,1)))
+ if(b(in,1)=='1')
+ printf(var(in));
+ else
+ if(b(in,1)=='0')
+ printf('%s''',var(in));
+ end
+ end
+ end
+ if(i~=4 & j~=4)
+ printf(" + ");
+ end
+ end
+ end
+ end
+ printf("0");
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmap2.sci b/45/DEPENDENCIES/kmap2.sci
new file mode 100755
index 000000000..913e42bca
--- /dev/null
+++ b/45/DEPENDENCIES/kmap2.sci
@@ -0,0 +1,59 @@
+//this function minimizes a two vriable boolean expression using kmap
+function bi =kmap2(k)
+var=['A''B''' 'A''B' 'AB' 'AB''']
+temp =1
+for i=1:2 // intially checking for all 1's
+ for j=1:2
+ if k(i,j)==1 then
+ temp = temp + 1;
+ end
+ end
+end
+v=0;
+bi = ' ' ;
+if temp == 5 then
+ disp("The minimal expression is : 1');
+ v=1;
+else
+for i= 1 : 2 // considering all 2 1's cases
+ if k(i,1) == 1 & k(i,2) == 1 then
+ if i== 1 then
+ bi = strcat([ bi 'A'''] );v=1;
+ else
+ bi = strcat([ bi 'A']);v=1;
+ end
+ bi = strcat([ bi " + " ]);
+ end
+ if k(1,i) == 1 & k(2,i) == 1 then
+ if i== 1 then
+ bi = strcat([ bi 'B'''] );v=1;
+ else
+ bi = strcat([ bi 'B']);v=1;
+ end
+ end
+end
+end;
+one(1)=k(2,1);
+f=2;m=2;i=1;
+ for j=1:2
+ one(f)=k(i,j)
+ f=f+1;
+ end
+ i=2;
+ for j=2:-1:1
+ one(f)=k(i,j)
+ f=f+1;
+ end
+one(6)=k(1,1);
+if v==0 then // for isolated 1's
+ for i =2:5
+ if one(i)==1 & one(i+1)== 0 & one(i-1) ==0 then
+ if m>0
+ bi = strcat([bi " + "]);
+ end;
+ bi = strcat([bi var(i-1)]);
+ m=m+1;
+ end
+ end
+end
+endfunction // final result will be stored in bi \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmap3.sci b/45/DEPENDENCIES/kmap3.sci
new file mode 100755
index 000000000..00ee0cb76
--- /dev/null
+++ b/45/DEPENDENCIES/kmap3.sci
@@ -0,0 +1,150 @@
+//3-VARIABLE KMAP
+//this function returns the a string containing the minimized expression for the given 3 variable kmap
+//this function requires
+//noof.sci
+//noof0.sci
+function bi = kmap3(k)
+ n=4;
+ m=2
+k(:,:,2)=zeros(m,n);
+ var=['Cn' 'Bn' 'An'];
+ p1=['Cn''' 'Cn'];
+ p2=['Bn''An''';'Bn''An';'BnAn';'BnAn'''];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ disp(k(:,:,1));
+bi = ' ';
+//checking all the 8 1's cases
+ for i=1:m
+ for j=1:n
+ if(k(i,j)~=1 & k(i,j)~=2)
+ temp=0;
+ break;
+ end
+ end
+ end
+ if(temp==1)
+ bi = strcat([bi "1"]);
+ return;
+ end
+//checking all the 4 1's cases
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['0' '1'];
+ temp2=['00';'01';'11';'10'];
+ for t=1:m
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(noof0(z)==0 & no<cmn4 & noof(z)>0)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ bi = strcat([bi var(in) '''']);
+ end
+ if(a(in)=='1')
+ bi = strcat([bi var(in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(noof0(z4)==0 & no<cmn4 & noof(z4)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''' ]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+
+ end
+ end
+ end
+ //checking all the 2 1's cases
+ z6=[1 1];
+ z7=z6';
+ for i=1:m
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(noof0(z8)==0 & no1<cmn2 & noof(z8)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ bi = strcat([bi p1(1,i)]);
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''']);
+ bi = strcat([bi " + "]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(noof0(z10)==0 & no2<cmn2 & noof(z10)>0)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ //checking if any single isolated 1's are left
+ for i=1:m
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ bi = strcat([bi p1(1,i)]);
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ bi = strcat([bi " 0 "]);
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmap3a.sci b/45/DEPENDENCIES/kmap3a.sci
new file mode 100755
index 000000000..f0ebf3808
--- /dev/null
+++ b/45/DEPENDENCIES/kmap3a.sci
@@ -0,0 +1,152 @@
+
+ //3-VARIABLE KMAP
+//this function returns the a string containing the minimized expression for the given 3 variable kmap
+//this function requires
+//noof.sci
+//noof0.sci
+function bi = kmap3a(k)
+ n=4;
+ m=2
+k(:,:,2)=zeros(m,n);
+ var=['An' 'X' 'Y'];
+ p1=['An''' 'An'];
+ p2=['X''Y''';'X''Y';'XY';'XY'''];
+
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ disp(k(:,:,1));
+bi = ' ';
+//checking all the 8 1's cases
+ for i=1:m
+ for j=1:n
+ if(k(i,j)~=1 & k(i,j)~=2)
+ temp=0;
+ break;
+ end
+ end
+ end
+ if(temp==1)
+ bi = strcat([bi "1"]);
+ return;
+ end
+//checking all the 4 1's cases
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['0' '1'];
+ temp2=['00';'01';'11';'10'];
+ for t=1:m
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(noof0(z)==0 & no<cmn4 & noof(z)>0)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ bi = strcat([bi var(in) '''']);
+ end
+ if(a(in)=='1')
+ bi = strcat([bi var(in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(noof0(z4)==0 & no<cmn4 & noof(z4)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''' ]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+
+ end
+ end
+ end
+ //checking all the 2 1's cases
+ z6=[1 1];
+ z7=z6';
+ for i=1:m
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(noof0(z8)==0 & no1<cmn2 & noof(z8)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ bi = strcat([bi p1(1,i)]);
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''']);
+ bi = strcat([bi " + "]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(noof0(z10)==0 & no2<cmn2 & noof(z10)>0)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ //checking if any single isolated 1's are left
+ for i=1:m
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ bi = strcat([bi p1(1,i)]);
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ bi = strcat([bi " 0 "]);
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmap3abx.sci b/45/DEPENDENCIES/kmap3abx.sci
new file mode 100755
index 000000000..92e7df0bd
--- /dev/null
+++ b/45/DEPENDENCIES/kmap3abx.sci
@@ -0,0 +1,159 @@
+//3-VARIABLE KMAP
+//uses noof.sci and noof0.sci
+//above two functions should be executed before executing this function .
+function bi = kmap3abx(k)
+ n=4;
+ m=2
+
+//k=[0 0 0 1;
+ // 0 1 1 1];
+k(:,:,2)=zeros(m,n);
+ var=['x' 'A' 'B'];
+ //var=['w' 'x' 'y' 'z'];
+ p1=['x''' 'x'];
+ p2=['A''B''';'A''B';'AB';'AB'''];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ // printf('The minimal ecpression of the given Kmap ');
+ disp(k(:,:,1));
+ //disp("is :");
+ //printf('f');
+ // printf("=");
+
+ bi = ' ';
+ //8 cells
+ for i=1:m
+ for j=1:n
+ if(k(i,j)~=1 & k(i,j)~=2)
+ temp=0;
+ break;
+ end
+ end
+ end
+ if(temp==1)
+ bi = strcat([bi "1"]);
+ return;
+ end
+ //4 cells
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['0' '1'];
+ temp2=['00';'01';'11';'10'];
+ for t=1:m
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(noof0(z)==0 & no<cmn4 & noof(z)>0)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ bi = strcat([bi var(in) '''']);
+ end
+ if(a(in)=='1')
+ bi = strcat([bi var(in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(noof0(z4)==0 & no<cmn4 & noof(z4)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''' ]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ end
+ end
+ bi = strcat([bi " + "]);
+
+ end
+ end
+ end
+ //2 cells
+ z6=[1 1];
+ z7=z6';
+ for i=1:m
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(noof0(z8)==0 & no1<cmn2 & noof(z8)>0)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ bi = strcat([bi p1(1,i)]);
+ a=strsplit(temp2(j,1));
+ b=strsplit(temp2(t2,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ bi = strcat([bi var(1+in) '''']);
+ bi = strcat([bi " + "]);
+ end
+ if(c(in)==0 & a(in)=='1')
+ bi = strcat([bi var(1+in)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ end
+ end
+ for i=1:m-1
+ for j=1:n
+ t1=i+1;
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(noof0(z10)==0 & no2<cmn2 & noof(z10)>0)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ //single cell
+ for i=1:m
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ bi = strcat([bi p1(1,i)]);
+ bi = strcat([bi p2(j,1)]);
+ bi = strcat([bi " + "]);
+ end
+ end
+ end
+ bi = strcat([bi " 0 "]);
+ //disp(" ")
+
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmappos.sci b/45/DEPENDENCIES/kmappos.sci
new file mode 100755
index 000000000..ec39b107d
--- /dev/null
+++ b/45/DEPENDENCIES/kmappos.sci
@@ -0,0 +1,332 @@
+//this funtion prints the minimal expression in the Pruduct of sums form for a given 4-vriable kmap
+//this program requires noof.sci
+function []=kmappos(k)
+ n=4;
+ k(:,:,2)=zeros(n,n);
+ var=['A' 'B' 'C' 'D'];
+p1=['A + B' 'A + B''' 'A'' + B''' 'A'' + B'];
+p2=['C + D';'C + D''';'C'' + D''';'C'' + D'];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ disp(k(:,:,1));
+ disp("is :");
+ disp(" ")
+ //checking for 16 cells
+ for i=1:n
+ for j=1:n
+ if(k(i,j)~=1)
+ temp=0;
+ break;
+ end
+ end
+ end
+ printf(' ');
+ if(temp==1)
+ printf("1");
+ abort;
+ end
+ for i=1:n
+ for j=1:n
+ if(k(i,j)~=0)
+ temp=0;
+ break;
+ end
+ end
+ end
+ printf(' ');
+ if(temp==1)
+ printf("0");
+ abort;
+ end
+
+ //checking for 8 cells cases
+ z1=zeros(2,4);
+ z2=zeros(4,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for i=1:n
+ if(i==4)
+ t=1;
+ else
+ t=i+1;
+ end
+ z=[k(i,:,1);k(t,:,1)];
+ if(z==z1)
+ printf('(');
+ k(i,:,2)=[1 1 1 1];
+ k(t,:,2)=[1 1 1 1];
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(var(in));
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf('%s''',var(in));
+ break;
+ end
+ end
+ end
+ printf(')');
+ end
+ end
+ for j=1:n
+ if(j==4)
+ t=1;
+ else
+ t=j+1;
+ end
+ z=[k(:,j,1) k(:,t,1)];
+ if(z==z2)
+ printf('(');
+ k(:,j,2)=[1;1;1;1];
+ k(:,t,2)=[1;1;1;1];
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(var(2+in));
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf('%s''',var(2+in));
+ break;
+ end
+ end
+ end
+ printf(')')
+ end
+ end
+ //checking for 4 cells cases
+ z1=zeros(1,4);
+ z2=zeros(4,1);
+ z3=zeros(2,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for t=1:n
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(z==z1 & no<cmn4)
+ printf('(')
+ k(t,:,2)=[1 1 1 1];
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ if in ~= 1 then
+ printf(' + ');
+ end
+ printf(var(in));
+ end
+ if(a(in)=='1')
+ if in ~= 1 then
+ printf(' + ');
+ end
+ printf('%s''',var(in));
+ end
+ end
+ printf(")");
+ end
+ end
+ for t=1:n
+ z=k(:,t,1);
+ no=noof(k(:,t,2));
+ if(z==z2 & no<cmn4)
+ printf('(');
+ k(:,t,2)=[1;1;1;1];
+ a=strsplit(temp2(t,1));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ if in ~= 1 then
+ printf(' + ');
+ end
+ printf(var(2+in));
+ end
+ if(a(in)=='1')
+ if in ~= 1 then
+ printf(' + ');
+ end
+ printf('%s''',var(2+in));
+ end
+ end
+ printf(")");
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(z4==z3 & no<cmn4)
+ printf('(')
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(var(in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf('%s''',var(in));
+ end
+ end
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(' + ');
+ printf(var(2+in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(' + ');
+ printf('%s''',var(2+in));
+
+ end
+ end
+ printf(")");
+ end
+ end
+ end
+ //checking for 2 cells
+ z6=[0 0];
+ z7=z6';
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(z8==z6 & no1<cmn2 )
+
+ printf('(');
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p1(1,i));
+ printf(' + ');
+ printf(var(2+in));
+ printf(")");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p1(1,i));
+ printf(" + ");
+ printf('%s''',var(2+in));
+
+ printf(")");
+ end
+ end
+ end
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(z10==z7 & no2<cmn2)
+ printf('(');
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p2(j,1));
+ printf(" + ");
+ printf(var(in));
+ printf(")");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p2(j,1));
+ printf(" + ");
+ printf('%s''',var(in));
+
+ printf(")");
+ end
+ end
+ end
+ end
+ end
+ //for single cell
+ for i=1:n
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==0)
+ printf('(');
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp2(i,1));
+ for in=1:max(size(a(:,1)))
+ if(a(in,1)=='1')
+ printf('%s''',var(2+in));
+ printf(' + ');
+ else
+ if(a(in,1)=='0')
+ printf(var(in+2));
+
+ printf(' + ');
+ end
+ end
+ end
+ for in=1:max(size(b(:,1)))
+ if(b(in,1)=='1')
+ printf('%s''',var(in));
+ if(in~=max(size(b(:,1))))
+ printf(' + ');
+ end
+ else
+ if(b(in,1)=='0')
+ printf(var(in));
+
+ if(in~=max(size(b(:,1))))
+ printf(' + ');
+ end
+
+ end
+ end
+ end
+ printf(")");
+ end
+ end
+ end
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/kmapsx.sci b/45/DEPENDENCIES/kmapsx.sci
new file mode 100755
index 000000000..429925521
--- /dev/null
+++ b/45/DEPENDENCIES/kmapsx.sci
@@ -0,0 +1,285 @@
+function []=kmapsx(k) // this fnctions prints the minimied expression for the given kmap .
+// it requires noof.sci
+//so the above mentioned function shoub be execute before executing this function .
+
+ n=4;
+ k(:,:,2)=zeros(n,n);
+ var=['X2' 'X3' 'S' 'X1'];
+
+p1=['X2''X3''' 'X2''X3' 'X2X3' 'X2X3'''];
+p2=['S''X1''';'S''X1';'SX1';'SX1'''];
+ cmn4=4;
+ cmn2=2;
+ temp=1;
+ disp(k(:,:,1));
+ disp("is :");
+ disp(" ")
+ //checking the 16 cells case
+ for i=1:n
+ for j=1:n
+ if(k(i,j)~=1)
+ temp=0;
+ break;
+ end
+ end
+ end
+ printf(' ');
+ if(temp==1)
+ printf("1");
+ abort;
+ end
+ //checking the 8 cells cases
+ z1=ones(2,4);
+ z2=ones(4,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for i=1:n
+ if(i==4)
+ t=1;
+ else
+ t=i+1;
+ end
+ z=[k(i,:,1);k(t,:,1)];
+ if(z==z1)
+ k(i,:,2)=[1 1 1 1];
+ k(t,:,2)=[1 1 1 1];
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(in));
+ printf(' + ');
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf(var(in));
+ printf(' + ');
+ break;
+ end
+ end
+ end
+ end
+ end
+ for j=1:n
+ if(j==4)
+ t=1;
+ else
+ t=j+1;
+ end
+ z=[k(:,j,1) k(:,t,1)];
+ if(z==z2)
+ k(:,j,2)=[1;1;1;1];
+ k(:,t,2)=[1;1;1;1];
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(2+in));
+ printf(' + ');
+ break;
+ else
+ if(c(in)==0 & a(in)=='1')
+ printf(var(2+in));
+ printf(' + ');
+ break;
+ end
+ end
+ end
+ end
+ end
+ //checking the 4 cells cases
+ z1=ones(1,4);
+ z2=ones(4,1);
+ z3=ones(2,2);
+ temp1=['00' '01' '11' '10'];
+ temp2=temp1';
+ for t=1:n
+ z=k(t,:,1);
+ no=noof(k(t,:,2));
+ if(z==z1 & no<cmn4)
+ k(t,:,2)=z1;
+ a=strsplit(temp1(1,t));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ printf('%s''',var(in));
+ end
+ if(a(in)=='1')
+ printf(var(in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ for t=1:n
+ z=k(:,t,1);
+ no=noof(k(:,t,2));
+ if(z==z2 & no<cmn4)
+ k(:,t,2)=z2;
+ a=strsplit(temp2(t,1));
+ for in=1:max(size(a))
+ if(a(in)=='0')
+ printf('%s''',var(2+in));
+ end
+ if(a(in)=='1')
+ printf(var(2+in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z4=[k(i,j,1) k(i,t2,1);k(t1,j,1) k(t1,t2,1)];
+ z5=[k(i,j,2) k(i,t2,2);k(t1,j,2) k(t1,t2,2)];
+ no=noof(z5);
+ if(z4==z3 & no<cmn4)
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ k(t1,j,2)=1;
+ k(t1,t2,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(var(in));
+ end
+ end
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf('%s''',var(2+in));
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(var(2+in));
+ end
+ end
+ printf(" + ");
+ end
+ end
+ end
+ //checking all the 2 cells cases
+ z6=[1 1];
+ z7=z6';
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z8=[k(i,j,1) k(i,t2,1)];
+ z9=[k(i,j,2) k(i,t2,2)];
+ no1=noof(z9);
+ if(z8==z6 & no1<cmn2 )
+ k(i,j,2)=1;
+ k(i,t2,2)=1;
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp1(1,t2));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p1(1,i));
+ printf('%s''',var(2+in));
+ printf(" + ");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p1(1,i));
+ printf(var(2+in));
+ printf(" + ");
+ end
+ end
+ end
+ end
+ end
+ for i=1:n
+ for j=1:n
+ if(i==n)
+ t1=1;
+ else
+ t1=i+1;
+ end
+ if(j==n)
+ t2=1;
+ else
+ t2=j+1;
+ end
+ z10=[k(i,j,1);k(t1,j,1)];
+ z11=[k(i,j,2);k(t1,j,2)];
+ no2=noof(z11);
+ if(z10==z7 & no2<cmn2)
+ k(i,j,2)=1;
+ k(t1,j,2)=1;
+ a=strsplit(temp2(i,1));
+ b=strsplit(temp2(t1,1));
+ c=strcmp(a,b);
+ for in=1:max(size(c))
+ if(c(in)==0 & a(in)=='0')
+ printf(p2(j,1));
+ printf('%s''',var(in));
+ printf(" + ");
+ end
+ if(c(in)==0 & a(in)=='1')
+ printf(p2(j,1));
+ printf(var(in));
+ printf(" + ");
+ end
+ end
+ end
+ end
+ end
+ // checking all the single cell cases
+ for i=1:n
+ for j=1:n
+ if(k(i,j,2)==0 & k(i,j,1)==1)
+ a=strsplit(temp1(1,j));
+ b=strsplit(temp2(i,1));
+ for in=1:max(size(a(:,1)))
+ if(a(in,1)=='1')
+ printf(var(in+2));
+ else
+ if(a(in,1)=='0')
+ printf('%s''',var(2+in));
+ end
+ end
+ end
+ for in=1:max(size(b(:,1)))
+ if(b(in,1)=='1')
+ printf(var(in));
+ else
+ if(b(in,1)=='0')
+ printf('%s''',var(in));
+ end
+ end
+ end
+ if(i~=4 & j~=4)
+ printf(" + ");
+ end
+ end
+
+ end
+ end
+ printf("0");
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/noof.sci b/45/DEPENDENCIES/noof.sci
new file mode 100755
index 000000000..126e1d8c0
--- /dev/null
+++ b/45/DEPENDENCIES/noof.sci
@@ -0,0 +1,10 @@
+function res=noof(a) // this function returns the no of 1's in the given matrrix
+ res=0;
+ for i=1:max(size(a(:,1)))
+ for j=1:max(size(a(1,:)))
+ if(a(i,j)==1)
+ res=res+1;
+ end
+ end
+ end
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/noof0.sci b/45/DEPENDENCIES/noof0.sci
new file mode 100755
index 000000000..e2a539263
--- /dev/null
+++ b/45/DEPENDENCIES/noof0.sci
@@ -0,0 +1,10 @@
+function res=noof0(a) // to find the no of zeros in given matrix
+ res=0;
+ for i=1:max(size(a(:,1)))
+ for j=1:max(size(a(1,:)))
+ if(a(i,j)==0)
+ res=res+1;
+ end
+ end
+ end
+endfunction \ No newline at end of file
diff --git a/45/DEPENDENCIES/noof1.sci b/45/DEPENDENCIES/noof1.sci
new file mode 100755
index 000000000..85008cfcc
--- /dev/null
+++ b/45/DEPENDENCIES/noof1.sci
@@ -0,0 +1,10 @@
+function res=noof1(a,z) //this function returns both the no of zeros and ones in given matrix
+ res=0;
+ for i=1:max(size(a(:,1)))
+ for j=1:max(size(a(1,:)))
+ if(a(i,j)==z)
+ res=res+1;
+ end
+ end
+ end
+endfunction \ No newline at end of file