0% found this document useful (0 votes)
4 views40 pages

Lecture 3 - Central Processing Unit (CPU) - Updated

Uploaded by

johnkiduge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views40 pages

Lecture 3 - Central Processing Unit (CPU) - Updated

Uploaded by

johnkiduge
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Central Processing Unit (CPU)

Its components and functionality

Computer Organization and Architecture December 9, 202 1


4
What is CPU?

 A CPU is refer to as a brain of a computer system.


 A computer CPU is an electronic microchip or
Microprocessor that performs processing based on
the instructions given to the data by the user.

Computer Organization and Architecture December 9, 20 2


24
Parts of Central Processing
Unit (CPU)

Computer Organization and Architecture December 9, 20 3


24
CPU has three main parts

 1. Control Unit
 2. Arithmetic and Logic Unit
 3. Memory Unit

Computer Organization and Architecture December 9, 20 4


24
1. Control Unit (CU)

 The control unit controls the way input and output


devices, the Arithmetic, and Logic Unit, and the
computer’s memory respond to the instruction
sent to the CPU.
 There are two types of Control units –
i. Hardwire CU
ii. Microprogrammable CU.

Computer Organization and Architecture December 9, 20 5


24
Functions of Control
Unit
 It controls the sequence in which instructions move in and
out of the processor and also the way the instructions are
performed.
 It is responsible for fetching the input, converting it into
signals, and storing it for further processing and store results.
 It controls the functioning of other components of the CPU
like ALU and Registers.
 It directs the flow of data sequence between the processor
and other devices.
 It can interpret the instructions and controls the flow of data
in the processor.
 It generates the sequence of control signals from the
received instructions or commands from the instruction
register.
 To transfer the data, it communicates with the input and
Computer Organization and Architecture December 9, 20 6
output devices and controls all the units
24 of the computer.
2. Arithmetic Logic Unit (ALU)

 The Arithmetic and Logical Unit is responsible for


arithmetical and logical calculations as well as
taking decisions in the system.
i. Arithmetic Section: Performs arithmetic
operations such as addition, subtractions, division
and multiplication, etc.
ii. Logic Section: This performs logic operations like
selecting, matching, comparing, or merging the
data, etc.

Computer Organization and Architecture December 9, 20 7


24
Functions of ALU

 It is mainly used to make decisions like


performing arithmetic and logical operations.
 It acts as a bridge between the computer’s
primary memory and the secondary memory. All
information that is exchanged between the
primary and secondary memory passes through
the ALU.

Computer Organization and Architecture December 9, 20 8


24
3. Memory Unit

a)Registers
A register is a small amount of high-speed memory. It is
connected to the microprocessor and can be accessed much
more quickly than any other part of the computer.

Registers are a part of a computer’s memory that is used to store


the instructions temporarily to provide the processor with the
instructions at times of need.

Computer Organization and Architecture December 9, 20 9


24
Types of registers

 There are 8 registers in the CPU, which are


designated by their numbers 0-7.
 There are various types of registers,
i. MAR Register (Memory Address Register)
ii. MDR Register (Memory Data Register )
iii. MBR Register
iv. PC Register (Program Counter )
v. Index Register
vi. Instruction Register (IR)
vii. Accumulator Register

Computer Organization and Architecture December 9, 20 10


24
Registers….
 MAR Register
Memory Address Register (MAR) is a register within the
computer that contains the address of the next location
to be accessed or the address to which data will be sent
and stored.
 MDR Register
The Memory Data Register (MDR) is used to store the data that
will be stored or will be fetched from the computer memory I.e.
Random-access Memory (RAM).
 MBR Register
Is the register in a computer's CPU that stores the data being
transferred to and from the immediate access storage.
 PC Register
Program Counter (PC) is a processor register that contains the
memory address of the next instruction which is to be fetched
and executed from the memory.
Computer Organization and Architecture December 9, 20 11
24
Registers….
 Index Register
An index register in a computer's CPU is a processor register
used for pointing to operand addresses during the run of a
program. It is useful for stepping through strings and arrays. It
can also be used for holding loop iterations and counters
 Instruction Register
In computing, the instruction register (IR) or current instruction
register (CIR) is the part of a CPU's control unit that holds the
instruction currently being executed or decoded.
Holds the opcode which defines the type of instruction.
 Accumulator Register
This is a register in which intermediate arithmetic logic unit
results are stored.

Computer Organization and Architecture December 9, 20 12


24
Functions of Registers

 Input registers are used to carry the input.


 Output registers are used to carry the output.
 Temporary registers store data temporarily.
 Address registers store the address of the
memory.
 The program counter stores the address of the
instructions.
 Data registers hold the memory operand.
 Instruction registers hold the instruction codes.

Computer Organization and Architecture December 9, 20 13


