summaryrefslogtreecommitdiff
path: root/45/CH2/EX2.2
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /45/CH2/EX2.2
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/CH2/EX2.2')
-rwxr-xr-x45/CH2/EX2.2/2_2.jpgbin0 -> 28070 bytes
-rwxr-xr-x45/CH2/EX2.2/example_2_2.sce40
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
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