1.2 Logical operations Flashcards
What is a logical expression?
A BOOLEAN expression where the result is True or False.
What do logical operators do?
They join together logical expressions.
Name 4 logical operators.
- AND
- OR
- XOR
- NOT
What is a truth table?
A method of showing the inputs and outputs of a logical operator.
What represents true and false in a truth table?
True: 1
False: 0
How does OR work? (2)
- One input must be true for outcome to be true.
- Represented by a “+”
How does XOR work? (2)
- One input must be true for outcome to be true, but no more than one outcome can be true for output to be true.
- Represented by a “⊕”
How does NOT work? (2)
- Requires one input and the output is always opposite of input.
- Represented by an ‘
What is the order presence of the
these operators?
NOT → AND → OR
How are logical operators used in computing?
- Clearing Registers
- Masking
How are logical operators used in clearing registers?
A register can be cleared using an AND operation.
How are logical operators used in masking? (2)
- Using AND operators you can check to see if a certain bit in a sequence is a 1 or a 0.
- Using OR operators you could
set certain bits to one no matter what they were before.
What are Boolean laws for?
Simplifying Boolean expressions.
What is the commutative law?
Order is not important on either side of an operator.
What is the identity law?
Gets rid of redundant data.