summaryrefslogtreecommitdiff
path: root/3860/CH2/EX2.1/Ex2_1.sce
blob: 70b1a830346a5d2b35da5ae8f1831cd916d21e8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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.")