I型指令的MIPS循环量(addi) [英] MIPS Amount of Cycles for I-Type instructions (addi)

查看:315
本文介绍了I型指令的MIPS循环量(addi)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,在 https://en.wikipedia.org/wiki/Cycles_per_instruction 上说:

对于多周期MIPS,有5种类型的指令:

For the multi-cycle MIPS, there are 5 types of instructions:

  • 加载(5个周期)
  • 存储(4个周期)
  • R型(4个循环)
  • 分支(3个周期)
  • 跳跃(3个周期)

我不确定"addi"指令需要执行多少个周期,因为没有具体提及.

I'm unsure how many cycles the instruction 'addi' takes since there's no specific mention of it.

"add"是R型指令,因此需要4个周期,所以我最好的猜测是"addi"(I型指令)也需要4个周期.有人可以确认或纠正我的猜测吗?

'add' is a R-type instruction and therefore takes 4 cycles, so my best guess would be that 'addi' (I-type instruction) also takes 4. Could someone please confirm or correct my guess?

推荐答案

如果您是指标准的理想5级MIPS管道,那么"ADDI"也将花费4个周期来完成.

If you are referring to the standard ideal 5-stage MIPS pipeline, then yes "ADDI" would also take 4 cycles to complete.

ADD和ADDI之间的唯一区别是,ADDI可以使用立即数而不是使用第三个寄存器.该值在流水线的Execute阶段之前可用,因此没有理由使该指令占用4个以上的周期.

The only difference between ADD and ADDI is that ADDI works on an immediate value instead of using the third register. This value is available before the Execute stage of the pipeline hence there are no reasons for the instruction to take more than 4 cycles.

这篇关于I型指令的MIPS循环量(addi)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