Datapath Microroutine
Datapath Microroutine
Introduction
• Movement of data within a processor from one component to another
• Registers, ALU, and the interconnecting bus collectively form the
datapath
• ALU
• Performs arithmetic and logical operations
• Contains control lines to select one of the possible ALU
operations
• Registers
• General purpose registers to store data, memory address register
(MAR), memory data register (MDR), program counter (PC),
instruction register (IR), temporary registers (optional)
• Buses
• Internal (one or more) and external to carry the data from one
component to another 2
Single Bus
Organization of
Datapath
3
Basic Steps in Instruction Execution
• Fetch the contents of the memory location pointed to by the PC.
Load these contents into the IR to be interpreted.
IR [PC]
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 4
Basic Steps in Instruction Execution
• Most instructions involve the following operations:
• Transfer a word of data from one processor register to another
or the ALU
• Perform an arithmetic or logical operation and store the result
in a processor register
• Fetch the contents of a memory location and load them into a
processor register
• Store a word of data from a processor register into a memory
location
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 5
Register Transfer
MOV R1, R4
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 6
Arithmetic and Logic Operations
ADD R1, R2,
R3
•,
•,,,
•,
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 7
Memory Read and Write
• Memory Read
MOV (R1),
R2
• Memory Write
MOV R2,
(R1)
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 8
Execution of a Complete Instruction
ADD (R3), R1
9
Multi Cycle Data Path Architecture
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 10
Why Multi Cycle Data Path ?
• In a single cycle data path architecture , exclusively single data word
could be moved through the bus in a given clock cycle
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 11
How Multi Cycle Data Path Works
• Three buses are used to link reg and ALU of the CPU
• All GPR ,
R1, R2…Rn are presented in one block known as reg files
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 12
Multi Cycle Data Path
Architecture
13
Add R6, R4, R5
14
How Multi Cycle Data Path Works
• One input and two output ports
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 15
How Multi Cycle Data Path Works
• Bus A and B are used to move the source operands to i/ps of the ALU
A and B
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 16
Execution of Instruction using Multi Cycle Data Path
Add R6, R4, R5 Control Sequence
• The inst adds the values of register R4 & R5 and stores the resultant in
R1
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 17
Multi Cycle Data Path Add R1, R2,
R3 Control Sequence Explanation
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 18
Multi Cycle Data Path Add R1, R2, R3 Control
Sequence Explanation
• Step 2: The processor waits for WMFC signal from the memory
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 19
Multi Cycle Data Path Add R6, R4,
R5 Control Sequence Explanation
• Step 4: Two values from reg R4 & R5 are made accessible at inputs A
and B of ALU by means of Bus A & B
Prepared by Dr. R.V. Aswiga, Dr. K.M. Monica, Dr. G. Anushiya Rachel 20