Вы находитесь на странице: 1из 46

CPU

The Central Processing Unit of the


computer. A computer's CPU handles all
instructions it receives from hardware
and software running on the computer.
COMPONENTS OF CPU
CONTROL UNIT(CU)
ARITHEMATIC LOGIC UNIT (AU)
Registers
CU
Controls the operations that takes place
in various parts of a computer by sending
electronic signals.

Supervises the flow of data in various


parts of computer such as input device,
output device, and memory devices.
ALU
Arithmetic and Logic Unit consists of a
complicated set of logic circuit and
accumulator.

It is mainly responsible for :


Calculation
Logical comparison and decision
ALU OPERATIONS
Operation : Symbol

Addition : +
Subtraction : -
Multiplication : *
Division : /
LOGICAL OPERATIONS
Logical AND
Logical OR
Logical NOT
Logical EXCLUSIVE OR
REGISTERS
Register is a special memory used by the
CPU for temporarily storing data during
execution of instruction

Instruction Register (IR)


It holds the instruction being executed.
The Main Memory
Bottleneck
Modern super fast microprocessors can
process a huge amount of data in a short
duration.

They require quick access to data to


maximize their performance.

If they dont receive the data that they


require, literally stop and wait this result
in reduced performance and wasted power.
The Main Memory
Bottleneck
Current microprocessor can process an
instruction in about a nanosecond. Time
required for fetching data from main
memory (RAM) is of the order of 100
nanoseconds.
Solution to Bottleneck
problem
Make the memory more faster.

Problem with that approach: The 1-ns memory is


very expensive as compared to the 100-ns
memory.

Another solution: In addition to the relatively slow


main memory, put a small amount of ultra-fast
RAM right next to the microprocessor on the
same chip and make sure that frequently used
data and instruction resides in that ultra-fast
memory.
Solution to Bottleneck
problem
Advantage: Much better overall
performance due to fast access to
frequently-used data and instructions.
Cache memory
The cache is a very high speed, expensive piece of memory,
which is used to speed up the memory retrieval process. Due
to its higher cost, the CPU comes with a relatively small
amount of cache compared with the main memory.
Without cache memory, every time the CPU requests for
data, it would send the request to the main memory which
would then be sent back across the system bus to the CPU.
This is a slow process. The idea of introducing cache is that
this extremely fast memory would store data that is
frequently accessed and if possible, the data that is around it.
This is to achieve the quickest possible response time to the
CPU.
Cache operation
CPU requests contents of memory
location
Check cache for this data
If present, get from cache (fast)
If not present, read required block from
main memory to cache
Then deliver from cache to CPU
Cache includes tags to identify which
block of main memory is in each cache
slot
Role of cache
In early PCs, the various components had one thing in common:
they were all really slow. The processor was running at 8 MHz
or less, and taking many clock cycles to get anything done. In
fact, on some machines the memory was faster than the
processor.
With the advancement of technology, the speed of every
component has increased drastically. Now processors run much
faster than everything else in the computer. This means that one
of the key goals in modern system design is to ensure that to
whatever extent possible, the processor is not slowed down by
the storage devices it works with. Slowdowns mean wasted
processor cycles, where the CPU can't do anything because it is
sitting and waiting for information it needs.
Role of cache
The best way to keep the processor from having to wait is to make
everything that it uses as fast as it is. But that would be very
expensive.
There is a good compromise to this however. Instead of trying to
make the whole 64 MB out of this faster, expensive memory, you make
a smaller piece, say 256 KB. Then you find a smart algorithm
(process) that allows you to use this 256 KB in such a way that you
get almost as much benefit from it as you would if the whole 64 MB
was made from the faster memory. How do you do this? The answer
is by using this small cache of 256 KB to hold the information most
recently used by the processor. Computer science shows that in
general, a processor is much more likely to need again information it
has recently used, compared to a random piece of information in
memory. This is the principle behind caching
Types of memory cache
Memory Cache: A memory cache, sometimes called
a cache store or RAM cache, is a portion of memory
made of high-speed static RAM (SRAM) instead of
the slower and cheaper dynamic RAM (DRAM)
used for main memory. Memory caching is effective
because most programs access the same data or
instructions over and over. By keeping as much of
this information as possible in SRAM, the computer
avoids accessing the slower DRAM.
Types of memory cache
Disk Cache: Disk caching works under the same
principle as memory caching, but instead of using
high-speed SRAM, a disk cache uses conventional
main memory. The most recently accessed data from
the disk (as well as adjacent sectors) is stored in a
memory buffer. When a program needs to access data
from the disk, it first checks the disk cache to see if
the data is there. Disk caching can dramatically
improve the performance of applications, because
accessing a byte of data in RAM can be thousands of
times faster than accessing a byte on a hard disk.
Principle behind the cache
Cache is a really amazing technology. A 512 KB
level 2 cache, caching 64 MB of system memory,
can supply the information that the processor
requests 90-95% of the time. The level 2 cache is
less than 1% of the size of the memory it is caching,
but it is able to register a hit on over 90% of
requests. That's pretty efficient, and is the reason
why caching is so important.
Principle behind the cache
The reason that this happens is due to a computer
science principle called locality of reference. It states
basically that even within very large programs with
several megabytes of instructions, only small portions
of this code generally get used at once. Programs tend
to spend large periods of time working in one small
area of the code, often performing the same work
many times over and over with slightly different data,
and then move to another area. This occurs because
of "loops", which are what programs use to do work
many times in rapid succession.
Importance of cache
Cache is responsible for a great deal of the
system performance improvement of today's
PCs. The cache is a buffer of sorts between the
very fast processor and the relatively slow
memory that serves it. The presence of the
cache allows the processor to do its work while
waiting for memory far less often than it
otherwise would. Without cache the computer
will be very slow and all our works get delay.
So cache is a very important part of our
computer system.
Microprocessors Building
Blocks
Bus Interface Unit
Receives instructions & data from main
memory.

