Chapter 7 - Processor Structure and Function
Chapter 7 - Processor Structure and Function
Chapter 7 - Processor Structure and Function
CPU
Computer Arithmetic
Registers and
I/O Logic Unit
System CPU
Bus
Internal CPU
Memory Interconnection
Control
Unit
3
CPU
4
Structure – the control unit
CPU
Arithmetic
Registers and
Logic Unit
5
Control Unit
Several approaches to the
implementation of the control unit.
Sequencing
Logic Most commonly used is
microprogrammed implementation
Microprogrammed control unit
Control Unit
Registers and operates by executing
Decoders microinstructions that define the
functionality of the control unit.
Figure shows the structure of
Control
Memory
control unit.
6
Structure – the ALU
CPU
Performs computer
Arithmetic
Registers and data processing
Logic Unit
functions
Internal CPU
Interconnection
Control
Unit
9
Figure illustrates top level
view of computer
components and suggests
the interactions among
them.
10
7.3) Instruction Cycle
The function of computers is to execute programs.
Programs comprise a set of instructions and data
that is stored in the main memory.
Every instruction will be taken and executed by the
CPU one by one until all of them are executed.
11
Instruction Cycle (cont.)
The process of executing a single instruction is called
Instruction Cycle which can be divided into:
1. Fetch Cycle
read the next instruction from MM into the CPU.
Operation code (to represent the
2. Execute Cycle operation)
12
fetch
execute
fetch
Fetch Cycle
The process of fetching an instruction from MM into
the CPU
4 registers are involved:
i. PC (Program Counter)
- Temporary hold the address of an instruction (in MM) that
has to be fetched and executed in the CPU
ii. MAR (Memory Address Register)
- A register that connected to the MM through
the address bus.
- Temporary hold the address of an instruction from the PC.
- The content in PC will be transferred into the
MAR and then to the address bus and to the
location in MM that pointed by the address given.
14
iii. MBR (Memory Buffer Register)
- A register that connected to the MM through
the data bus
- Used to temporary hold instruction or data taken from
the MM or data that will be moved into the
MM or other computer components after
being processed by the CPU.
15
Generally the process in the
Fetch Cycle can be depicted by:
MAR ← PC (specify address in MM for
the next read/write)
MBR ← M (MAR) (data to be
written/received from memory)
PC ← PC + 1 (hold address to be
fetched next. CPU increment the PC after
each instruction)
IR ← (MBR) (fetched instruction is
loaded into register)
16
Address of the Connected to MM
instruction MAR PC
PC PC+1
Address bus
Data bus
Hold instruction
before it is decoded
IR (MBR) Hold instruction/data
taken from MM to be
written to MM
MBR M(MAR)
Execute Cycle
The process of executing the instruction that has been fetched
earlier in fetch cycle.
18
2
1 ALU
X (Data) 3
(Data) R1
MM CPU
19
Before the addition operation is performed in the ALU, the
required data is taken and moved into a register in the CPU
The data in R1 is already in the CPU (R1 is one of the
registers in CPU)
The addition operation is performed in ALU and the result is
stored in the R1 register
20
Instruction Cycle State Diagram
• A more detailed look at the basic instruction cycle.
• The figure is in the form of a state diagram.
• For any given instruction cycle, some states may be null and others
may be visited more than once.
21
Example of Program Execution Increment
Load data (next
from instruction)
address 940
A single
register
MAR
MBR Load data to
Accumulator (AC)
Add with
the contents
of 941
Add
Store in 941
store
Exercise
Main Memory
I/O Module
device 5 device 6
3
.
.
.