diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /45/CH8/EX8.4/example_8_4.sce | |
download | Scilab-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/CH8/EX8.4/example_8_4.sce')
-rwxr-xr-x | 45/CH8/EX8.4/example_8_4.sce | 21 |
1 files changed, 21 insertions, 0 deletions
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 |