Computational logic 2 Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

boolean statements and truth tables

A

a boolean statement such as P = A AND B implies that P is only true if both A and B are true

it can be investigated using a truth table

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

using boolean statements to solve problems

A

boolean statements can be used to represent selection using relational operators used in programs

the statement:
if X == 9 AND Y == 6 then
is the same as P = A AND B/ an AND gate

the statement:
if X != 9 AND Y != 6 then
is equal to P = (NOT A) AND (NOT B)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Complete the truth table for the Boolean expression P = NOT(A AND B) [4]

A            B            P
FALSE    FALSE   
FALSE    TRUE
TRUE      FALSE
TRUE                    FALSE
A

B: TRUE
P: TRUE, TRUE, TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Complete the truth table for the Boolean expression P = (NOT A) AND (NOT B) [4]

A            B            P
FALSE    FALSE   
FALSE    TRUE
TRUE      FALSE
TRUE                    FALSE
A

B: TRUE
P: TRUE, FALSE, FALSE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

a) Complete a logic diagram for the equation P + NOT(A) AND B [2]
b) Complete the truth table for the logic circuit [3]

A    B    P
0    0    0
?
?
?
A

a) input A into NOT gate that feeds into an AND gate

other input for AND gate is B

output for AND gate is P

b) 
A    B    P
0    0    0
0     1     1
1     0    0
1      1    0
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

An alarm system uses three switches. The alarm will sound if either switch A or switch B are in the ON position but only if the master switch C is in the ON position.
Draw a logic diagram and truth table for this system. [5]

A

inputs A and B into an OR gate that leads into an AND gate, the other input is C and the output is Q

A    B    C    Q
0    0    0     0
0    0     1     0
0     1    0     0
0     1     1      1
1     0    0     0
1     0     1      1
1     1     0     0
1     1      1      1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly