logical operations Flashcards
go through questions
go through questions
Boolean values
False or True
0 or 1
What does the AND function return
Returns true (1) if both values are true(1), otherwise returns false (0)
What does the symbol for the AND function look like
D shape
What does the OR function return
Returns true(1) if either values are true(1), returns false if both values are false
What does the symbol for the OR function look like
Moon crest
What does the NOT function return
Only takes one input (unlike the others) and reverses it
What does the symbol for the NOT function look like
Sideways triangle
What does the NAND function return
NOT AND
Returns false(0) only if both values are true(1), otherwise returns true(1)
Carries out an AND operation and performs a NOT on the result (reverses it)
What does the NAND symbol look like
D symbol with tiny circle on output
What does NOR output
Returns true (1) if both values are false(0), returns false(0) if either values are true(1)
Carries out an OR operation then performs a NOT on the result (reverses it)
What does a XOR output
Exclusive OR
Same as OR, returns 1 if either value is 1
However does not return 1 if both values are 1
What does XOR symbol look like
moon crest with parallel curvy line on left
How do bitwise operations work
Bitwise operations work by applying the operation successfully to each pair of binary digits
How is OR written in boolean algebra
+
How is AND written in boolean algebra
.
How is not represented in boolean algebra
Overlining the letter
_
X
Logical operations in control systems
Bits are used to represent on/off
Can be changed using AND, OR, XOR operations
each bit of a register or registers is linked (usually wiring) to a device
If a bit has a 1 entered then this could cause the particular device attached to be turned on, a 0 could be used to turn it off.
What is masking
Masking always uses AND
It is used to check the values of particular bits
How do you clear a register
ANDing with 0 always set the value to 0
How do you reverse bits
XOR reverses the bits
How do you encrypt words using XOR, AND etc.
E.g. encrypt BAD using XOR
Using an symmetric encryption/decryption key e.g. 01110010
BAD = 01000010 01000001 01000100
XOR XOR XOR
Key = 01110010 01110010 00110110
=48 =51 =54
Encrypted word is : 036
What formate can AND be written in
A AND B
A.B
AB
A()
What formats can OR be written in
A OR B
A+B