summaryrefslogtreecommitdiff
path: root/3860/CH2/EX2.1/Ex2_1.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /3860/CH2/EX2.1/Ex2_1.sce
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '3860/CH2/EX2.1/Ex2_1.sce')
-rw-r--r--3860/CH2/EX2.1/Ex2_1.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/3860/CH2/EX2.1/Ex2_1.sce b/3860/CH2/EX2.1/Ex2_1.sce
new file mode 100644
index 000000000..70b1a8303
--- /dev/null
+++ b/3860/CH2/EX2.1/Ex2_1.sce
@@ -0,0 +1,19 @@
+//Example 2.1: Develop truth table for a system with three inputs a,b and c and four outputs w,x,y and z
+clc // Clears the console
+disp("Develop truth table for a system with three inputs a,b and c and four outputs w,x,y and z")
+disp("Given conditions")
+disp("a = 0: odd a = 1: even")
+disp("b = 0: prime b = 1: not prime")
+disp("c = 0: less than 8 c = 1: greater than or equal to 8")
+disp("some input may never occur; the ouput is never all 0")
+disp("Inputs | Outputs")
+disp("A B C | W X Y Z")
+disp("0 0 0 | 0 1 1 1")
+disp("0 0 1 | 1 1 0 1")
+disp("0 1 0 | X X X X")
+disp("0 1 1 | 1 1 1 1")
+disp("1 0 0 | 0 0 1 0")
+disp("1 0 1 | X X X X")
+disp("1 1 0 | 0 1 1 0")
+disp("1 1 1 | 1 1 1 0")
+disp("The above table satisfies the given conditions.")