Logic gates
Logic gates
• We draw a single and-gate with a little ring on the output like this:
Truth Table for NAND-Gate
• The nand-gate, like the and-gate can take an arbitrary number of
inputs.
• The truth table for the nand-gate is like the one for the and-gate,
except that all output values have been inverted:
• x y | z -------
•0 0 | 1
•0 1 | 1
•1 0 | 1
•1 1 | 0
The nor-gate
• The nor-gate is an or-gate with an inverter on the output.
• So instead of drawing several gates like this:
• We draw a single or-gate with a little ring on the output like this:
Truth Table for NOR-Gate
• The nor-gate, like the or-gate can take an arbitrary number of inputs.
• The truth table for the nor-gate is like the one for the or-gate, except
that all output values have been inverted:
• x y | z -------
•0 0 | 1
•0 1 | 0
•1 0 | 0
•1 1 | 0
The exclusive-or-gate
• The exclusive-or-gate is similar to an or-gate. It can have an arbitrary
number of inputs, and its output value is 1 if and only if exactly one
input is 1 (and thus the others 0).
• Otherwise, the output is 0. We draw an exclusive-or-gate like this:
Truth Table for EXOR-Gate
• The truth table for an exclusive-or-gate with two inputs looks like
this:
• x y | z -------
•0 0 | 0
•0 1 | 1
•1 0 | 1
•1 1 | 0
The exclusive-Nor-gate
• The exclusive-Nor-gate is similar to an N or-gate. It can have an
arbitrary number of inputs, and its output value is 1 if and only if the
two input are of the same values (1 and 1 or 0 and 0).
• Otherwise, the output is 0. We draw an exclusive-Nor-gate like this:
Truth Table for EXNOR-Gate
• The truth table for an exclusive-nor-gate with two inputs looks like
this:
• x y | z -------
•0 0 | 1
•0 1 | 0
•1 0 | 0
•1 1 | 1