diff options
Diffstat (limited to '45/CH2/EX2.2')
-rwxr-xr-x | 45/CH2/EX2.2/2_2.jpg | bin | 0 -> 28070 bytes | |||
-rwxr-xr-x | 45/CH2/EX2.2/example_2_2.sce | 40 |
2 files changed, 40 insertions, 0 deletions
diff --git a/45/CH2/EX2.2/2_2.jpg b/45/CH2/EX2.2/2_2.jpg Binary files differnew file mode 100755 index 000000000..26f788c09 --- /dev/null +++ b/45/CH2/EX2.2/2_2.jpg 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 |