summaryrefslogtreecommitdiff
path: root/978/CH3/EX3.5/Example3_5.sce
blob: f3d3a872ab2999129bd282ea354bf2a33ceb7248 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//chapter-3,Example3_5,pg 488

//enter binary values only(1bit)

a=input("enter value of a")//input-1

b=input("enter value of b")//input-2

c=input("enter value of c")//input-3
    
x=bitcmp(bitand(a,b),1)

y=bitor(x,c)//final output

printf("\noutput\n")

printf("y=%.2f\n",y)

printf(" verify from truth table\n")

printf("a  b  c          y\n")

printf("0  0  0          1\n")

printf("0  0  1          1\n")

printf("0  1  0          1\n")

printf("0  1  1          1\n")

printf("1  0  0          1\n")

printf("1  0  1          1\n")

printf("1  1  0          0\n")

printf("1  1  1          1\n")