Vous êtes sur la page 1sur 2

HOW THE CPU WORKS

Regardless of size, every computer's CPU is basically a collection of electronic circuits and
components. Electronic impulses from an input device pass through RAM and enter the CPU
through a system bus. Within the CPU, these impulses move through the circuits and various
components (as directed by the program) to create a series of new impulses. Eventually, a set of
electronic impulses leaves the CPU headed for an output device.

The key element of the microprocessor is the transistor -- a device made of semiconductor
material that acts like a switch controlling the flow of electrons inside a chip. Today's CPUs
contain tens of millions of transistors. A recent breakthrough reduced the size of the transistor
by 30%, which will enable future microprocessors to contain a billion transistors. These
microscopic transistors can turn on and off more than a trillion times per second and
microprocessors created with these transistors could complete close to a billion calculations in
the blink of an eye -- a significant speed increase over current CPUs. The primary components
of a CPU are discussed next.

Typical CPU Components

To begin to understand how a CPU works, you need to know how the CPU is organized and
what components it includes. This information will help you understand how electronic
impulses move from one part of the CPU to another to process data. The architecture and
components included in a CPU (referred to as microarchitecture) vary from microprocessor to
microprocessor. A simplified example of the principal components that may be included in a
typical CPU is shown in Figure 2-19 and discussed next.


Arithmetic / Logic Unit (ALU)


The arithmetic/logic unit (ALU) is the section of the CPU that performs arithmetic (addition,
subtraction, multiplication, and division) and logical operations (such as comparing two pieces of
data to see if they are equal or determining if a specific condition is true or false). In other
words, it's the part of the CPU that computes. The fact that the CPU can perform only basic
arithmetic and logical operations might not seem very impressive, but when combined in various
ways at tremendous speeds, these operations enable the computer to perform immensely
complex and data-intensive tasks, in a very short period of time -- a remarkable feat.

For example, editing a digital photograph in an image-editing program, running the spelling
checker in a word processing program, and burning a music CD are all performed by the ALU
using only arithmetic and logical operations.

Control Unit


The control unit coordinates and controls the computer's operations, such as retrieving
instructions and passing them on to the ALU for execution. In other words, it directs the flow of
electronic traffic within the CPU, much like a traffic cop controls the flow of vehicles on a
roadway. Essentially, the control unit tells the ALU what to do and makes sure that everything
happens at the right time in order for the appropriate processing to take place.

Registers


As discussed earlier in this chapter, registers are groups of high-speed memory located
within the CPU into which data is transferred just before processing. The ALU uses registers to
temporarily store data, intermediary calculations, and the final results of processing. A CPU
may have a variety of registers for different purposes, such as an instruction register to hold
instructions, and an accumulator register to hold intermediary processing results. One of Intel's
most recent chips -- the Itanium 2 -- has a total of 328 different registers.

Prefetch Unit


The prefetch unit, present in many recent microprocessors, orders data and instructions from
cache or RAM based on the task at hand. By attempting to retrieve the necessary instructions
and data ahead of time, the prefetch unit helps to avoid delays in processing. It also ensures that
all instructions are lined up correctly to send off to the decode unit.

Decode Unit


The decode unit translates instructions into a form that can be processed by the ALU and
stored in the registers. After decoding, the instructions go to the control unit for processing.

Internal Cache


As mentioned earlier, internal cache (such as Level 1 and Level 2 cache) is used to store
frequently used instructions and data. If the necessary items are not in internal cache, they must
be retrieved from external cache or RAM.

Bus Interface Unit


The bus interface unit is the place where instructions and data flow in and out of the CPU. It
connects the CPU to the system bus to connect the CPU to external cache and RAM.

Vous aimerez peut-être aussi