Principles of CPU architecture – logic gates, MOSFETS and voltage

The underlying principles of all computer processors are the same. Fundamentally, they all take signals in the form of 0s and 1s (thus binary signals), manipulate them according to a set of instructions, and produce output in the form of 0s and 1s. The voltage on the line at the time a signal is sent determines whether the signal is a 0 or a 1. On a 3.3-volt system, an application of 3.3 volts means that it’s a 1, while an application of 0 volts means it’s a 0.

Processors work by reacting to an input of 0s and 1s in specific ways and then returning an output based on the decision. The decision itself happens in a circuit called a logic gate, each of which requires at least one transistor, with the inputs and outputs arranged differently by different operations. The fact that today’s processors contain millions of transistors offers a clue as to how complex the logic system is. The processor’s logic gates work together to make decisions using Boolean logic, which is based on the algebraic system established by mathematician George Boole.

The main Boolean operators are AND, OR, NOT, and NAND (not AND); many combinations of these are possible as well. An AND gate outputs a 1 only if both its inputs were 1s. An OR gate outputs a 1 if at least one of the inputs was a 1. And a NOT gate takes a single input and reverses it, outputting 1 if the input was 0 and vice versa. NAND gates are very popular, because they use only two transistors instead of the three in an AND gate yet provide just as much functionality. In addition, the processor uses gates in combination to perform arithmetic functions; it can also use them to trigger the storage of data in memory.

Logic gates operate via hardware known as a switch – in particular, a digital switch. In the days of room-size computers, the switches were actually physical switches, but today nothing moves except the current itself. The most common type of switch in today’s computers is a transistor known as a MOSFET (metal-oxide semiconductor field-effect transistor). This kind of transistor performs a simple but crucial function: When voltage is applied to it, it reacts by turning the circuit either on or off. In a CPU, the voltage at which the MOSFETs react determines the voltage requirements of the processor. So, in a 2V processor, logical circuits are built with MOSFETS that react at 2V, hence an incoming current at or near the high end of the voltage range, 2V, switches the circuit on, while an incoming current at or near 0V switches the circuit off.

Millions of MOSFETs act together, according to the instructions from a program, to control the flow of electricity through the logic gates to produce the required result. Again, each logic gate contains one or more transistors, and each transistor must control the current so that the circuit itself will switch from off to on, switch from on to off, or stay in its current state.

A quick look at the simple AND and OR logic-gate circuits shows how the circuitry works. Each of these gates acts on two incoming signals to produce one outgoing signal. Logical AND means that both inputs must be 1 in order for the output to be 1; logical OR means that either input can be 1 to get a result of 1. In the AND gate, both incoming signals must be high-voltage (or a logical 1) for the gate to pass current through itself.

The flow of electricity through each gate is controlled by that gate’s transistor. However, these transistors aren’t individual and discrete units. Instead, large numbers of them are manufactured from a single piece of silicon (or other semiconductor material) and linked together without wires or other external materials. These units are called integrated circuits (ICs), and their development basically made the complexity of the microprocessor possible. The integration of circuits didn’t stop with the first ICs. Just as the first ICs connected multiple transistors, multiple ICs became similarly linked, in a process known as large-scale integration (LSI); eventually such sets of ICs were connected, in a process called very large-scale integration (VLSI).

Modern day microprocessors contain tens of millions of microscopic transistors. Used in combination with resistors, capacitors and diodes, these make up logic gates. Logic gates make up integrated circuits, and ICs make up electronic systems. Intel’s first claim to fame lay in its high-level integration of all the processor’s logic gates into a single complex processor chip – the Intel 4004 – released in late 1971. This was 4-bit microprocessor, intended for use in a calculator. It processed data in 4 bits, but its instructions were 8 bits long. Program and data memory were separate, 1KB and 4KB respectively. There were also sixteen 4-bit (or eight 8-bit) general purpose registers. The 4004 had 46 instructions, using only 2,300 transistors in a 16-pin DIP and ran at a clock rate of 740kHz (eight clock cycles per CPU cycle of 10.8 microseconds).