boolean logic Flashcards

(39 cards)

1
Q

What is Boolean logic?

A

A form of algebra where all values are either true or false.

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

True or False: Boolean logic is used in computer programming.

A

True

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

What are the basic operations in Boolean logic?

A

AND, OR, NOT

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

Fill in the blank: The result of an AND operation is true if ______.

A

both operands are true

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

What does the OR operation do in Boolean logic?

A

It returns true if at least one operand is true.

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

True or False: In Boolean logic, NOT is a unary operator.

A

True

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

What is the output of A AND B if A is true and B is false?

A

false

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

What is the output of A OR B if A is false and B is false?

A

false

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

True or False: The NOT operator inverts the value of its operand.

A

True

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

What is the result of NOT true?

A

false

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

How many possible outcomes are there for a two-input AND operation?

A

Four

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

Fill in the blank: The expression A AND (B OR C) is an example of ______.

A

distributive law

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

What does the truth table for the AND operation look like?

A

true, true = true; true, false = false; false, true = false; false, false = false

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

Which operation is represented by the symbol ‘∧’?

A

AND

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

Which operation is represented by the symbol ‘∨’?

A

OR

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

What is De Morgan’s Theorem?

A

It states that NOT (A AND B) is equivalent to (NOT A) OR (NOT B) and NOT (A OR B) is equivalent to (NOT A) AND (NOT B).

17
Q

True or False: A NAND operation is the opposite of an AND operation.

18
Q

What is the output of A NAND B if both A and B are true?

19
Q

What does the XOR operation do?

A

It returns true if exactly one operand is true.

20
Q

True or False: The XOR operation is commutative.

21
Q

What is the output of A XOR B if A is true and B is false?

22
Q

Fill in the blank: The operation A NOR B is equivalent to NOT (A OR B) and is ______.

23
Q

What is the output of A NOR B if both A and B are false?

24
Q

What is an example of a real-world application of Boolean logic?

A

Search engines use Boolean logic to filter search results.

25
True or False: Boolean logic can only be used in digital circuits.
False
26
What is a truth table?
A table that shows all possible values of logical expressions.
27
Fill in the blank: Boolean algebra is used to simplify ______.
logical expressions
28
Which logic gate corresponds to the AND operation?
AND gate
29
Which logic gate corresponds to the OR operation?
OR gate
30
What is the primary purpose of using Boolean logic in programming?
To control the flow of execution based on conditions.
31
True or False: The output of an OR operation is false only when both inputs are false.
True
32
What is the output of A AND B AND C if A is true, B is true, and C is false?
false
33
Fill in the blank: A logical expression can be represented using ______.
Boolean variables
34
What is a common use of Boolean logic in databases?
To perform queries with conditions.
35
True or False: In Boolean logic, the expression A AND NOT B is always true.
False
36
What is the result of A OR NOT A?
true
37
Fill in the blank: The operation A AND B is also known as ______.
conjunction
38
What does the term 'complement' refer to in Boolean logic?
The opposite value of a Boolean variable.
39
True or False: Boolean logic is foundational for computer science.
True