Professional Documents
Culture Documents
CPU Details - CPU Fundamentals
CPU Details - CPU Fundamentals
CPU Details - CPU Fundamentals
CIT-311
WHAT IS CPU
CPU is sometimes referred to as the brain or heart of a computer system.
It is the part of the computer that actually processes the data.
The CPU
a. accepts data and instructions from the input device (or from the software stored in its memory).
b. processes the data according to the given instructions.
c. finally stores the results of the operations in its memory or displays it in a suitable output media
such as monitor, printer etc.
The CPU also controls the flow of data through the system, places data in memory and retrieves them
when needed.
In a microcomputer, the entire CPU is contained on a tiny chip called a microprocessor. The chip is
mounted on a piece of plastic with metal wires attached on it.
WHAT IS PROCESSING
The procedure that transforms raw data into useful information is called processing.
Both of these two components are located on the computers main system board or Motherboard
(the circuit board that connects the CPU to all the other hardware devices).
FUNCTION OF A CPU
The primary function of a CPU is to execute sequence of instructions, which are stored in an external
main memory. Program execution in CPU is therefore carried out as follows:
i)
The CPU accepts data and instructions from the input device (or from the software stored in its
memory).
It then processes the data according to the given instructions.
Finally the CPU stores the results of the operations in its memory or displays it in a suitable
output media such as monitor, printer etc.
ii)
iii)
PREPARED
BY:
CIT-311
PREPARED
BY:
CIT-311
It also allows the users of these computer systems to easily upgrade their system,
without worrying about converting all their existing software.
Downward or Backward Compatibility
It is the capability of a new hardware device (or new software product) to interact
successfully with all the same software product (or hardware device) that its predecessor
could. This hardware device (or software product) is called downward compatible.
MICROPROCESSOR
They are composed of silicon or other material etched with many tiny electronic
circuits.
They are integrated circuit (IC) based on the VLSI (very large scale integration)
and ULSI (ultra large scale integration) technology.
CO-PROCESSOR
A co-processor is a separate instruction-set processor that is closely coupled to the CPU and whose
operation is to enhance the processing speed of the main processor (CPU). Complicated arithmetic
operations like exponentiation and trigonometric functions are costly to implement in the CPU hardware,
while software implementations of these operations are slow. An arithmetic or math coprocessor is used
as the auxiliary processor to the CPU to provide fast, low-cost hardware implementations of these special
math functions. Newer CPUs have math coprocessor built-in. Earlier CPUs did not have them, so many
users choose to upgrade their machines by adding them.
TYPES OF PROCESSORS/ CPU USED IN PERSONAL COMPUTERS
Two biggest players (i.e. manufacturers) in the PC CPU market are Intel and Motorola. Intel processor
today controls most PCs. The primary exception to this rule is the Apples Macintosh. All Macs use
processor chips made by Motorola. In addition, several firms, such as AMD (Advanced Micro Devices)
and Cyrix, make processors that are mimic the functionality of Intels processors.
THE RISC AND CISC PROCESSOR
CISC Processor (Complex instruction set computer)
PREPARED
BY:
CIT-311
In this type of processor, the instruction sets are complex and large, typically
containing 200 to 300 instructions.
A newer theory in microcomputer design holds that if the instruction set for the
CPU is kept small and simple, each instruction will execute much faster, allowing the processor
to complete more instructions during a given period.
CPUs designed according to this theory are called RISC processor (Reduced
Instruction Set Computer). In this type of processors, reduced number of instructions is used.
RISC processor-based PC results in a faster and less expensive than that of CISC
processor-based PC.
REGISTER
Register is the high-speed memory location that is built directly into the ALU part of the CPU.
It holds data and instructions temporarily that are currently being processed.
The computer loads instruction and data from main memory into the registers just before
processing, which helps the computer process faster.
The size of the registers, which is sometimes called the word size, indicates the amount of data
with which the computer can work at any given time.
The bigger the word size, the more quickly the computer can process a set of data.
64-bit processor, or 64-bit register or 64-bit computer means that the word size of the computer is
8 bytes (64 bits), i.e. the register of this computer contains 64 bit data and the computer can process
64 bit data at any given time. If the factors like memory, clock speed, data bus etc. are kept equal,
then a CPU with 32-bit registers can process data twice as fast as one with 16-bit registers.
TYPES OF REGISTERS
Although, the number of registers varies from computer to computer, there are some registers which are
common to all computers. Brief descriptions of these registers are given below.
1) Memory Address Register (MAR)
It holds the address of the active memory location.
The address is loaded from the Program Control Register (PC) when an instruction is read
from memory.
2) Memory Buffer Register (MBR)
This register acts as a buffer between the CPU and the memory
It holds the contents of the memory word read from, or written in memory.
An instruction word placed in this register is transferred to the Instruction Register (IR)
A data word placed in this register is accessible for operation with the Accumulator
Register (AC) or for transfer to I/O Register.
3) Program Control Register (PC)
It holds the address of the next instruction to be executed.
[Normally, the instructions of a program are stored in consecutive memory locations, and
read and executed in sequence, unless a branch instruction is encountered].
For a branch instruction, the address part of the branch instruction is transferred to the
Program Control Register (PC) to become the address of the next instruction.
4) Accumulator Register (AC)
PREPARED
BY:
CIT-311
It holds:
General purpose registers can be used for several functions under program control.
They are convenient store for holding data which is currently processed by the ALU, for storing some
data temporarily and also for storing intermediate results.
COMPUTERS INTERNAL CLOCK (SYSTEM CLOCK)
Every microcomputer has a system clock whose main purpose is not to keep the time of the day.
The system clock is used to time the processing operation of a computer, i.e. it controls how fast
all the operations within a computer take place.
Like most modern wristwatches, computers clock is driven by a quartz crystal.
When electricity is applied, the molecules in the crystal vibrate millions of times per second, a
rate that never changes.
Computer uses the vibrations of the quartz in its system clock to time its processing operations.
The faster the clock, the faster the processing.
The speed of the vibration is determined by the thickness of the crystal.
Computers clock speed is measured in hertz (Hz), which means cycles per second.
A computers clock speed is 133 MHz; it means that the computer can turn off and back on
again133000000 transistors within a second.
Over the years, computers clock speeds are increasing rapidly. The first PC operated at 4.77
MHz (megahertz). Now a processor with more than 1.5 GHz (gigahertz) is available today.
If the factors like memory, data bus, register size etc are kept equal, then a CPU operating at 300
MHz can process data more than twice as fast as the same one operating at 133 MHz.
WAYS IN WHICH PROCESSING SPEED ARE MEASURED
There are three ways in which processing speed of a computer is measured:
(i) Time to complete one machine instruction, in fraction of a second:
PREPARED
BY:
CIT-311
The speeds for completing one machine cycle are measured in ms (milliseconds)
for older and slower computers; in s (microseconds) for most microcomputers; in ns
(nanoseconds) for mainframes and in ps (picoseconds) for Supercomputer.
Using this way, the processing speed is measured in MIPS (million of instructions
per second) or in BIPS (billion of instructions per second)
Each time the CPU executes an instruction, it takes a series of steps. The
completed series of steps is called a machine cycle.
A machine cycle itself can be broken down into two smaller cycles:
(a) Instruction Cycle (I-cycle):
In instruction cycle, the control unit fetches (gets) an instruction from mail memory
and decodes that instruction (determine what it means).
(b) Execution Cycle (E-cycle):
During the execution cycle, the ALU executes the instruction (performs the
operation on the data) and stores the processed results in main memory or a register.
At the beginning of the machine cycle (that is, during the instruction cycle), the CPU takes two steps:
1. Fetching:
Before the CPU can execute an instruction, the control unit must retrieve (or fetch) a command or
data from the computers memory.
2. Decoding
Before a command can be executed, the control unit must break down (or decode) the command
into instructions that correspond to those in the CPUs instruction set.
After that, the CPU is ready to begin the execution cycle:
i)
Executing
When the command is executed, the CPU carries out the instructions in order by converting them
into microcode.
ii)
Storing
The CPU may be required to store the results of an instruction in memory (but this condition is
not always required).
Machine cycle (instruction cycle and execution cycle) is illustrated below with how the CPU plays a
sound:
PREPARED
BY:
RAM
Play sound
CIT-311
System Bus
Play sound sent over
bus to the CPU
Steps:
Play sound is sent from RAM to CPU
Control unit breaks the command into
instruction set the CPU can handle.
RAM
Play sound
Control Unit
Instruction1
Instruction2
Instruction13
System Bus
Control Unit
Instruction1
Instruction2
Instruction13
Steps:
Control unit executes instructions 1 to 3
Command is sent over system bus to sound
card.
Sound card
Figure: The execution cycle
plays the sound.
Most microprocessors execute instructions rapidly; newer ones can perform even faster by
using pipelining.
In this process, the control unit begins a new machine cycle- that is; it begins executing a
new instruction- before the current instruction is completed. Executions are performed in stages:
when the 1st instruction completes the fetching stage, it moves to the decode stage and a new
instruction is fetched.
In pipelining, each instruction is broken up into several parts. Once the 1st part of an
instruction is done, it is passed to the 2nd part. Since the 1st step in the line is now idle, the
pipeline then feeds a new step one.
A computer system with more than one processor is said to be a multiprocessing (MP)
system.
Computers having multiprocessors can handle greater data flow, complete more tasks
in a shorter time (i.e. their speed increases rapidly), and can handle many input and output
devices.
Multiprocessor versions of PCs are available today which are commonly used as network
servers, Internet host computers, and stand-alone workstations.
The IBM 3090 computer has two to four processors, and the Cray X MP4 has four
processors.
SMP (Symmetric Multiprocessing):
BY:
CIT-311
Due to the limitation on the number of processors, it is easier to design system with SMP.
PREPARED
BY:
CIT-311
Newer model computers have a 64-bit data bus called the FrontSide Bus (FSB) that transfers eight
bytes at a time.
CONTROL BUS
This bus carries control signals from the CPU to the memory or I/O devices.
The signal of the control bus synchronizes the activities of the separate computer
elements.
The CPU sends some of these control signals (such as Read or Write) to the other elements
to tell them what type of operation is currently in process.
BUS STANDARDS/ BUS ARCHITECTURE
The components of a computer system communicate with one another through a series of wires (lines)
known as bus. There are several principal bus standards:
PREPARED
BY:
CIT-311
PC Card Bus
A PC Card is about the size of a stack of four credit cards.
This bus is exclusively used on laptop computers.
Like USB, PC Card is hot swappable.
Common uses of PC Card include WiFi cards, network cards, and external modems.
This bus is an external extension of an internal PCI bus.
Serial Port:
A serial port, or RS-232 port, enables a line to be connected that will send bits one after the other
on a single line, like cars on a one-lane highway. This port is used principally for communication
line, modem, and mouse. Serial ports are frequently labeled COM for communications.
Parallel Port:
A parallel port allows lines to be connected that will enable for example 8 bits to be transmitted
simultaneously, like cars on an eight-lane highway. Parallel lines move information faster than
serial lines do, but they can transmit information efficiently only up to 15 feet. Thus parallel ports
are used principally for connecting printers.
Audio Port:
There are typically audio ports on modern computers: one for connecting speaker, another for
connecting microphone and other for MIDI (musical instrument digital interface) port.
Modem Port:
This port connects computer to a phone line for accessing to the Internet.
PREPARED
BY:
CIT-311
Expansion slots are extension of computers bus that provide a way to add new
components to the computer. In other words, they are sockets on the motherboard into which you can
plug expansion cards.
The slots accept expansion boards (also called cards or adapters or simply boards)
Adapters serving as input and output purposes provide a port to which devices can be
attached.
Various adapters or cards are used in a PC such as display adapter (or video controller
adapter, or graphics adapter card), network interface card or adapter, sound card or adapter, internal
modem card, TV card, PCMCIA card or PC card etc.
PLUG AND PLAY
PREPARED
BY:
CIT-311
It is a feature of an operating system that enables user to add new hardware devices to
the computer via an existing port or expansion slot without performing technically difficult
configuration procedures.
Plug and play compliant operating system can automatically detect a new hardware
component, check for existing driver programs that will run the new device, and load necessary files.
Depending on how the new device is connected, this process may require restarting the system for
taking effect the installed hardware component.
PREPARED
BY:
CIT-311
runs because the CPU will need to swap program instructions between RAM and the hard disk
much less often.
Cache memory
Moving data between RAM and the CPUs registers is one of the most time-consuming operation
a CPU must perform, simply because RAM is much slower than the CPU. A partial solution to
this problem is to include a Cache memory in the CPU. When a program is running & the CPU
needs to read data or instructions from RAM, the CPU first checks to see whether the data or
instruction is in cache memory. If the data that it needs is not there, it reads the data from RAM in
to its registers but it also loads a copy of the data into the cache memory. The next time the CPU
needs that same data, it finds it in the cache memory and saves the time needed to load the data
from RAM. Frequently used programs that need a repeated operation is resided in cache memory.
Clock speed
Computers clock is used to time the processing operation of a computer. Clock speed is
measured in hertz (Hz), which means cycles per second. A computers clock speed is 133 MHz; it
means that the computer can turn off and back on again133000000 transistors within a second.
Over the years, computers clock speeds are increasing rapidly. The first PC operated at 4.77
MHz (megahertz). Now a processor with more than 1.5 GHz (gigahertz) is available today. If the
factors like memory, data bus, register size etc are kept equal then a CPU operating at 300 MHz
can process data more than twice as fast as the same one operating at 133 MHz.
Data bus
Each wire on the data bus transfer one bit at a time. Hence, an 8-wires (or 8-bit) data bus can
move eight bits (1 byte) at a time, a 16-wires (or 16-bit) data bus can transfer 16 bits (2 bytes) at a
time, a 32-wires (32-bit) data bus can transfer 32 bits (4 bytes) at a time. Therefore, the number
of wires in the data bus affects the speed at which data can travel between hardware
components. With a wider data bus, the computer can move more data in the same amount of
time (or the same amount of data in less time).
Address bus
The number of wires in the address bus determines the maximum number of memory addresses.
For example, with eight bits, 28=256 different values can be represented. If the address bus
contains 8 wires (i.e. 8-bits address bus), it can carry eight bits at a time and the CPU can address
only 256 bytes of RAM. A PC with 20-bit address bus can address 2 20bytes=1MB of RAM. A PC
with 32-bit address bus can address 220bytes=4GB of RAM. Therefore, the bigger the address bus,
the CPU can address more memory and hence the bigger memory size.
Coprocessor
A co-processor is a separate instruction-set processor that is closely coupled to the CPU and
whose operation is to enhance the processing speed of the main processor (CPU). Complicated
arithmetic operations like exponentiation and trigonometric functions are costly to implement in
the CPU hardware, while software implementations of these operations are slow. An arithmetic or
math coprocessor is used as the auxiliary processor to the CPU to provide fast, low-cost hardware
implementations of these special math functions. Newer CPUs have math coprocessor built-in.
Earlier CPUs did not have them, so many users choose to upgrade their machines by adding them.
CPU-MEMORY INTERCONNECTION
How does the CPU write data into memory and read data from memory?
A computers internal memory is made up of RAM and ROM that are constantly interfaced to the CPU
over three groups of signal lines or signal buses: Address Bus, Data Bus and Control Bus. Each of these
buses consists of several lines (the number of lines in each bus will vary from one computer to another).
PREPARED
BY:
CIT-311
These three buses play a necessary role in allowing the CPU to write data into memory and to read data
from memory.
When a computer is executing a program of instructions, the CPU continually fetches (reads) information
from those locations in memory that contain (1) the program codes representing the operations to be
performed and (2) the data to be operated upon. The CPU will also store (write) data into memory
locations as dictated by the program instructions.
Address Bus
Memory
CPU
Data Bus
Control Bus
Figure: CPU-Memory Connection
WRITE OPERATION
When the CPU is sending data to another computer element, it is called a write operation and the CPU is
writing to the selected element.
READ OPERATION
When the CPU is receiving data from another computer element, it is called a read operation and the CPU
is reading from the selected element.
When the CPU wants to write data to a particular memory location, the following steps must occur:
Write Operation:
Step_1: The CPU supplies the binary address of the memory location where the data are to be stored. It
places this address on the address bus lines.
Step_2: The CPU places the data to be stored on the data bus lines.
Step_3: the CPU activities the appropriate control signal (for this case, memory write operation) using
the control bus.
Step_4: The memory decodes the binary address supplied by the CPU via address bus to determine to
which location is being selected for the store operation.
Step_5: Finally, the data on the data bus are transferred to the selected memory location.
Whenever the CPU wants to read from a specific memory location, the following steps must occur:
Read Operation:
Step_1: The CPU supplies the binary address of the memory location from which data are to be
retrieved. It places this address on the address bus lines.
Step_2: The CPU activates the appropriate control signal lines for the memory read operation.
Step_3: The memory IC decodes the binary address to determine which location is being selected for
the read operation.
Step_4:
The memory IC places data from the selected memory location on the data bus form where
they are transferred to the CPU.
PREPARED
BY:
CIT-311
Computers that have DMA channels can transfer data to and from devices much
more quickly than computers without a DMA channel can. This is useful for making quick backups
and for real-time applications.
Some expansion boards, such as CD-ROM cards, graphics cards, network cards,
sound cards, disk drive controllers, etc are capable of accessing the computer's DMA channel. When
you install the board, you must specify which DMA channel is to be used, which sometimes involves
setting a jumper or DIP switch
On PCs, there are usually eight available DMA channels. Most sound cards are set
to use DMA 1.
Since the CPU is not involved in the data transfer operation and some amount of
the processing time is saved so it is FAST and brings about and overall increase in the performance of
the computer system.
Category of DMA Modes:
Several different DMA modes have been defined for the IDE/ATA interface; they are grouped into two
categories:
(i) Single word DMA modes- when these modes are used, each transfer moves just a single word
of data. This mode is slower than multiword DMA mode.
(ii) Multiword DMA modes- In this mode, a "burst" of transfers occurs in rapid succession, one
word after the other, saving the overhead of setting up a separate transfer for each word. This
of DMA is used in EISA and PCI equipped systems.
DMA Channels
Direct memory access (DMA) channels are system pathways used by many devices to
transfer information directly to and from memory. However, conflicts on DMA channels can cause
very strange system problems and can be very difficult to diagnose. DMAs are used most commonly
today by floppy disk drives, tape drives and sound cards.
Why DMA Channels were invented for data transfer
In computer not using DMA, the CPU would have to copy each piece of data from
the source to the destination. This is typically slower than copying normal blocks of memory since
access to I/O devices over a peripheral bus is generally slower than normal system RAM. During this
time the CPU would be unavailable for any other tasks involving CPU bus access. But it can continue
to work on any work which does not require bus access.
As you know, the processor is the "brain" of the machine, and in many ways it can
also be likened to the conductor of an orchestra. In early machines the processor really did almost
everything. In addition to running programs it was also responsible for transferring data to and from
peripherals. Unfortunately, having the processor perform these transfers is very inefficient, because it
then is unable to do anything else.
The invention of DMA enabled the devices to cut out the "middle man", allowing
the processor to do other work and the peripherals to transfer data themselves, leading to increased
performance. Special channels were created, along with circuitry to control them that allowed the
transfer of information without the processor controlling every aspect of the transfer. This circuitry is
normally part of the system chipset on the motherboard.
Note that DMA channels are only on the ISA bus (and EISA and VLB, since they
are derivatives of it). PCI devices do not use standard DMA channels at all.
PREPARED
BY:
CIT-311
PREPARED
BY:
CIT-311
For Windows XP
1. Go into your Control Panel by first clicking on the Start Button.
2. Then click on the Control Panel icon located in the right column of the
Start Menu.
3. If your Start Menu is set to the Classic View, then begin by clicking on
the Start Button.
4. Then click on Settings, then click on the Control Panel icon to open up
the Control Panel.
5. Now, Double click on the System icon to open up the System Properties
window.
6. Now click on the Hardware tab located at the top of the screen.
7. Then click on the Device Manager button in the center area of the
screen.
8. Now click on the plus sign [+] next to the IDE ATA/ATAPI controllers to
expand that section.
9. Then double click on the Primary IDE Channel to display the Primary IDE
Properties window.
10. Then click on the Advanced Settings Tab at the top of the screen.
11. Now for Device 0, ensure that the Transfer Mode: selection is set to DMA
if available.
12. Then for Device 1, ensure that the Transfer Mode: selection is also set to
DMA if available.
13. Then click on the OK button at the bottom of the screen to save your
settings.
14. Then double click on the Secondary IDE Channel to display the
Secondary IDE Properties window.
15. Then click on the Advanced Settings Tab at the top of the screen.
16. Now for Device 0, ensure that the Transfer Mode: selection is set to DMA
if available.
17. Then for Device 1, ensure that the Transfer Mode: selection is also set to
DMA if available.
18. Then click on the OK button at the bottom of the screen to save your
settings.
Then close Device Manager and the Control Panel to return back to your Windows session.
PREPARED
BY: