【问题标题】:How do things work in the fetch phase of the instruction cycle?在指令周期的获取阶段,事情是如何工作的?
【发布时间】:2019-05-20 02:31:27
【问题描述】:

有一点让我很困惑,在计算机系统架构(Morris Mano)的第 5 章中,这本书使用了一个简单的微处理器,它具有以下指令周期:

例如LDA 操作:

AR

红外

PC

解码 (T2)

DR

AC

我很难理解这个循环以及为什么不是这样:

三月

MBR

解码(IR

MBR

AC

我的问题是:

为什么书中没有使用 MBR 和 MAR 表示法,以及写操作需要读操作的结果,“从内存读取”和“写入 IR”操作如何同时进行?

【问题讨论】:

  • 我投票结束这个问题,因为它不是一个实际的编程问题。这是一个计算机架构问题(关于假设的架构)。

标签: assembly cpu-architecture instructions instruction-set microprocessors


【解决方案1】:

没有MBRMAR寄存器,设计中只有以下寄存器(忽略中断和IO功能):

AR -- 地址寄存器;用于寻址内存

PC -- 程序计数器;正在执行的指令的地址

DR -- 数据寄存器;临时存储数据

AC -- 累加器;任何 ALU 运算的结果都会在这个寄存器中结束

IR -- 指令寄存器;当前指令操作码的存储

E -- 来自 ALU 操作的标志寄存器

SC -- 序列计数器;用于确定正在执行指令的哪一步

LDA指令为例:

T0: AR <- PC // Put the Program counter into the Address register so we can get the instruction; only the Address regsiter can access memory

T1: IR <- M[AR], PC <- PC + 1 // M[AR] means access memory (M) at address stored in AR ([AR]), and in this case put that value at address AR into the Instruction register; at the same time increment the Program counter which can be done in parallel as the increment can be done without using the bus

T2: Decode(IR); AR <- IR(0-11) // Now the instruction is decoded; during this time the address argument of the instruction is pass into the Address register

T3: DR <- M[AR] // Once weve determined in T2 that this is a LDA, we need to do the steps involved; the goal being to take the word from memory and get it into AC. To do this, we first need to read it out of memory, thus the M[AR], read memory at address AR (which is from the instruction became of the transfer we did in T2). We want to put it into AC, but since AC cannot be loaded from the bus directly, we need to put it somewhere else first, somewhere it can be then transferred to AC, thus put it in DR

T4: AC <- DR; SC <- 0 // Now that the data is in DR, we can move it via the ALU into AC; note that the ALU doesnt actually do any work on the data in the case of the LDA, it just passes the data through. Now that the instruction is done, reset the Sequence counter to 0

【讨论】:

  • 非常感谢您的回答!但是我有两个问题:1.(内存读取)操作和(写入IR操作)如何同时完成?因为一个使用数据总线而另一个使用地址总线,它们不冲突吗? 2.所以DR只是一个寄存器来保存临时数据,因为IR不能同时存储两个值?所以这意味着在传入周期(比如说 T5、T6、T7 ......)期间将获取的所有数据都将存储在 DR 中,并且 DR 将被覆盖,对吗?提前致谢。
  • 1) 该系统的总线是将这些寄存器和内存连接在一起的数据线。参见本章开头附近的图表,从AR 到内存的地址线直接连接到该模块,而总线连接到大多数寄存器和内存。只要公交车只有一个司机就可以;在这种情况下,只有内存在驱动总线。 2)基本上是的,虽然红外也驱动系统中的控制信号,所以如果把所有东西都搞砸了,在那里存储数据。是的,在一条指令中可能会多次写入 DR。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-10-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-04-30
  • 1970-01-01
相关资源
最近更新 更多