Section 1.1
Logic Gates

The functional component which makes digital computers possible is the binary switch which has one of two positions or states, usually described as 1 and 0, on and off, or true and false. Millions upon millions of very small, very fast binary switches are needed to implement the complicated logic and memory of a modern digital computer.

At this point in history, digital computers utilize electronic components called transistors as their binary switches. These transistors allow or disallow electric current to flow through ultra-tiny wires. Transistors' states can be altered by another electric pulse in a very short amount of time. The detailed study of transistors is beyond the scope of this course, since it would require a great deal of study of the principles of electricity, magnetism and electronics.

But to understand a computer's functioning, we don't need to really understand the internals of transistors. Besides, they will probably be replaced by a different technology in ten years. Instead of studying transistors which are at too low a level, we will study gates which are the eternal logical foundations of computer hardware. These gates group together to form circuits, which implement the functionality of the computer.

A gate is a logical component that allows binary signals to be combined. Modern computers build gates out of transistors, but students at MIT put together an entire computer using tinker toys. Their basic unit was still the gate, and gates can be made from optical or biological components as well as tinker toys. Earlier computers, before the ENIAC in 1947, used relay switches which were electromagnets that flipped back and forth. The ENIAC and its successors for the next 15 years used vacuum tubes.

Even though all gates today are made of transistors, there are different kinds of transistors and different ways of building the same gates out of them. For example, CMOS (complementary metal oxide on silicon) is a type of transistor and a corresponding way of arranging transistors on a silicon chip. ECL (Emitter Coupled Logic) is another method. These are sometimes called "transistor technologies" or "logic families." In all of these cases, the AND gate, for example, performs the same function. However, some technologies such as ECL are much faster than others, while some technologies such as CMOS use very little power and are more appropriate for pocket calculators and portable computers.

A logic gate is a uni-directional device with one or more inputs going into it and one or more outputs coming out. These inputs and outputs are sometimes called wires or lines and have logical values corresponding to the states of a binary switch (1 and 0, on and off, true and false.)


Fig. 1.1.1: A generic gate

Three of the most common gates are AND, OR and NOT. AND and OR both have two inputs and one output, while NOT has one input and one output. Computer designers use abstract symbols for gates in order to ignore the kind of transistors that comprise it. Fig. 1.1.2 show the abstract symbols for these three gates and the truth tables that describe what they do.


Fig. 1.1.2: Definitions of AND, OR, NOT

Occasionally some books will put arrows on the lines to indicate the direction of signal flow. This is not strictly necessary since the gates determine the flow of signal values. Here is an AND gate with arrows:


Fig. 1.1.3: AND gate with directional arrows

We will not use this notation unless it is necessary for clarity.

The names AND, OR and NOT come from classical logic, and later we will show the connection between traditional logic and these circuits. The following rules help remember which truth table goes with which gate:

AND Both of its inputs must be 1 in order for its output to be 1, i.e. both A and B must be 1.
OR Either of its inputs must be 1 in order for its output to be 1, i.e. either A or B must be 1.
NOT The output is not the same as the input. This is like the minus sign of mathematics, negation.