You are on page 1of 16

The and-gate

An and-gate has an arbitrary number of inputs.


The output value is 1 if and only if all of the
inputs are 1. Otherwise the output value is 0.
The name has been chosen because the
output is 1 if and only if the first input and the
second input, and, ..., and the nth input are all
1.
It is often useful to draw diagrams of gates
and their interconnections. In such diagrams,
the and-gate is drawn like this:
The truth table for an And -gate with two inputs
looks like this

X Y Z
0 0 0
0 1 0
1 0 0
1 1 1
The or-gate
Like the and-gate, the or-gate can have an
arbitrary number of inputs. The output value
is 1 if and only of at least one of the input
values are 1. Otherwise the output is 0. In
other words, the output value is 0 only if all
inputs are 0. The name has been chosen
because the output is 1 if and only if the first
input or the second input, or, ..., or the nth
input is 1.
In circuit diagrams, we draw the or-gate like
this:
The truth table for an or-gate with two
inputs looks like this

X Y Z
0 0 0
0 1 1
1 0 1
1 1 1
The inverter

An inverter has exactly one input and one


output. The value of the output is 1 if and
only if the input is 0. Otherwise, the output is 0.
In other words, the value of the output is the exact
opposite of the value of the input.
In circuit diagrams, we draw the inverter like this:
The truth table for an inverter looks like this:
The truth table for an inverter looks like
this:

X Y
0 1
1 0
The nand-gate
The nand-gate is an and-gate with
an inverter on the output. So
instead of drawing several gates
like this:
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:
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
Laws of Boolean Algebra
Laws of Boolean Algebra
Laws of Boolean Algebra
Examples
Examples
problems

You might also like