Believe it or not, computers are constructed from a few simple circuits known as Gates. In fact, one can construct a whole computer using only three types of circuits, the AND Gate,the OR Gate and the NOT Gate. Computer circuits are built by wiring many, many of these gates together. Some circuits are small, containing only a few gates, while others may have hundreds or even thousands of gates.
Gates are simple circuits; so simple that it is possible to ignore the details of voltages and currents and focus on the behavior of the circuit. The wires that are used to connect gates together are assumed to carry either a one or a zero. (You may have heard that computers use only the digits one and zero in their internal calculations.) In reality, these wires carry high and low voltages to represent the ones and zeros, but we can ignore this for now.
There are two kinds of wires that can be attached to a gate, input wires and output wires. Input wires carry the ones and zeros into a gate, while the output wires carry the ones and zeros out of the gate. Most gates have only a single output wire, but may have several input wires. The values on the output wires depend on the type of the gate and the values on the input wires.
Now let's take a look at the different types of gates. Each different kind of gate is represented by a specially shaped symbol. When a circuit is drawn, these symbols are used to represent the gates and show how they are wired together. We will use the small window below to illustrate the shapes used for AND, OR, and NOT gates. Click on the following button to see the shape for the AND gate.
This AND gate has two places to attach input wires on the left and a single place to attach an output wire on the right. The places where we can attach wires are known as ports. Right now, the ports are invisible, making it difficult to draw wires to these locations. To make drawing easier, we can make these locations visible. To do this, click the following button.
The window we are using to show the AND gate is actually a schematic editor window. The schematic editor has added two things to the drawing for us, the name of the gate GT0, and the type AND2 which is an AND gate with two input wires.
Now for the other types of gates. Click on the following two buttons to see the shapes for the OR and NOT gates. AND and OR gates can have any number of inputs, but NOT gates can have only one. Click on the See AND Gate button again if you want to see the AND gate again.
Because the drawing window above is an editor window, you can make changes to the drawing. Try clicking on one of the gate symbols. You can move the name, the type, or the gate itself. You can also change the size of the gate, or turn it around backwards. You can also cut and paste using Ctrl-X, and Ctrl-V. Try putting both an AND gate and an OR gate in the drawing at the same time. When you are done playing, click here to go to the next lesson.