C4 - Central Processing Unit
C4 - Central Processing Unit
THE PROCESSING
UNIT
Definition of CPU.
Central Processing Unit is referred as CPU, defined to be, the
part of the computer that do bulk of data-processing operations.
The CPU is made up from THREE (3) major parts which is:
• register set
• arithmetic-logic unit (ALU)
• control unit
Clock Unit
The clock unit controls the speed of the computer.
Types of instruction cycle
The control unit of a computer is designed to go through an instruction
divided into
cycle that is THREE (3) major Step 1 - Fetch the instruction from
phases. memory
Program Counter (or PC) keeps track of
the instructions in the program stored in
Decod memory. Program counter holds the
address of the instruction to be executed
e next and is incremented each time an
instruction is fetch
from
Step 2 - Decode the instruction
memory.
The decoding is done to determine the
operation to be performed, the addressing
Fetc Execut mode of the instruction, and the location
of the
h e operands.
Step 3 - Execute the
instruction The computer then
executes the instruction and return to
4
step 1 to fetch the next
Understand stack organization
• The register that holds the address for the stack is called a
stack pointer (SP) because its value always point at the top
item in the stack.
Note!
•The operation of the stack can be compared to a stack of
tray. The last tray placed on the top is the first taken off.
10
Function of register and
memory stack
i.Register Stack
A stack can be placed in a portion of a large memory or it
can be organized as a collection of a finite number of
memory words or registers.The stack pointer register
(SP) contains a binary number whose value is equal to the
address of the word/register that is currently on top of
the stack.
ii.Memory Stack
A stack can exist as a stand-alone unit or can be implemented
in a random-access memory attached to a CPU.The
implementation of a stack in the CPU is done by assigning a
portion of memory to a stack operation and using a processor
Computer Memory with program, data & stack
segment
The three registers are M em o ry U n it
Program 1000
connected to a common PC
(Instructions)
address bus, and either one
can provide an address for AR Data 2000
(Operands)
memory.
PC is used during the fetch
phase Stack 3000
to read instruction
AR is used during the SP
3997
3998
execute 3999
(A + B)(D + E)C * F + *
2.The operand is pushed into the stack in the order in which they
appear.
(a)The two top most operands in the stack are used for the operation.
(b)The stack is popped the result of the operation replace he lower
operand.
Evaluation of Arithmetic Expressions
Complex Instruction Set Computers
(CISC)
Complex Instruction Set Computer (or CISC) is a computer
with a larger number of instruction.