Question

Suppose an instruction takes four cycles to execute in a nonpipelined CPU: one cycle to fetch...

  1. Suppose an instruction takes four cycles to execute in a nonpipelined CPU: one cycle to fetch the instruction, one cycle to decode the instruction, one cycle to perform the ALU operation, and one cycle to store the result. In a CPU with a four-stage pipeline, that instruction still takes four cycles to execute, so how can we say the pipeline speeds up the execution of the program?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The same time is required because only one instruction in taken in consideration in both the cases, and the next step depends upon the previous step of the instruction. Let me explain with an example

Now, suppose we have two statements ADD 2,5 and ADD 3,4, following are the steps in a non-pipelined architecture:

  • Fetch the instruction ADD 2,5 - 1 cycle required.
  • Decode the statement. Now the thing is to decode a statement, we need to fetch it first. So this comes after the fetch statement. - 1 cycle required
  • Perform the ALU operation. To perform a operation we need to perform the previous 2 statements first. - 1 cycle required.
  • Store result. To store the value in result we first need to perform the previous three cycles first. - 1 cycle required.

Four cycles required for instruction ADD 2,5, similarly four more cycles are required for the instruction ADD 3,4.

Total cycles required = 8

Now for two instructions ADD 2,5 and ADD 3,4, following are the steps in a pipelined architecture:

  • Fetch the instruction ADD 2,5 - 1 cycle required.
  • Decode the instruction 1. Since it is pipelined architecture we can fetch the instruction ADD 3,4 here as well. - 1 cycle required
  • Perform the ALU operation on instruction 1. And decode instruction 2. - 1 cycle required.
  • Store result of the first instruction. And perform ALU operation on the second on. - 1 cycle required.
  • Store result of the second instruction. - 1 cycle required

Total cycles required = 5.

Since it is a four stage pipeline architecture, you can pipeline four instructions at a time. 8 instructions cycles will be required for four instructions. Whereas if it was non-pipelined, 16 cycles would have been required.

Add a comment
Know the answer?
Add Answer to:
Suppose an instruction takes four cycles to execute in a nonpipelined CPU: one cycle to fetch...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A particular (fictional) CPU has the following internal units and timings: 1. IFD: Instruction fetch + decode : 160 ps...

    A particular (fictional) CPU has the following internal units and timings: 1. IFD: Instruction fetch + decode : 160 ps 2. RR: Register read 80 ps 3. ALU: 240 ps 4. MA : memory access: 160 ps (assuming cache) 5. RW : register write : 80 ps There are 5 basic instruction types: 1. LOAD : IFD+RR+ALU+MA+RW 720 ps 2. STORE: IFD+RR+ALU+MA : 640 ps 3. ARITHMETIC: IFD+RR+ALU+RW : 560 4. BRANCH: IFD+RR+ALU : 480 ps 5. MEMOP: IFD+RR+MA+ALU+MA :...

  • A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access...

    A 5-Stage pipeline is composed of the following stages Instruction Fetch (IF), Decode (DE), Execute (EX), Memory Access (ME) and Register Write-back (WB). Assume the pipeline does not have a branch prediction unit, does not have superscalar support and does not support out of order execution. Assume that all memory accesses are in the L1 cache and therefore do not introduce any stalls. Show a pipeline diagram that shows the execution of each stage for the assembly code below. Also...

  • CPU checks the status of its interrupt pins at the beginning of every Fetch-Decode -Execute cycle...

    CPU checks the status of its interrupt pins at the beginning of every Fetch-Decode -Execute cycle Select one: True False

  • 1. (10 points) Suppose you have a load-store computer with the following instruction mix Operation Frequency...

    1. (10 points) Suppose you have a load-store computer with the following instruction mix Operation Frequency Number of clock cycles ALU ops Loads Stores Branches 40 % 20 % 18% 22 % 4 4 The ALU ops (arithmetic logic unit ops) typically use operands in CPU registers and hence they take fewer clock cycles to execute. However, if you want to add a memory operand to a CPU register, then you would have to explicitly load it into a CPU...

  • Hi can you please help me with the question?..thank you.. QUESTION 2 The pipeline in the...

    Hi can you please help me with the question?..thank you.. QUESTION 2 The pipeline in the ARMI1 CPU is shown in Figure Q2(a). There are three possible (a) paths through the pipeline. The path of the execution depends on what type of instruction is executing (b) Instruction Fetoh Write Decode Execute Back Address DCI Dcz WBIS FE1 FE2 Decode Issue Shif ALU Saturate WBes MAC2 МАСI МАСУ Figure Q2(a) (i) Identify the number of stages for the ARMI1 CPU pipelines....

  • hi..can you please help me with this question?..thank you.. QUESTION 2 The pipeline in the ARMI1...

    hi..can you please help me with this question?..thank you.. QUESTION 2 The pipeline in the ARMI1 CPU is shown in Figure Q2(a). There are three possible (a) paths through the pipeline. The path of the execution depends on what type of instruction is executing (b) Instruction Fetoh Write Decode Execute Back Address DCI Dcz WBIS FE1 FE2 Decode Issue Shif ALU Saturate WBes MAC2 МАСI МАСУ Figure Q2(a) (i) Identify the number of stages for the ARMI1 CPU pipelines. [1...

  • We found that the instruction fetch and memory stages are the critical path of our 5-stage...

    We found that the instruction fetch and memory stages are the critical path of our 5-stage pipelined MIPS CPU. Therefore, we changed the IF and MEM stages to take two cycles while increasing the clock rate. You can assume that the register file is written at the falling edge of the clock. Assume that no pipelining optimizations have been made, and that branch comparisons are made by the ALU. Here’s how our pipeline looks when executing two add instructions: Clock...

  • Computer Architecture The format of this document is as follows: First, I give a practice problem...

    Computer Architecture The format of this document is as follows: First, I give a practice problem for which the solution is also provided. In bold italic font, I slightly modify the problem for your homework. 3) The 4-Stage Pipeline below suffers from the memory access resource conflict as shown below (instruction i and i+2 want to access memory at the same time and i+2 needs to be denied, so it waits for the next cycle; in the next cycle it...

  • 1. Consider the MIPS pipeline discussed in class, suppose the register between the Instruction Decode and...

    1. Consider the MIPS pipeline discussed in class, suppose the register between the Instruction Decode and Execute stages were removed. a. How would this affect the clock cycle? b. What is the speedup of the five stage pipeline vs. this new four stage pipeline? Assume ideal CPI for both cases. c. If the CPl of the five stage pipeline was not ideal, calculate by how much the NOPs would have to be reduced to make the change in the design...

  • 3. Use any one of the following instructions to explain the steps of the fetch-decode- execute cycle. Your explanation should include what is happening in the related registers. (10 points) Binary...

    3. Use any one of the following instructions to explain the steps of the fetch-decode- execute cycle. Your explanation should include what is happening in the related registers. (10 points) Binary Contents of Hex Contents Memory Address Address Instruction of Memory 100 Load 104 0001000100000100 101 Add 105 102 Store 106 0100000100000110 103 Halt 104 0023 105 FFES 106 0000 1104 0011000100000101 4106 7000 0111000000000000 0000000000100011 0023 FEE9 3. Use any one of the following instructions to explain the steps...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT