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
Sequencing
Logic control unit.
Most commonly used is
microprogrammed
Control Unit
Registers and implementation
Decoders Microprogrammed control
unit operates by executing
microinstructions that define
Control
Memory
the functionality of the
control unit.
Figure shows the structure of
control unit.
6
Structure – the ALU
CPU
Performs
computer data
Arithmetic
Registers and
Logic Unit
processing
Internal CPU functions
Interconnection
Control
Unit
9
Figure illustrates top
level view of
computer
components and
suggests the
interactions among
them.
10
7.3) Instruction Cycle
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
2. Execute Cycle represent the 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 Hold
IR (MBR) 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 (next
data 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
https://t4tutorials.com/example-of-program-execution-contents-of-memory-and-registers-in-hexadecimal/
https://www.sciencedirect.com/topics/engineering/program-execution
Exercise
Main Memory
I/O Module
device 5 device 6
3
.
.
.