You are on page 1of 8

Logical Operators

AND

• An AND gate outputs a (1) only when ALL of its inputs are (1).
• If A is 1 and B is 1 the Q will be 1
• It represents a logical "AND" operation. Imagine two switches in
series for a light: both need to be turned on (1) for the light (output)
to be on (1).
OR

• An OR gate outputs a (1) if ANY of its inputs are (1).


• If A is 1 OR B is 1 the Q will be 1
• It represents a logical "OR" operation. Think of two switches in
parallel for a light: either switch being on (1) is enough to turn on
the light (1).
NOT

• A NOT gate simply inverts the input. If the input is HIGH (1), the
output is LOW (0), and vice versa.
• If A is 1 , Q will be 0 and vice versa.
NAND

• A NAND gate acts like an AND gate followed by a NOT gate (inverts
the output). So, it outputs a (1) only when ALL inputs are (0),
otherwise the output is (0).
• You can view it as an "AND NOT" operation.
• If A is 1 and B is 1, Q will be 0
NOR

• A NOR gate works like an OR gate followed by a NOT gate. It outputs


a (1) only when ALL inputs are (0), otherwise the output is (0).
• It represents a logical "NOR" operation (basically the opposite of
OR).
• Example:
• If A is 1 and B is 0, Q will be 0
• If A is 0 and B is 0, Q will be 1

You might also like