3.1 Components of Central Processing Unit
3.1 Components of Central Processing Unit
Architecture of CPU
Adapted by: Mr. Younus Bashir
Sub Topic
1
1/19/2023
SLO # 3.1.1
The central processing unit (CPU) of a computer is a piece of hardware that carries
out the
instructions of a computer program. It performs the basic arithmetical, logical, and
input/output
operations of a computer system. The CPU is like the brains of the computer - every
instruction,
no matter how simple, has to go through the CPU.
The CPU is sometimes also referred to as the central processor unit, or processor for
short.
2
1/19/2023
•Fetch:
Each instruction is stored in memory and has its own address. The processor takes this
address number from the program counter, which is responsible for tracking which
instructions the CPU should execute next.
•Decode:
All programs to be executed are translated to into Assembly instructions. Assembly code
must be decoded into binary instructions, which are understandable to your CPU. This step
is called decoding.
•Execute:
While executing instructions the CPU can do one of three things: Do calculations with its
ALU, move data from one memory location to another, or jump to a different address.
•Store:
The CPU must give feedback after executing an instruction, and the output data is written
to the memory.
What is an ALU?
An arithmetic logic unit (ALU) is a digital circuit used to perform arithmetic and logic
operations. It represents the fundamental building block of the central processing unit
(CPU) of a computer. Modern CPUs contain very powerful and complex ALUs.
3
1/19/2023
•Logical Operations:
These include AND, OR, NOT, XOR, NOR, NAND, etc.
•Bit-Shifting Operations:
This pertains to shifting the positions of the bits by a certain number of places
to the right or left, which is considered a multiplication operation.
•Arithmetic Operations:
This refers to bit addition and subtraction. Although multiplication and division
are sometimes used, these operations are more expensive to make. Addition can
be used to substitute for multiplication and subtraction for division.
Control Unit:
A control unit (CU) handles all processor control signals. It directs all
input and output flow, fetches code for instructions from micro
programs and directs other units and models by providing control and
timing signals.
4
1/19/2023
Cache memory:
5
1/19/2023
It also avoids the need to access the dynamic RAM to retrieve the same
data repeatedly.
Internal Bus:
6
1/19/2023
Data bus,
Address bus,
Control bus.
The system bus is an internal bus, intended to connect the processor with
internal hardware devices, and is also called the “local” bus,
Address Bus
•The size (width) of the address bus is specified by the number of bits it
can handle.
•The more bits there are in the address bus, the more memory locations a
microprocessor can access.
7
1/19/2023
Data Bus
Control Bus
•The control bus carries the control signals that make sure everything is
flowing smoothly from place to place.
8
1/19/2023
Address bus
MAR
ALU
ROM RAM I/O I/O
interface devices
CPU
MAR
Data bus Control
CU bus
SLO # 3.1.3
9
1/19/2023
Register Memory:
The number of registers are different for any particular CPU and the
more register a CPU have will result in easier programming tasks.
Registers are normally measured by the number of bits they can hold, for
example, an "8-bit register" or a "32-bit register".
Registers Characteristics
•These are the high speed memory locations built into the
microprocessor.
•The CPU uses these locations to store data and instructions
temporarily for processing.
•CPU processes, stores and transfer data from one component to
another with the help of registers.
•The number of register varies among computers.
•It increases the performance of CPU.
•Each register receives the information, holds it temporarily and pass it
on, as directed by CU.
•The size of register depends on the computer architecture
10
1/19/2023
There are four general purpose registers which are AX, BX, CX and DX.
Each can be used to manipulate a whole 16-bit word or with two separate
8-bit bytes. These bytes are called the lower and upper order bytes. Each
of these registers can be used as two 8-bit registers.
These are:
•Accumulator (AX)
11
1/19/2023
Accumulator:
•AX, which is named the accumulator. It is used for all input/output
operations and some arithmetic operations. For example, multiply, divide
and translate instructions assume the use of AX.
The AX register is the most general purpose of the four registers and is
usually used for all types of operations
Base Register:
•BX, which is named the base register. It can be used as an address
register. It is used for arithmetic and data movement. It has special
addressing capabilities.
Counter Register:
•CX, which is the count register. It is used by instructions which require
to count. Typically it is used for controlling the number of times a loop is
repeated and in bit shift operations.
Data Register:
•DX, which is the data register. It is used for some input/output and also
when multiplying and dividing.
12
1/19/2023
13
1/19/2023
•stores the data being transferred to and from the immediate access
storage.
•It is also known as the Memory data register (MDR).
14
1/19/2023
hold program state; they usually include the Can store both data and addresses, i.e.,
program counter (aka instruction pointer), they are combined Data/Address registers.
stack pointer, and status register (aka
processor status word). In embedded
microprocessors, they can also correspond to
specialized hardware elements
Instruction Register (IR), Memory Address Accumulator (AC) and Data Register (DR),
Register (MAR), Program Counter (PC), Base Register (BR), Counter Register (CR)
Memory Buffer Register (MBR)
Resources
Role of CPU
https://study.com/academy/lesson/central-processing-unit-cpu-parts-definition-function.html
Functions of ALU
https://computersciencewiki.org/index.php/Functions_of_the_arithmetic_logic_unit_(ALU)
Cache memory
https://searchstorage.techtarget.com/definition/cache-memory
15