CA L4 CPU2
CA L4 CPU2
1
Three main units CPU, memory and I/O interconnected
through system bus .
System Bus
Input Output
Device Device
Keyboard Printer
Processor Memory
I/O
Devices
Figure 3.1 Functional Units of a simple computer with two I/O devices
2
Processor
3
Processor contd.
• CPU decodes the instructions, and
provides control signals for the execution
to be completed.
• Some operations are performed internally
by the CPU to supply the address, data,
and control signals required by memory
and I/O devices to execute the instruction
4
Components of CPU
• Control Unit
Control Unit fetches the instructions from the main
memory and determines their type. It generates control
signals and microoperations.
• ALU
The arithmetic and logic unit (ALU) performs operations
like addition, subtraction, Boolean AND, OR etc. that are
needed to carry out instructions.
• Registers
Registers are a very high speed memory within the CPU
that stores temporary results, data for computation and
certain control information.
5
Organization of CPU based on
functions it performs
• fetch an instruction
• decode it
• execute it
6
Instruction Implementation
1. Fetch Instruction:
CPU reads instructions from memory
7
Instruction Implementation cont.
5. Fetch data: If the instruction uses data,
fetch it from memory or I/O devices
Data to
Registers memory
Control Arithmetic
Paths and Logic
Unit
Internal
CPU Bus
9
Figure 3.2
• Input to the processor -instructions from the
memory that are to be executed
- data from the memory that is needed for
executing these instructions
• Output of the processor -the resulting data from
execution and is stored in the memory
• The three units are interconnected through
internal buses, which are different from the
system buses.
10
2. Memory
• Various memory technologies exist which vary in capacity,
performance and cost
• Main Memory
• Secondary Memory
• Cache Memory
11
2. Memory
• Main Memory
relatively fast storage, connected directly to the CPU and
is controlled by the CPU itself.
• Secondary Memory
less expensive device and has a very large storage
capacity. generally connected directly to the CPU and
form part of the I/O system.
• Cache Memory
positioned between the CPU and the main memory. The
purpose of is to reduce the delay in access of the main
memory by the CPU. The capacity of cache is very low
and it is a very expensive memory.
12
3. Input/Output
• The third main functional unit of the
computer system is its Input/Output (I/O)
system.
13
3. Input/Output
• Separate memory and I/O buses are used
to communicate with the I/O system.
• The I/O bus creates an interface
abstraction that allows the processor to
interface with a wide range of I/O devices.
• Each module interfaces to the system bus
and controls one or more peripheral
devices
14
Input-Output system
Address Bus
Data Bus
Printer
Keyboard
Output
Input
Device
Device
Processor Memory
I/O System
Control bus
15
Bus
16
Bus
• Buses can be internal or external to the
CPU. The internal buses interconnect the
various components within the CPU. The
external buses connect CPU to memory
and I/O devices.
17
CPU and the system buses
Control
Unit
Arithmetic
- logic Unit
Registers
-………+--
PC-Program Counter PC IR
IR-Instruction Register +………..
MAR-Memory Address Register
-
MBR-Memory Buffer Register ………+--
MAR MBR
+………..
18