You are on page 1of 3

Synchronous with Immediate Return

AND

[condition1]
Message1
AND

[condition2]
Message2
AND

AND
AND
AND

AND

Async Message
AND

AND

Everything in a computer that makes its a computer, can be


made out of one or more NAND gates.

a
a

computer memory. Since the only thing inside


of computers is bits, and the only thing that
happens to bits is that they either turn on or
turn off, then it follows that the only thing
a computer can remember is whether a bit was
on or off. The above diagram shows one bit of
computer memory. The neatest tricks you can do
with a few gates. It is made of only four NAND
gates, but its wiring is kind of special. Here
it is:
This combination as a whole has two inputs and
one output. I is where we input the bit that
we want to remember, and o is the output of
the remembered bit. 'S is an input that tells
these gates when to set the memory. There
are also three internal wires labeled a, b
and c that we will have to look at to see
how these parts work together. Try to follow
this carefully, once you see that it works,
you will understand ne of
the most important and most commonly used
things in a computer.
To see how this works, start with s on
i off. Since i and s go into gate 1,
input is off, so a will be on. Since a
s go to gate 2, both inputs are on,
therefore b will be off.

and
one
and
and

3
1

Looking at gate 4, since b is off, the output


of gate 4, c will be on. Since c and a are
both on, the output of gate 3, o will be off.
O goes back down to gate 4 providing a second
off input, leaving c still on. The important
thing to note here is that with s on, o ends
up the same as i. Now with s still on, lets
change i to on. Since i and s go into gate
1, a will be off. A goes to one side of both
gate 2 and gate 3, therefore their outputs o
and b must both be on. O and b both on go
into gate 4 and turn c off, which goes back up
to gate 3 providing it with a second off input,
leaving o still on. The important thing to
note here is the same thing we noted in the
previous paragraph - that with s on, o ends
up the same as i. So far, we have seen that
when s is on, you can change i on and off,
and o will change with it. O will go on and
off just the same as i. With s on, this
combination is no more useful than a wire
connecting i to o.
Now lets see what happens when we turn s off.
Look at gate 1. When s is off, a will be on
no matter what you do to i. Now you can switch
i on and off and nothing will happen. The same
goes for gate 2. A may be on, but s is off,
so b can only be on. Both a and b are on,

and changing i does nothing. Now the


only thing left that matters, the big
question is, what will o be? If i and
o were on before s got turned off,
gate 3 had both inputs off, and gate 4
had both inputs on. When s goes off,
a comes on, which is one input to gate
3. But the other input is off, so nothing
changes, o stays on.
If i and o were off before s got
turned off, gate 3 had both inputs on,
and gate 4 had both inputs off. When s
goes off, b comes on, which is one
input to gate 4. But the other input is
off, so nothing changes, c stays on and
o stays off. So the answer to the
question of what happens to o when s
is turned off, is that it stays the way
it was, and it is no longer affected by
i.

a
b

The only
picture of
after the
the chart
this:

AND

difference between this picture and the


our original gate is that the little circle
big D is missing. Since x is not used,
can also be simplified, and it looks like

The only difference between this chart and the chart


of our original gate is that every item in column c
is the opposite of what it was in the original chart.

This combination gate could be described this way: For the output to be on, one input AND the other input must both
be on. Thus this type of gate has a name, and in the tradition of the informal terminology invented by computer
people, because it reminds us of what the word AND means, it is simply called an AND gate. Now to fill in a few
details purposely left out above, the original gate we looked at works like the AND gate except the output is the
opposite, or the negative of the AND gate. Thus it is called a Negative AND gate, or just a NAND gate for short.
The simple gate that had both inputs tied together also has its own name. The output is always the opposite of the
one input, that is, if the input is on, the output is not on (off.) If the input is off, the output is not off (on.)
The output is always NOT what the input is, thus, it is called a NOT gate.
Notice the difference between the diagrams of the AND gate and the NAND gate. They are the same except that there is
a little circle at the beginning of the output of the NAND gate. The thing that looks like a large letter D means
to do the AND function, which means to take action only if both inputs are on, and the little circle means switch
to the opposite. So an AND gate is on if both inputs are on, a NAND gate is off if both inputs are on. The NOT gate
starts with a triangle, which just means take the input and turn it into an output. The circle then means to switch
to the opposite.
The AND gate is used a lot in computers, and it is probably the easiest to understand, but we looked at the NAND
gate first for two reasons. The first and less important reason is that the NAND gate is the easiest gate to build.
When you have to build a large number of gates, it will be cheaper and more reliable if you can use the type of gate
that is easiest to build. The second, and very important reason that we looked at the NAND gate first is this: That
everything in a computer that makes it a computer, can be made out of one or more NAND gates. We have already seen
that the NOT gate and the AND gate can be made out of NAND gates, and we will see a few more interesting
combinations as we go along. But every one of them is based on this silly little thing called a NAND gate.

You might also like