summaryrefslogtreecommitdiff
path: root/45/CH9
diff options
context:
space:
mode:
Diffstat (limited to '45/CH9')
-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
7 files changed, 206 insertions, 0 deletions
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