You are on page 1of 14

Lecture 2

CPU BASICS
Central Processor Unit
Figure 1-1 Block Diagram of a Digital Computer

Memory

CPU

Interface Port
Input Device Output Device
Or IOP
A typical CPU has three major components:

register set
 arithmetic logic unit (ALU)
 control unit (CU)
Register

A CPU contains very fast memory called registers.


The register can do one of two things: it can
parallel load the inputs, that is, it can read in all
four inputs and store the four bits into the array.
Each element of the array can store a single bit.
The black box shown has four inputs or (8, 16, 32 inputs).

Data Inputs

b3 b2 b1 b0
1 0 1 0
z3 z2 z1 z0

Outputs
Register Types

The register set differs from one computer


architecture to another. It is usually a
combination of general-purpose and
special purpose registers.
General-purpose registers are used for
any purpose, hence the name general
purpose. For example (A, B, C, D, R1, R2, R3)
Special-purpose registers have specific
functions within the CPU.
For example of special-purpose registers:
The program counter (PC) is a special-
purpose register that is used to hold the
address of the instruction to be executed
next.
The instruction register (IR) which is used
to hold the instruction that is currently
executed.
Other processor registers used by a program instruction.

• Instruction Decoder (ID)


• MAR (Memory Address Register)
• MDR (Memory Data Register) .
ALU
The ALU provides the circuitry needed to
perform the arithmetic, logical and shift
operations demanded of the instruction
set.
Control Unit
The control unit is the entity responsible
for fetching the instruction to be
executed from the main memory and
decoding and then executing it.
A typical and simple execution cycle can be summarized as follows:

 The next instruction to be executed, whose


address is obtained from the PC, is fetched from
the memory and stored in the IR.
 The instruction is decoded.
 Operands are fetched from the memory and
stored in CPU registers, if needed.
 The instruction is executed.
 Results are transferred from CPU registers to the
memory, if needed.
Figure 2.1 Central processing unit main components and
interactions with the memory and I/O

Memory System

CPU

ALU



Control Unit
Registers

Input / Output
The CPU fetches instructions from
memory, reads and writes data from and
to memory, and transfers data from and
to input/output devices.
Question
-List the main components of CPU.
-Define the following:
 Register
 ALU
 Control Unit

You might also like