📜  门| GATE-CS-2004 |第64章

📅  最后修改于: 2021-06-29 05:53:39             🧑  作者: Mango

问题63到64的方向:对于具有三个用户寄存器R1,R2和R3的假设CPU,考虑以下程序段。

Instruction      Operation      Instruction Size(in words)
 MOV R1,5000;      R1 ¬ Memory[5000]      2
 MOV R2, (R1);      R2 ¬ Memory[(R1)]      1
 ADD R2, R3;      R2 ¬ R2 + R3              1
 MOV 6000, R2;      Memory [6000] ¬ R2      2
 HALT              Machine halts              1

假设各种操作所需的时钟周期如下:寄存器到/从存储器传输:3个时钟周期在寄存器中同时添加两个操作数:1个时钟周期指令获取和解码:每个字2个时钟周期执行程序是
(A) 29
(B) 24
(C) 23
(四) 20答案: (B)
说明:时钟周期是每个块;如果指令大小为2,则需要两次否。时钟周期。

Instruction no.       size                                              no. of clock cycles
1                                2                                                                       3*1+2*2
2                                1                                                                       1*3+2
3                                1(add only)                                                      2+3
4                                2                                                                       3*1+2*2
5                                1                                                                       2(fetch and decode)
                                Total                                                                  24

所以答案是(B)
这个问题的测验