Basic Processing Unit
Basic Processing Unit
oraganization
Execution of one instruction requires the following
three steps to be performed by the CPU:
2. Fetch the contents of the memory location pointed
at by the PC. The contents of this location are
intepreted as an instruction to be executed. Hence,
they are stored in the instruction register (IR).
Simbolically, this can be written as:
IR [[PC]]
4. Assuming that the memory is byte addressable,
increment the contents of the PC by 4, that is
PC [PC] + 4
6. Carry out the actions specified by the instruction
stored in the IR
But, in cases where an instruction occupies
more than one word, steps 1 and 2 must be
repeated as many times as necessary to
fetch the complete instruction.
Two first steps are ussually referred to as
Ri
X
Riout
Yin
Input and output X
Constant 4
gating for the Y
registers select
Mux
A B
ALU
Zin
X
Zout
Connection and
control signals
for register
MDR
CPU transfers the address of the required information word to the memory
address register (MAR). Address of the required word is transferred to the
main memory.
Meanwhile, the CPU uses the control lines of the memory bus to indicate that
a read operation is required.
After issuing this request, the CPU waits until it receives an answer from the
memory, informing it that the requested function has been completed. This is
accomplished through the use of another control signal on the memory bus,
which will be referred to as Memory Function Completed (MFC).
The memory sets this signal to 1 to indicate that the contents of the
specified location in the memory have been read and are available on the data
lines of the memory bus.
We will assume that as soon as the MFC signal is set to 1, the information on
the data lines is loaded into MDR and is thus available for use inside the CPU.
This completes the memory fetch operation.
MAR [R1]
Start Read operation on the memory bus
Wait for the MFC response from the
memory
Load MDR from the memory bus
R2 [MDR]
R1out, MARin, Read
MDRinE, WMFC
MDRout, R2in
That is similar procedure with fetching a word
from memory.
The desired address is loaded into MAR
Then data to be written are loaded into MDR, and
a write command is issued.
If we assume that the data word to be stored
in the memory is in R2 and that the memory
address is in R1, the Write operation requires
the following sequence :
MAR [R1]
MDR [R2]
Write
Wait for the MFC
R1out, MARin
R2out, MDRin. Write
MDRoutE, WMFC
Consider the instruction :
Add (R3), R1
Executing this instruction requires the
following actions :
1. Fetch the instruction
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
PCout, MARin, Read, Select4, Add, Zin
Zout, PCin, Yin, Wait for the MFC
MDRout, IRin
R3out, MARin, Read
R1out, Yin, Wait for MFC
MDRout, Select Y, Add, Zin
Zout, R1in, End
PCout, MARin, Read, Select4, Add, Zin
Zout, PCin, Yin, Wait for the MFC (WFMC)
MDRout, Irin
offset_field_of_IRout, Add, Zin
Zout, PCin, End
Three bus
organization of the
datapath
PCout, R=B, MARin, Read, IncPC
WFMC
MDRoutB, R=B, IRin
R4out, R5outB, SelectA, Add, R6in, End.