parallel-processing - 执行以下循环所需的循环数是多少?

标签 parallel-processing cpu computer-science pipeline computer-architecture

<分区>

Consider a 4 stage pipeline processor. The number of cycles needed by the four instructions I1, I2, I3, I4 in stages S1, S2, S3, S4 is shown below:

    S1    S2    S3    S4
I1  2     1     1     1
I2  1     3     2     2
I3  2     1     1     3
I4  1     2     2     2 

What is the number of cycles needed to execute the following loop?

For (i=1 to 2) {I1; I2; I3; I4;}

选项是:

  1. 16

  2. 23

  3. 28

  4. 30


我的解释:


enter image description here

我哪里错了?

最佳答案

当使用以下时间线时,我得到 23 个周期:

enter image description here

关于parallel-processing - 执行以下循环所需的循环数是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33124035/

相关文章:

java - iText 7、htmlPDF 2 - DefaultFontProvider 的并行使用

java - 如何确保在java中并行处理中仅由一个线程执行代码块

algorithm - 有关不同计算机科学领域的资源

asynchronous - 为什么我不应该使用 F# 异步工作流来实现并行性?

c# - c#中的并行任务和线程安全

linux - 虚拟化环境下的CLFLUSH

node.js - 对于 Node Web 服务器,拥有更多 vCPU 还是 RAM 更好?

c - 曾几何时,> 比 < ... 快,什么?

javascript - 在 JavaScript(NodeJS)中从 MongoDB ObjectId 获取唯一的整数?

ruby - MacRuby:objective-c 运行时与 ruby​​ 运行时相同