24
b) Cache Memory

 Cache is a type of Random Access Memory which


stores small amounts of data and instructions
temporarily which can be reused as and when
required.
 It reduces the amount of time needed to fetch the
instructions as instead of fetching it from the RAM,
it can be directly accessed from Cache in a small
amount of time.
 The more cache there is, the more data can be
stored closer to the CPU

Computer Organization and Architecture December 9, 20 14


24
Cache Memory….

 Cache is graded as Level 1 (L1), Level 2 (L2) and


Level 3 (L3):
i. L1 is usually part of the CPU chip itself and is both
the smallest and the fastest to access. Its size is
often restricted to between 8 KB and 64 KB.
ii. L2 and L3 caches are bigger than L1. They are extra
caches built between the CPU and the RAM.
Sometimes L2 is built into the CPU with L1. L2 and L3
caches take slightly longer to access than L1. The more
L2 and L3 memory available, the faster a computer can
run.
 Not a lot of physical space is allocated for cache.
There is more space for RAM, which is usually larger
and less expensive.
Computer Organization and Architecture December 9, 20 15
24
Functions of Cache
Memory
 They reduce the amount of time needed to fetch
and execute instructions.
 They store data temporarily for later use.

Computer Organization and Architecture December 9, 20 16


24
Other CPU components

 Buses
 Clock
 Interrupt request (IRQ)
 Direct Memory Access (DMA).

Computer Organization and Architecture December 9, 20 17


24
Buses

A bus is a link between the different components of


the computer system and the processor.
They are used to send signals and data from the
processor to different devices and vice versa.

Computer Organization and Architecture December 9, 20 18


24
Buses…..

There are three types of buses


i. Address bus - used to send memory address from
processor to other components.
ii. Data bus - used to send actual data from the
processor to the components
iii. Control bus - used to send control signals from the
processor to other devices.

Computer Organization and Architecture December 9, 20 19


24
Functions of Bus

 It is used to share data between different devices.


 It supplies power to different components of the
system.

Computer Organization and Architecture December 9, 20 20


24
Clock

As the name suggests, the clock controls the timing


and speed of the functions of different components
of the CPU.
It sends out electrical signals (pulses) which regulate
the timing and speed of the functions.
The frequency of the pulses is known as clock
speed.
Clock speed is measured in hertz (Hz)

Computer Organization and Architecture December 9, 20 21


24
Functions of Clock

 It maintains the synchronization of the


components of the computer system.
 It keeps track of the current date and time.

So, this is all about the major components of the


CPU which are responsible for the smooth processing
of instructions and data in the computer system.

Computer Organization and Architecture December 9, 20 22


24
Interrupt Request (IRQ)

 IRQ stands for Interrupt ReQuest and refers to special


numbered channels that are used by devices to get the
processors attention.
 In a computer, an interrupt request is a hardware signal
sent to the processor that temporarily stops a running
program and allows a special program, an interrupt handler,
to run instead.
 Hardware interrupts are used to handle events such as
receiving data from a modem or network card, key presses,
or mouse movements.
 For example, when you press a key on your keyboard it
sends a signal to the processor via an IRQ channel (usually
IRQ1) to let it know that it needs to process some data.
Computer Organization and Architecture December 9, 20 23
24
Function of IRQs

 An IRQ (interrupt request) value is an assigned


location where the computer can expect a particular
device to interrupt it when the device sends the
computer signals about its operation. For example,
when a printer has finished printing, it sends an
interrupt signal to the computer.
 The signal momentarily interrupts the computer so
that it can decide what processing to do next. Since
multiple signals to the computer on the same interrupt
line might not be understood by the computer, a
unique value must be specified for each device and its
path to the computer. Prior to Plug-and Play (PnP)
devices, users often had to set IRQ values manually
(or be aware of them) when adding a new device to a
computer.
Computer Organization and Architecture December 9, 20 24
24
Direct memory access
(DMA)
 Direct memory access is a feature of computer
systems and allows certain hardware subsystems
to access main system memory independently of
the central processing unit.
 Direct Memory Access (DMA) is a capability
provided by some computer bus architectures that
allows data to be sent directly from an attached
device (such as a disk drive) to the memory on
the computer's motherboard. The microprocessor
is freed from involvement with the data transfer,
thus speeding up overall computer operation.

Computer Organization and Architecture December 9, 20 25


24
Direct memory access
(DMA) cont..
 Usually a specified portion of memory is
designated as an area to be used for direct
memory access.
 In the ISA bus standard, up to 16 megabytes of
memory can be addressed for DMA.
 The EISA and Micro Channel Architecture
standards allow access to the full range of
memory addresses (assuming they're addressable
with 32 bits). peripheral component interconnect
accomplishes DMA by using a bus master (with
the microprocessor "delegating" I/O control to the
PCI controller).

