3 Architecture of CPU
3 Architecture of CPU
3 Architecture of CPU
Haidery
Class XI – Computer
Science
SLO-3
Architecture of CPU
1
By: Alefya
3.1 COMPONENTS OF CENTRAL
PROCESSING UNIT (CPU)
3.1.1 WHAT IS THE ROLE
OF CPU IN COMPUTER
SYSTEM;
3.1.1 WHAT IS THE ROLE OF CPU IN COMPUTER
SYSTEM;
ROLE OF CPU IN COMPUTER SYSTEM
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, must go
through the CPU.
The CPU is sometimes also referred to as the central
processor unit, or processor for short.
3.1.2 DESCRIBE FUNCTIONS OF
COMPONENTS OF CPU,
• Accumulator (AC):
• The accumulator is mainly used for arithmetic and logic operations. It holds one operand and often stores the result of the
operation.
• Example: In operations like addition, the sum is typically stored in the AC register.
• Data Register (DR):
• It temporarily holds the data that is being transferred to or from memory or other devices. It acts as a buffer between the CPU
and memory or I/O devices.
• Example: During a memory read, data is loaded into the DR before it’s used by the CPU.
• Base Register (BR):
• The base register holds the base address of a memory segment. It is often used in indexed or base-offset addressing modes to
compute the effective address.
• Example: If a program is using base addressing, the BR will store the starting address of the segment.
• Counter Register (CR):
• The counter register is used for loop counting or to keep track of iteration in a repetitive operation. It often holds values for the
loop counter.
• Example: In a loop, the CR will decrease with each iteration until the loop is complete.
B. SPECIAL PURPOSE REGISTERS
• Special-purpose registers have dedicated tasks in the execution of
instructions and control of the CPU. They are not used for general data
storage but instead manage specific operations.
• Instruction Register (IR):
• Holds the current instruction being executed by the CPU. It contains the opcode and
sometimes additional data for the instruction.
• Example: When an instruction is fetched from memory, it is placed in the IR for
decoding and execution.
• 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.
THERE ARE FOUR TYPES SPECIAL
PURPOSE REGISTER
SLO # 3.1.3
SPECIAL PURPOSE REGISTERS
Program Counter (PC)
2134 10110011 1 PC
ADDRESS
2135 10100011 4
2134
2136 11100011 2
2137
2138 11110000 3
SPECIAL PURPOSE REGISTERS
Instruction Register (IR)
2134 10110011 1 PC
ADDRESS
2135 10100011 4
2134
2136 11100011 2 IR
10110011
2137
2138 11110000 3
SPECIAL PURPOSE REGISTERS
Memory Address Register (MAR)
2134 10110011 1 PC
ADDRESS
2135 10100011 4
2134
2136 11100011 2 IR
10110011
2137
10110011
2135 10100011 4
SLO # 3.2.1
1. DATA TRANSFER INSTRUCTIONS
• Data transfer instructions are the instructions which
transfers data in the microprocessor.
• These instructions move data between registers, or
between memory and registers.
• These instructions copy data from source to
destination.
• While copying, the contents of source are not modified.
• They are also called copy instructions.
• Examples:
• MOV A, B (Move the contents register A to B)
• LD A (Load the data to register A from memory)
• STO Instruction stores information from register to
2. DATA PROCESSING INSTRUCTIONS
The data processing instructions
manipulate data within registers. They
include
•move instructions,
•arithmetic instructions (ADD, SUB, MUL,
DIV)
•Shifts (Shift to the left of right of an
operand)
•logical instructions (AND, OR, NOT),
3. PROGRAM CONTROL INSTRUCTIONS
•These instructions used to change the
sequence of instruction of a program are
called control transfer instructions.
•These instructions transfer the execution
control to certain part of program
instead of next instruction.
•JUMP and JUMPZ (Jump if zero) etc.
•LOOP (when number of statements are
to be repeated)
WHAT IS INSTRUCTION SET?
An instruction is a statement that tells the computer
to do something. The way an instruction is given is
called instruction format.
A computer has a variety of instruction formats. The
control unit of CPU is responsible to interpret the
instruction code. The control unit also provides the
necessary control function required to process the
instructions. A simple instruction format consists of
16 bits.
INSTRUCTION CODE FORMAT
1. Operand code
16 bits
Instruction Code Format
2. Address of Operand
X = (A+B) * (C+D) MO
R1 2 A 2
V
AD
MOV R1, A R1 6 B 4
D
ADD R1, B MO
R2 3 C 3
V
AD
MOV R2, C R2 9 D 6
D
ADD R2, D MU R1 54 R2 9
L
MO
MUL R1,R2 X 54 R1 54
V
MOV X, R1
TYPES OF INSTRUCTION FORMATS
SLO # 3.2.4
Complex Instruction Set Computer (CISC) and Reduced Instruction Set
Computer (RISC) CISC
Architecture
(Complex Instruction RISC (Reduced Instruction Set
Aspect
Set Computer) Computer)
Instruction Set Large and complex Small and simple