Question
Consider the following data path diagram.
Consider an instruction: . The following steps are used to execute it over the given data path. Assume that PC is incremented appropriately. The subscripts r and w indicate read and write operations, respectively.
Which one of the following is the correct order of execution of the above steps?
Official answer and solution
- Official answer
- C
- From
- Official GATE 2020 answer key
Solution
Trace the micro-operations of instruction fetch and instruction execution on the single-bus data path.
Executing an instruction consists of two major phases: Instruction Fetch and Instruction Execution.
Phase 1: Instruction Fetch
- The program counter PC must first be sent to the memory address register MAR, and memory read initiated: (Step 3).
- When memory returns the instruction into MDR, it is loaded into the instruction register IR: (Step 5).
Phase 2: Instruction Execution for
- In a single-bus architecture, the ALU needs two inputs but the bus can only carry one value at a time. Therefore, one operand must first be buffered into temporary register TEMP1:
- Next, the second operand R2 is placed on the bus, and ALU performs addition with TEMP1, storing the result in TEMP2:
- Finally, the result stored in TEMP2 is transferred via the bus into destination register R0:
Combining the fetch and execute phases yields the sequence: 3, 5, 2, 1, 4.
C
The answer is the one in the official GATE answer key. The solution is this site's own explanation.
Source
- Paper
- GATE 2020 Computer Science and Information Technology (CS)
- Question
- 14 of 65, printed as CS Q.4
- Section
- Computer Science and Information Technology
Report an error in this question
GATE questions are the work of the organising institutes. This site is independent and is not affiliated with them.