





















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!






















Multiple Cycle Approach
Clk
Cycle
I fetch ID/Reg Exec Mem Wr
Cycle 1 Cycle 2 Cycle 3 Cycle 4 Cycle 5 Clk (^) Clk
The single cycle operations are performed in five steps: Instruction Fetch Instruction Decode and Register Read Execute (R- I-type or address for Load/store/Branch) Memory (Read/write) Write (to register file)
In the Single Cycle implementation, the cycle time is set to accommodate the longest instruction, the Load instruction.
In the Multiple Cycles implementation, the cycle time is set to accomplish longest step, the memory read/write
Consequently, the cycle time for the Single Cycle implementation can be five times longer than the multiple cycle implementation.
As an example, if T = 5 μ Sec. for single cycle then T= 1 μ Sec. for multi cycle implementation
For different classes of instructions, Multi Cycle implementation may take 3, 4 or 5 cycles to fetch and execute an instruction Now in order to compare the performance of single cycle and multi cycle implementations, let us consider a program segment comprising three instructions, given in the sequence: Load Store R-type (say Add)
The execution time for these three instructions using single cycle implementation with cycle length equals 5 μ Sec is:
Note that here the cycle time is long enough for the load instruction, but it is too long for the Store and R-type instruction So the last part of the cycle, in case of the store and 4th^ (memory) part in case of R-type instruction is wasted.
Data Rreg # Rreg # Register File Wreg#
A ALU
B
Inst. Reg. P^ ALUout C
Memory Address Inst. Or data
Data
Data Reg.
Explanation Next slide ……….
High level view of Multiple Cycle Datapath: Explanation
Here, a shared memory is used, as the instruction fetch and data read/write are performed in different cycles
The single ALU is shared among the instruction fetch, execute arithmetic and logic instructions and address calculation in different cycles
The use of shared function unit (ALU) requires additional multiplexers or widening of multiplexers
New temporary registers, Instruction register, Data memory, operand A and B and ALUout, are included to hold the information for use in later cycle
E.g.; Memory read in cycle 4 is written in cycle 5 (Load), operand registers A and B read in cycle 2 may be used in cycle 3 or 4, and so on
Multiple Cycle Datapath Architecture
Immunized Hardware: 1 memory, 1 adder
Cycle 1 - [Instruction Fetch]:
firstly, MUX-1 select input IorD =0 and the PC is connected to the Memory Read address input RAdr; instruction is fetched from the memory at Dout and is placed in the Instruction Register by inserting IRWr [Yellow Path]
Secondly, the select input ALUSelA to MUX- 3 , is made equal to 0,, ALUSelB to MUX- 5 is made equal to 00 to add 4 to PC; then PCSrc of MUX- 2 is made 0 and PCWr is asserted to load PC+4 to the PC as address of the next instruction
Multiple Cycle Datapath Architecture
Cycle 2 – [ID and Reg. Rd.]
Multiple Cycle Datapath Architecture
ALUSelA = 1 and ALUSelB = 11 to connect bus A and Sign Extended Imm16 to ALU to perform the operation on immediate data [Red Path]
The ALU output is kept in ALU OUT Register as result of ALU OP execution in case of I-type operation and as Memory address in case of memory instructions Load/store
Multiple Cycle Datapath Architecture
1: Condition Test: ALUSelA = 1 and ALUSelB = 01; ALUop=SUB If ALU output Zero =1 then assert PCWrCond and 2: PC PC+4+[Sign Extend Imm16 and Shift left 2 bits] ALUSelA = 0 ; ALUSelB = 10 Assert BrWr ; and PCSrc of MUX-2 = 1 to pass the target address to PC [Blue Path]
Multiple Cycle Datapath Architecture
Cycle 5 - [Write Back]
RegDest of MUX-4 = 1 to select Rd as the destination address; MemToReg = 0 to connect ALUout to Bus-W and RegWr is asserted memory
RegDest of MUX-4 = 0 to select Rt as the destination address; MemToReg = 0 to connect ALUout to Bus-W and RegWr is asserted memory Load instruction next …
Multiple Cycle Datapath Architecture
Cycle 5 - [Write Back]
RegDest of MUX-4 = 0 to select Rt as the destination address; MemToReg = 1 to connect Dout of the memory to Bus-W or the register file and RegWr is asserted