Instructions are then sent to the


instruction cache, data to the data cache.

Also receives the processed data and


sends it to the main memory.
Instruction Decoder
This unit receives the programming
instructions and decodes them into a
form that is understandable by the
processing units, i.e. the ALU or FPU.

Also simplified instructions.

Then, it passes on the decoded


instruction to the ALU or FPU.
Arithmetic & Logic Unit (ALU)
Also known as the Integer Unit.

It performs whole number math calculations


(subtract, multiply, divide, etc) comparisons (is
greater than, is smaller than, etc) and logical
(NOT, OR, AND, etc).

The new breed of microprocessors have not


one but two almost identical ALUs that can
do calculations simultaneously, doubling the
capability.
Floating Point Unit (FPU)
Also known as Numeric Unit.

It performs calculations that involve numbers


represented in the scientific notation (also
known as floating-point numbers).

This notation can represent extremely small and


extremely large numbers in a compact form.

Floating-point calculations are required for


doing graphics, engineering and scientific work.
Floating Point Unit (FPU)
The ALU can do these calculations as
well, but will do them slowly.
Registers
Both ALU & FPU have a very small amount of
super-fast memory placed right next to them for
their exclusive use. These are called registers.

The ALU & FPU store intermediate and final


results from their calculations in these registers.

Processed data goes back to the data cache and


then to the main memory from these registers.
Control Unit
The brain of the microprocessor .

Manages the whole microprocessor.

Tasks include fetching instructions &


data, storing data, managing
input/output devices
That was the structure, now lets talk
about the language of a
microprocessor
Instruction Set
The set of machine instructions that a
microprocessor recognizes and can
execute- the only language
microprocessor knows.

An instruction set includes low-level, a


single step-at-a-time instructions, such as
add, subtract, multiply, and divide.
Instruction Set
Each microprocessor family has its
unique instruction set.

Bigger instruction-sets mean more


complex chips (higher costs, reduced
efficiency), but shorter programs.
The 1st Microprocessor : Intel 4004

Introduced 1971
2250 transistors
4-bit word size
108 kHz, 60,000 operations/sec
16 pins
10 microns process
As powerful as the ENIAC which had 18000
tubes and occupied a large room
Targeted use: Calculators
Cost: less than 100$
Why Intel came up with the idea ?

A Japanese calculator manufacturer


Busicom wanted Intel to develop 16
separate ICs for a line of new calculators.

Intel, at the point in the time known only


as a memory manufacturer, was quite
small and did not have the resources to
do all 16 chips.
Why Intel came up with the idea ?

Ted Hoff came up with the idea of doing


all 16 on a single chip.
Later, Intel realized that the 4004 could
have other users as well.
Currently PopularIntel Pentium 4
(2.2GHz)
Introduced December 2001
55 million transistors
32-bit word size
2 ALUs, each working at 4.4GHz
128-bit FPU
0.13 micron process
Targeted use: PCs and low end
workstations
Cost around $600
Moores Law
In 1965, one of the founders of Intel
Gordon Moore Predicted that the number
of transistor on an IC (and therefore the
capability of microprocessors) will double
every year. Later he modified it to 18
months.

His prediction still holds true in 02. In fact


time required for doubling is contracting to
the original prediction, and is closer to a
year now.
4-, 8-, 16-, 32-, 64-bit(Word
Length)
The 4004 deals with data in chunks of 4-
bits at a time.

Pentium 4 deals with data in chunks


(words) of 32-bit length.

The new Itanium processor deals with 64-


bits chunks (words) at a time.

Why have more bits (longer words)?


kHz, MHz, GHz (Clock
Frequency)
4004 worked at a clock frequency of
108kHz.

The latest processors have clock


frequency in GHz.

Out of 2 microprocessors having similar


designs, one with higher clock frequency
will be more powerful.
kHz, MHz, GHz (Clock Frequency)

Same is not true for 2 microprocessors of


dissimilar designs. Example: Out of
PowerPC & Pentium 4 microprocessors
working at the same frequency, the
former performs better due to superior
design. Same for the Athlon
microprocessor when compared to
pentium.
Enhancing the capability of a
microprocessor?
The computing capability of a microprocessor
can be enhanced in many ways:

1) By increasing the clock frequency


2) By increasing the word-width
3) By having a more effective caching algorithm
and the right cache size
4) By adding more functional units (e.g. ALUs,
FPUs etc)
5) Improving the architecture
What have we learnt
today?
Today we learnt about microprocessor, the
key component, the brain of the computer.

We learnt the function of the


microprocessor.

And its various sub-systems


Bus interface unit
Data & instruction cache memory
Instruction decoder
What have we learnt
today?
Arithmetic-Logic unit
Floating-point unit
Control unit

Вам также может понравиться