36.
What is the value of x after each of these statements is
encountered in a computer program, if x = 1 before the
statement is reached?
a
) if 1 + 2 = 3 then x := x + 1
b)
if ( 1 + 1 = 3) OR (2 + 2 = 3) then x := x + 1
c)
if (2 + 3 = 5) AND (3 + 4 = 7) then x := x + 1
d)
if ( 1 + 1 = 2) XOR ( 1 + 2 = 3) then x := x + 1
e
) if x < 2 then x := x + 1
37.
Find the bitwise OR, bitwise AND, and bitwise XOR of
each of these pairs of bit strings.
a
) 1 0 1 1 1 1 0, 0 1 0 000 1
b)
1 1 1 1 0000, 1 0 1 0 1 0 1 0
c)
00 0 1 1 1 000 1 , 1 0 0 1 00 1 000
d)
1 1 1 1 1 1 1 1 1 1 , 00 0000 0000
38.
Evaluate each of these expressions.
a
) I 1 000 /\ (0 1 0 1 1 v 1 1 0 1 1 )
b )
(0 1 1 1 1 /\ 1 0 1 0 1 ) v 0 1 000
c)
(0 1 0 1 0 tIJ 1 1 0 1 1 ) tIJ 0 1 000
d) ( 1 1 0 1 1 v 0 1 0 1 0) /\ ( 1 000 1 v 1 1 0 1 1 )