对指令的EXECUTE周期进行微操作

时间:2015-03-22 21:21:44

标签: assembly cpu-registers

以下是指示: MAC #NUM,(R0)+,R1 ,转换为以下内容:

MAC source1,source2,source3 / destination

换句话说,它执行以下操作:

source3 / destination< ---(source1 x source 2)+ source3 / destination

该指令将在单总线cpu内部组织上执行:

Single-bus CPU organization

该问题要求给出执行该指令的控制步骤序列(仅执行阶段)。

给出的解决方案是

T3: load TEMP with immediate data #NUM 
    BUS <- IR(immediate data field), TEMP <- Bus

T4: get the operand pointed to by R0 from memory into MDR and increment value of R0:

    Bus <- R0, MDR <- BUS, Sel_temp = 1, F =ADD, result <- alu output

T5: READ, MDR <- data_out_of_memory, BUS <- result, R0 <- Bus

T6: perform the multiply of #NUM X MEM(R0)
    Bus <- MDR, sel_temp = 0, F = multiply, result <- alu out

T7: save result of multiplication into the TEMP 

    BUS <- Result, TEMP <- Result

T8: add R1 to TEMP
    BUS <- R1, F = ADD, sel_temp = 0, result <- alu output

T9: store final result back into R1

    Bus <= Result, R1 <- Bus, END.

我的问题是,为什么他们会在R0而不是MDR中注册MAR?如果您计划在T5从内存中检索数据,那么您是否需要在MAR中添加内容?

0 个答案:

没有答案