Consider the following data path diagram.
Consider an instruction: R0 ← R1 + R2. 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.
1. R2r, TEMP1r, ALUadd, TEMP2w
2. R1r, TEMP1w
3. PCr, MARw, MEMr
4. TEMP2r, R0w
5. MDRr, IRw
Which one of the following is the correct order of execution of the above steps?
Tap to open full sizeFigure description
A single-bus datapath diagram. A horizontal line labeled BUS runs across the top with double-headed (bidirectional) arrows connecting down to each block below it. From left to right, the blocks connected to the bus are: MAR (with a separate downward arrow labeled 'To Memory'), MDR (also connected 'To Memory' via the same downward line as MAR), IR, PC, a register file block containing R0, R1, R2,... (dots), R7 (i.e., R0 through R7 stacked vertically), TEMP2, and a V-shaped ALU block. Above and to the right, TEMP1 sits above the ALU and also connects down to the ALU. TEMP2 feeds into the left input of the ALU (via a line from TEMP2 down and into the ALU), and the ALU's output line loops back up into TEMP2's input from below/right (TEMP2's box has an arrow both up to bus and a feed line to ALU's left side coming from below). TEMP1 connects down into the ALU's right input. The ALU (V-shaped) output goes up to TEMP1's block position at top right. MAR and MDR each have an additional downward arrow labeled 'To Memory'.
- (A)
2, 1, 4, 5, 3
- (B)
1, 2, 4, 3, 5
- (C)
3, 5, 2, 1, 4
- (D)
3, 5, 1, 2, 4