Logic Gates

advertisement
Two inputs (A and B), when combined in an electrical circuit using an AND
Logic Gate will yield an output (Y) which is equal to either 0 (false) or 1
(true), depending on which values, 0 or 1, the inputs have. The following
truth table shows when an AND Logic Gate is true and when it is false. In
general, AND is true only when both inputs (A and B) are true, otherwise,
AND is false. (When any Logic Gate is true, it means that electrical current
is able to go through it; when it is false, electrical current is not allowed to
go through it.)
Input A
1
1
0
0
Input B
1
0
1
0
Output Y
1
0
0
0
The only time Output Y is true (equal to 1) is when Inputs A and B are both
true (equal to 1), otherwise Output Y is false (equal to 0).
Rule for the OR Logic Gate:
Two inputs (A and B), when combined in an electrical circuit using an OR
Logic Gate will yield an output (Y) which is equal to either 0 (false) or 1
(true), depending on which values, 0 or 1, the inputs have. The following
truth table shows when an OR Logic Gate is true and when it is false. In
general, OR is true when either or both inputs (A and B) are true,
otherwise, OR is false.
Input A
Input B
Output Y
1
1
0
0
1
0
1
0
1
1
1
0
The only time Output Y is true (equal to 1) is when either or both Inputs A
and B are true (equal to 1); when both Inputs A and B are false (equal to
0), Output Y is also false (equal to 0).
Rule for the NOT Logic Gate:
Whenever an Input is true (only one Input is required), the NOT makes it
false. Similarly, whenever an Input is false, the NOT makes it true. The
following table shows when Output Y is true and when it is false.
Any Input (A or B or combination) Output Y
1
0
0
1
In effect, the NOT negates any Input by giving it the opposite value.
Rule for the NAND Logic Gate:
The NAND Logic Gate is the opposite of the AND Logic Gate. That is,
where AND is true (Output Y is equal to 1), the NAND is false (Output Y is
equal to 0). The following truth table shows when Output Y is true and
when it is false.
Input A
1
1
0
0
Input B
1
0
1
0
Output Y
0
1
1
1
In effect, Output Y for the NAND Logic Gate is exactly the opposite of
Output Y for the AND Logic Gate. That is, NAND is only false (equal to 0)
when both Inputs A and B are true (equal to 1).
Rule for the NOR Logic Gate:
The NOR Logic Gate is the opposite of the OR Logic Gate. That is, where
OR is true (Output Y is equal to 1), the NOR is false (Output Y is equal to
0). The following truth table shows when Output Y is true and when it is
false.
Input A
Input B
Output Y
1
1
0
0
1
0
1
0
0
0
0
1
In effect, Output Y for the NOR Logic Gate is exactly the opposite of the
Output Y for the OR Logic Gate. That is, NOR is only true (equal to 1)
when both Inputs A and B are false (equal to 0).
Rule for the XOR Logic Gate:
When the Inputs A and B are the different (Input A is 1 and Input B is 0),
the XOR is always true (equal to 1). However, when the Inputs A and B are
the same, (Inputs A and B are both 0 or both 1), the XOR is always false
(equal to 0). The following truth table shows when XOR is true and when it
is false.
Input A
Input B
Output Y
1
1
0
0
1
0
1
0
0
1
1
0
In effect, the XOR is true only when the Inputs A and B are different; (one
is equal to 1 and the other is equal to 0); otherwise, the XOR is false.
Rule for the XNOR (or NOT XOR) Logic Gate:
The XNOR is the opposite of the XOR. When XOR is true, XNOR is false;
when XOR is false, XNOR is true.
Input A
Input B
Output Y
1
1
0
0
1
0
1
0
1
0
0
1
In effect, XNOR will be true whenever the Inputs A and B are the same
(both equal to 0 or both equal to 1).
Download