Computer Organization and Architecture December 9, 20 26


24
DMA Advantages and
Disadvantages
 It transfers the data without involving the
processor, so the read-write task gets speed up.
 It decreases the clock cycle needed to write or
read a block of data.
 It reduces the workload of the processor.
Disadvantages
 The additional cost of the hardware and the added
complexity of the software.
 The problem of cache coherence can occur while
using it.

Computer Organization and Architecture December 9, 20 27


24
Enhancing CPU
Operation
Various CPU manufacturers complement their CPU
with performance enhancing features.
Intel incorporates Hyper-Threading to enhance the
performance of some of their CPUs.
AMD processors use Hyper-Transport to enhance
CPU performance.
Overclocking is a technique used to make a
processor work at a faster speed than its original
specification.
CPU throttling is a technique used when the
processor runs at less than the rated speed to
conserve power or produce less heat.
Computer Organization and Architecture December 9, 20 28
24
Multicore Processors

Computer Organization and Architecture December 9, 20 29


24
CPU Architectures

In computer hardware, a CPU socket or CPU


slot contains one or more mechanical components
providing mechanical and electrical connections
between a microprocessor and a printed circuit
board (PCB).
This allows for placing and replacing the central
processing unit (CPU) without soldering.

Computer Organization and Architecture December 9, 20 30


24
CPU Form Factors

CPUs come in different form factors, each style


requiring a particular slot or socket on the
motherboard.
The CPU socket or slot is the connection between
the motherboard and the processor.
Modern CPU sockets and processors are built around
the following architectures:
i. Pin Grid Array (PGA)
ii. Land Grid Array (LGA)

Computer Organization and Architecture December 9, 20 31


24
CPU CPU Socket 370

Pin Grid Array (PGA)

Land Grid Array (LGA)


Computer Organization and Architecture December 9, 20 32
24
CPU Architectures….

A program is a sequence of stored instructions.


A CPU executes these instructions by following a
specific instruction set.
There are two distinct types of instructions sets that
CPUs may use:
 Reduced Instruction Set Computer (RISC)
 Complex Instruction Set Computer (CISC)

Computer Organization and Architecture December 9, 20 33


24
Reduced Instruction
Set Computer (RISC)
This architecture uses a relatively small set of
instructions.
RISC chips are designed to execute these instructions
very rapidly.
What is RISC?
A Reduced Instruction Set Computer is a type of
microprocessor architecture that utilizes a small,
highly-optimized set of instructions rather than the
highly-specialized set of instructions typically found
in other architectures.

Computer Organization and Architecture December 9, 20 34


24
Characteristic of RISC

 Simpler instruction, hence simple instruction


decoding.
 Instruction comes undersize of one word.
 Instruction takes a single clock cycle to get
executed.
 More general-purpose registers.
 Simple Addressing Modes.
 Fewer Data types.
 A pipeline can be achieved.

Computer Organization and Architecture December 9, 20 35


24
Complex Instruction
Set Computer (CISC)
This architecture uses a broad set of instructions,
resulting in fewer steps per operation.
While the CPU is executing one step of the program,
the remaining instructions and the data are stored
nearby in a special, high-speed memory, called
cache.
What is CISC?
They are chips that are easy to program that makes
efficient use of memory.
CISC eliminates the need for generating machine
instructions to the processor

Computer Organization and Architecture December 9, 20 36


24
Characteristic of CISC

 Complex instruction, hence complex instruction


decoding.
 Instructions are larger than one-word size.
 Instruction may take more than a single clock
cycle to get executed.
 Less number of general-purpose registers as
operations get performed in memory itself.
 Complex Addressing Modes.
 More Data types.

Computer Organization and Architecture December 9, 20 37


24
Instruction Set of
Processor
The set of all instructions that a CPU can perform is
called an instruction set of the processor.
The important types of instructions inside an
instruction set are
I. Arithmetic Instructions
II. Logical Instructions
III. Data Transfer Instructions
IV. Control Transfer Instructions.

Computer Organization and Architecture December 9, 20 38


24
Instruction Set of
Processor…
i. Arithmetic Instructions: The instructions that are
based on digits or arithmetic values used to perform
arithmetic operations are called arithmetic instructions.
ii. Logical Instructions: The instructions used in order to
perform logical operations are called logical instructions.
A logical operation is the comparison of two data values.
iii. Data Transfer Instruction: The instruction used to
transfer data from one component to another
component during program execution is called data
transfer instructions.
iv. Control Transfer Instruction: The instruction used to
change the sequence of instructions of a program is
called control transfer instructions.

Computer Organization and Architecture December 9, 20 39


24
The four main functions of the
CPU

Computer Organization and Architecture December 9, 20 40


24

You might also like