控制硬件如何在完成解码指令之前知道要读取哪些寄存器



在通过哈马赫的计算机组织时,我开始了解说明的基本步骤和行动。

以下是汇编代码

添加 RC,RA,RB

并且说明如下:

1.Fetch the Instruction and increament the PC.
2.Decode the instruction and read Registers RA and RB
3.Compute [RA]+[RB](Executing Instruction)
4.Load the result into destination register RC

控制硬件在完成解码指令之前如何知道要读取哪些寄存器?

解释如下:这是可能的,因为源寄存器地址在所有指令中使用相同的位位置指定

我不明白.如果有人请分享他们的知识,那将是有帮助的。!!

在机器级别,每条指令只是一个或几个字节,编码PC需要做的事情。此数据的某些位确定要运行的操作(加、减、移、读取等),其他位确定要使用的操作数。MIPS32架构的简单指令集的简单示例:

Instr:       add $d,$s,$t
Bit pattern: 000000ss sssttttt ddddd--- --100000
Instr:       sub $d,$s,$t
Bit pattern: 000000ss sssttttt ddddd--- --100010
Instr:       and $d,$s,$t
Bit pattern: 000000ss sssttttt ddddd--- --100100

如您所见,无论操作类型如何,位编码操作数始终位于同一位置,因此 CPU 可以在完成解码操作类型之前开始准备操作数数据。不知道MIPS是否也使用这种方法,但它有助于说明它。

最新更新