MIPS 中的微编程
我正在学习微编程,但对微指令实际上是什么感到困惑。我正在使用MIPS架构。我的问题如下
假设我有 ADD 指令,那么微指令会是什么样子? add指令有多少条微指令。网上有什么地方可以看到 MIPS 基本指令的微指令列表吗?
如何找出 ADD 微程序指令的位串?
I am learning about micro programming and am confused as to what a micro-instruction actually is. I am using the MIPS architecture. My questions are as follows
Say for example I have the ADD instruction, what would the micro-instructions look like for this? How many micro-instructions are there for the add instruction. Is there somewhere online I can see the list of micro-instructions for the basic instructions of MIPS?
How can I figure out the bit string for an ADD microprogrammed instruction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
微编程是一种实现复杂指令集架构(例如x86)的方法就更简单的“微指令”而言。 MIPS 是 RISC 指令集架构,通常不使用微编程来实现,因此 ADD 指令的微指令为零。
要回答您的具体问题,我们必须知道您的特定微架构的定义是什么。
Microprogramming is a method of implementing a complex instruction set architecture (such as x86) in terms of simpler "micro instructions". MIPS is a RISC instruction set architecture and is not typically implemented using micro-programming, so there are ZERO microinstructions for the ADD instruction.
To answer your specific question one would have to know what the definition of your particular micro-architecture is.
这是如何将
EPC
加载到其中一个寄存器并向其中添加 4 个字节的示例:您可以使用“很多”指令,您可以 在此处查看 MIPS 指令集。以我的拙见,MIPS 确实简洁且易于学习!一个有趣的事实是,第一代 Playstation 使用的是 MIPS CPU。
示例说明
lw
= 加载单词la
= 加载地址sw
= 保存单词addi
= add immidate然后你有很多条件指令,例如:
bne
= 分支不等于bnez
= 分支不等于 0有了这些你就可以使用
j 跳转到某个地址。
这是我为 MIPS 编写的异常处理程序的一个示例,这是外部源处理程序:
在上面的示例中,我定义了一个名为
External
的入口点,我可以跳转到该入口点,就像我所做的那样DisMiss
循环,通常会跳转到自己。这里还使用了一些其他指令:
mfc0
= 从协处理器 0 移动要处理标签,我建议您检查一下这个问题/答案。
这里有一些关于使用 MIPS 进行微编程的资源:
This is an example of how to load the
EPC
into one of the registers and add 4-bytes to it:There are "a lot" of instructions that you can use, you can see the MIPS Instruction Set here. In my humble opinion, MIPS is Really neat and easy to learn! A fun fact is that the first Playstation used a MIPS CPU.
Example instructions
lw
= load wordla
= load addresssw
= save wordaddi
= add immidateThen you have a lot of conditional instructions such as:
bne
= branch not equalbnez
= branch not equal zeroAnd with these you use
j
to jump to an adress.Here is an example from an Exception Handler that I wrote once for MIPS, this is the External Source handler:
In the above example I define an entry point called
External
that I can jump to, as I do withDisMiss
to loop, you generally jump to yourself.There are some other instructions used here aswell:
mfc0
= move from co-processor 0To handle labels, I would suggest you check this question/answer out.
Here's a couple of resources on MicroProgramming with MIPS: