Chapter 3 - CPU
Chapter 3 - CPU
Chapter 3 - CPU
The phrase "central processing unit" is a description of a certain class of logic machines
that can execute computer programs. This broad definition can easily be applied to
many early computers that existed long before the term "CPU" ever came into
widespread usage. However, the term itself and its initialism have been in use in the
computer industry at least since the early 1960s (Weik 1961). The form, design and
implementation of CPUs have changed dramatically since the earliest examples, but
their fundamental operation has remained much the same.
The central processing unit performs a couple of basic functions. First of all, in order for
a computer to operate, it needs instructions to tell it what to do. It gets these
instructions in the form of software. Software can come in two forms. Operating system
software tells the computer how it is to be run, while application software are
applications (duh!) such as games, word processors, and media players (for more
information about software, see the "software" section of this site). It is up to the CPU to
decipher what exactly the software instructions are telling the computer to do. After
decoding these instructions, the CPU will then perform a series of computations to carry
out these tasks. The Arithmetic/Logic Unit (ALU) is the part of the central processing
unit that performs various calculations and comparisons. Some of its tasks are as simple
as the basic operations of addition, subtraction, multiplication, and division, while
others are so complex that it would take human beings years to complete!
In addition to interpreting and executing instructions, the CPU can also move data from
one memory location to another. When data is stored in the RAM (random-access
memory), the main memory of a computer, it is given an address. This address can be
analogous to your house address. It is used to indicate where certain data is, just like the
address to your house can be used to help indicate to people where exactly your house is
located. (See the section about RAM for more information). Well, whenever the CPU
wants to access a certain piece of data, a bus (a pathway inside the computer that is used
to transport information from one area to another, especially from the CPU to the
memory and vice versa) know as the address bus will send the address to the memory,
and then another type of bus, the data bus, will receive the data from the memory. For
more information on how this information is transported, see the section about buses.
Another of the CPU's basic functions is that it can make certain decisions about how the
computer is operated, and based on these decisions, the CPU can jump from one
instruction to another. It does not necessarily have to execute the instructions in
sequential order, but rather, it can skip to different instructions. For example, the CPU
does not have to perform the instruction it is first given before all the other instructions.
Instead, by jumping around, it can perform the fourth instruction it was given before the
third instruction.
The central processing unit also has a pipelining technology that allows it to perform
many different instructions simultaneously. This technology helps to make the CPU
extremely powerful!
The control unit supervises all of the CPU's operations. It fetches the software
instructions from the memory, and it also coordinates the times and order in
which the instructions are carried out. For example, the control unit has a special
feature known as the interrupt. An interrupt is exactly what the term means! It is
a special signal that interrupts the task the central processing unit is currently
performing. It will tell the CPU to put aside this operation and to instead begin
work on another operation.
• Instruction Decoder:
The instruction decoder deciphers the instructions for the CPU so that they can
be executed and carried out.
• Program Counter :
• Registers :
Registers are special storage locations located inside the CPU. The data contained
here can be accessed much quicker than the data contained in other memory
locations, such as the RAM (random-access memory) and the ROM (read-only
memory).
Registers in different parts of the CPU are used for different functions. In the
control unit, the registers are used to store the computer's current instructions
and the operands (this is merely a fancy term for data that is being operated on
by the CPU). Meanwhile, the registers found in the ALU, called accumulators, are
used to store the results of the arithmetic or logical operations.
• Clock :
The clock is a timer that acts as a heartbeat for the central processing unit. At
regular intervals, it will release an electrical signal that sends a pulse through the
CPU's circuitry. Usually, small tasks can be completed between pulses, but more
complex tasks might take up to several pulses before they can be finished. It is by
this clock that we can calculate the speed of a processor. The speed of a CPU is
measured in megahertz's (MHz). Most modern computers have speeds of at least
90 MHz.
Path of data flow through the CPU:
1. The instructions for the CPU originate in software. They are usually stored in
floppy disks, hard disks, or CD-ROMs.
3. The CPU 's control unit fetches the instructions and brings them to the CPU.
4. The instructions are stored in special registers in the CPU, and the program
counter increments, allowing the instructions to be sequentially performed.
5. When the CPU is ready, the instructions coming next in the sequence are sent
to the instruction decoder. It is then determined what exactly the instructions say
and what the computer must do.
6. The address bus and data bus now come into use. The address bus will send
the address of the data that the CPU needs to the memory, and then the data bus
will retrieve the data found at that address.
7. Finally, the instructions are carried out in the ALU, where the computations
are made.
8. After the results of the operations are calculated, they are temporarily stored in
registers in the CPU for quick and easy access.