



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!




Although the single-cycle design will work correctly, it would not be used in modern designs because it is inefficient. To see why this is so, notice that the clock cycle must have the same length (Critical Path) for every instruction in this single-cycle design, and the CPI = 1. As a solution about this problem, We can broke each instruction into a series of steps corresponding to the functional unit operations. We can use these steps to create a multiple clock cycle (or a multi-cycle) implementation. In a multi-cycle implementation, each step in the execution will take 1 clock cycle. The multi-cycle implementation allows a functional unit to be used more than once per instruction, as long as it is used on different clock cycles. This sharing can help reduce the amount of hardware required. The ability to allow instructions to take different numbers of clock cycles and the ability to share functional units within the execution of a single instruction are the major advantages of a multi-cycle design. The following figure shows an example of the similar multicycle CPU implementation. Figure 1 - The multi-cycle datapath together with the necessary control lines
Stage
Action for R-type instructions Action for Memory instructions Action for Branches Action for Jumps Remarks 0 IR = Memory[PC] PC = PC + 4 Instr Fetch 1 A = Reg [ IR[25:21] ] B = Reg [ IR[20:16] ] ALUOut = PC + ( Sign-Extened ( IR[15:0] ) << 2 ) Instr Decode & Register Fetch 2 ALUOut = A op B ALUOut = A + Sign-Extended ( IR[15:0] ) If (A==B) then PC = ALUOut
Execution or Branch/Jump Completion 3 Reg [IR[15:11]] = ALUOut Load: MDR = Memory[ALUOut] Store: Memory [ALUOut] = B Memory Access & R-type Completion 4 Load: Reg [IR[20:16]] = MDR Memory Read Completion Figure 2 – Example Execution Stages for The multi-cycle datapath Figure 3 – An Example Finite State Machine for The multi-cycle datapath
Table 2 – Consecutive I/O port configuration of the dispatch ROM: ROM_DISP Port name Classification Bit Description undef Input 1 - bit Undefined Instruction raddr Input 8 - bit Address for Microprogram ROM Table 3 – Consecutive I/O port configuration of the microprogram ROM: ROM_MICRO Port name Classification Bit Description IorD Output 1 - bit Memory Access for Instruction or Data MemRead Output 1 - bit Memory Read Enable Signal MemWrite Output 1 - bit Memory Write Enable Signal DataWidth Output 3 - bit Memory Data Control signal IRwrite Output 1 - bit Instruction Register Write Enable signal RegDst Output 2 - bit Register Destination Selection RegDatSel Output 3 - bit Register Write Data Selection RegWrite Output 1 - bit Register Write Enable signal ExtMode Output 1 - bit Extender Control signal ALUsrcA Output 3 - bit ALU input A Selection ALUsrcB Output 3 - bit ALU input B Selection ALUop Output 5 - bit ALU Operation Control signal ALUctrl Output 2 - bit ALU Control signal Branch Output 3 - bit Branch Address Selection signal PCsource Output 2 - bit Next PC Selection PCwrite Output 1 - bit PC Write Enable signal StateSel Output 2 - bit Next FSM State Number Selection