Computer Architecture (9)

김동규·2023년 10월 30일
0

Computer Architecture

목록 보기
9/16

In this post, I will talk about Multi Clock Cycle.

Multi Clock Cycle

It has several clock cycles to execute one instruction. It means that if some instructions are executed, then there are at least two clock cycles. To make it, we have to make extra components to build multicycle datapath.

In the Multicycle, we will reuse functional units.
For example, in the single cycle, we create three add unit to increase PC and evaluate instructions.

However, in the Multicycle, we will reuse ALU unit.

In addition, in the single structure, we seperated the instruction memory and data memory. Because we have to execute all instruction at the same time.
But, this structure has several clock cycles, so we don't need to seperate them.


We have to use same architecture with other purposes.
So, it is important to use a state machine.

Also, we have to break up the instructions into several steps, each step takes a cycle.


This is the full design of the multicycle.

Comparing simplecycle with multicycle

There are some different points between simplecycle and multicycle.

  • Several Memory / Single Memory
    -> MultiCycle do not need to seperate the memory.
  • Multi ALU / Single ALU
    -> MultiCycle reuses ALU unit.
  • In the MultiCycle, several registers are added.
    -> Instruction Register, ALUout, Memory Data Register, etc.
  • In the MultiCycle, it needs more MUX.
    -> in front of memory and ALU.

Five Execution Steps


The first and second steps are the same with all instructions. In the second step, Instruction Decode means that it checks up the type of instruction.

After doing that, in the third step, instructions are executed. Branch instructions are completed.

Next step, we completed R-type instructions and finally we finished the write instructions.

Step 1


Use PC to get instruction and put it into a Instruction Register. It is not used in the single cycle, but now we use.

This step we fetched instruction in memory to IR.

In addition, this structure increase the value of PC in the step 1. Because MultiCycle reuse all element of the curcit, and the ALU unit is not working now.

So, it is more efficient increasing now.

Step 2


Instructions have three types(R, I, J), and each of them does other actions. So, we have to decide what type it is.

If opcode in the instruction is 0, then it is R-type instruction. In this case, we use function code to decide the actions.

In this step, whether the branch value are used or not, it is a good choice that evaluate the value of branch instruction.

Step 3

In this step, ALU is performing one of three functions, based on instruction type.

If the insturction type is Branch, then it is completed in this step.

Step 4

This is a step that R-type instruction is completed or memory access is executed.

Step 5

This step is only used in Store Word instruction.

Summary

profile
안녕하세요 :)

0개의 댓글