COA_Module5_ppt
COA_Module5_ppt
Execution Phase:
Carry out the actions specified by the instruction in the IR
Processor Organization Internal processor
bus
Control signals
PC
Instruction
Address
decoder and
lines
MAR control logic
Memory
bus
MDR
Data
lines IR
Constant 4 R0
Select MUX
Add
A B
Datapath
ALU Sub R n - 1
control ALU
lines
Carry-in
XOR TEMP
To execute an instruction:
1. Transfer a word of data from one processor register to another
register or the ALU
2. Perform an arithmetic or a logic operation and store the result in a
processor register
3. Fetch the contents of a given memory location and load them into
a processor register e.g. mov [R1], R2
4. Store a word of data from a processor register into a given memory
location e.g. mov R1, [R2]
Internal processor
b us
R i in
R i
R i out
1.Register Transfers
in
Constant 4
Select MUX
A B
ALU
Z in
Z out
Figure 7.2. Input and output gating for the registers in Figure 7.1.
1. Register Transfers (contd…)
EX:
Transfer the contents of R1 to R4.
1. Enable output of register R1 by
setting R1𝑜𝑢𝑡=1. This places
the contents of R1 on the
processor bus.
2. Enable input of register R4 by
setting R4𝑖𝑛=1. This loads the
data from the processor bus
into register R4.
Register Transfers
D Q
1
Q
Riout
Ri in
Clock
Ri
The ALU is a combinational circuit
that has no internal storage. R i out
1. R1out, Yin Z in
Figure 7.2. Input and output gating for the registers in Figure 7.1.
2.Performing an Arithmetic or Logic
Operation
Step 1: Output of the register R1 and input of the register Y are
enabled, causing the contents of R1 to be transferred to Y.
Step 2: The multiplexer’s select signal is set to select Y causing
the multiplexer to gate the contents of register Y
to input A of the ALU. The contents of register R2 are gated onto the
bus and, hence, to input B.
Step 3: The output of the arithmetic operation is loaded into memory
The contents of Z are transferred to the destination register R3
Fetching a Word from Memory
Address into MAR; issue Read operation; data into MDR.
MDR
MDRinE MDRin
Timing Clock
MAR in
is always available
on the address lines Read
of the memory bus.
MR
MDR out
Add (R3), R1
1. Fetch the instruction: Fetching an instruction is the process of reading an
operation code from memory and storing it in the instruction register (IR).
2. Fetch the first operand (the contents of the memory location pointed to by
R3)
3. Perform the addition
4. Load the result into R1
Execution of a Complete Instruction
Internal processor
bus
Control signals
Add (R3), R1 PC
Instruction
Address
Step Action lines
decoder and
MAR control logic
Memory
bus
1 PCout , MAR in , Read, Select4,Add, Zin
MDR
Data
2 Zout , PCin , Y in , WMF C lines IR
3 MDR out , IR in Y
Constant 4 R0
4 R3out , MAR in , Read
Select
5 R1out , Y in , WMF C MUX
Step Action
Incrementer
Re gister
different registers to be
file
accessed simultaneously and
Constant 4
have their contents placed on
buses A and B.
MUX
ALU R
B
• Allow the data on bus C to
be loaded into a third register
during the same clock cycle.
Instruction
decoder
IR
• Incrementer unit.
MDR
• ALU simply passes one of
MAR its two input operands
unmodified to bus C
Memory b us Address
data lines lines
Step Action
Control signals
architecture) lines IR
Constant 4 R0
Select MUX
Add
A B
ALU Sub R n - 1
control ALU
lines
Carry-in
XOR TEMP
External
inputs
Decoder/
IR
encoder
Condition
codes
Control signals
Step decoder
T 1 T2 Tn
INS1
External
INS2 inputs
Instruction
IR Encoder
decoder
Condition
codes
INSm
Run End
Control signals
Zin = T1 + T6 • ADD + T4 • BR + …
Branch Add
T4 T6
T1
Figure 7.12. Generation of the Zin control signal for the processor in Figure 7.1.
Generating End
End = T7 • ADD + T5 • BR + (T5 • N + T4 • N) • BRN +…
Branch<0
Add Branch
N N
T7 T5 T4 T5
End
Instruction Data
cache cache
Bus interface
Processor
System b
us
Main Input/
memory Output
MDRout
WMFC
MAR in
Select
Read
PCout
R1out
R3out
Micro -
End
PCin
R1in
Add
Z out
IRin
Yin
instruction
Zin
1 0 1 1 1 0 0 0 1 1 1 0 0 0 0 0 0
2 1 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0
3 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0
4 0 0 1 1 0 0 0 0 0 0 0 0 0 1 0 0
5 0 0 0 0 0 0 1 0 0 0 0 1 0 0 1 0
6 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
Clock PC
Control
store CW
Address Microinstruction
Clock PC
Control
store CW