how one can put together an extremely complex microprocessor using a few simple kinds of components called gates
how one can put together an extremely complex Lego toy using a few simple kinds of components called blocks
To do this, we peel off another layer of the Computer Onion
to see what a microprocessor looks like at the hardware, or gate level.
Do you remember the boolean operations from JavaScript?
The boolean operations combine boolean values (true, false) according to the following operation table:
But wait! Remember, at this level, our computer can represent only 0's and 1's! So let's make the identification:
For the purposes of this investigation, we will also use the actual words AND, OR and NOT instead of the JavaScript operators &&, ||, !.
Now our operation table (it's the same table, we're just using different symbols) looks like:
A neat way to remember this table:
the NOT of a number is simply the "opposite" number
Here's the fun part: it is very easy to create hardware components (called gates) that will combine 0's and 1's according to the above table. And guess what? These components are called:
OR gates AND gates NOT gates
Our goal is to show you how you how one can "wire together" gates to perform useful mathematical and logical operations. If we wire together enough of these gates into appropriate patterns (and supply a clock for synchronization purposes), we can build a computer that can do anything that any computer now (or ever) will be able to do. It doesn't seem possible, but, all we need are the three kinds of gates:
As a matter of fact, we really only need two kinds: AND and NOT, or OR and NOT. But we will use these three standard kinds, along with some other standard kinds of gates, to be introduced subsequently, to build our circuits.
We will be drawing circuit diagrams that wire these gates together in various patterns, so we need a way to draw, or represent, them. The following are the standard way for representing these three kinds of gates.
Referring back to the operation table, we see that AND and OR combine two bits (binary digits, or 0's or 1's) to get a one-bit result (e.g. 1 AND 1 = 1), whereas NOT uses just one bit to produce a one-bit result. We will refer to the bit(s) that get "used" as the input bit(s), and the result as the output bit.
Fact: 1 AND 0 ==> 0 Schematic depiction:
0
Now, let's reoganize our logic table into three separate tables, for future reference:
We now show how Logg-o lets us build circuits using gates.
This demonstration showed how the gate EXOR works. Here's the logic table for it:
EXOR
the EXOR of two numbers is 1 <==> one of the numbers is 1, but not both