GATE / CS ARCHIVE

GATE CSE 2020 / QUESTION 4

GATE CSE 2020 Q4

Computer Organization & Architecture · Datapath & Control Unit · Full GATE CSE 2020 paper

GATE 2020, Q4 1 mark · MCQ
Report issue

Datapath & Control Unit

Question 4, GATE 2020: Execute R0←R1+R2 on a single-bus datapath. Figure equivalent: bus connects MAR, MDR, IR, PC and R0–R7; one ALU input comes directly from bus, the other from TEMP1 (loaded from bus); ALU output enters TEMP2, which can drive bus. MAR addresses memory; MDR exchanges memory data. PC increment is handled. Steps (r read,w write): 1 R2_r,TEMP1_r,ALU_add,TEMP2_w; 2 R1_r,TEMP1_w; 3 PC_r,MAR_w,MEM_r; 4 TEMP2_r,R0_w; 5 MDR_r,IR_w. Correct order? A 2,1,4,5,3; B 1,2,4,3,5; C 3,5,2,1,4; D 3,5,1,2,4.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Worked explanation

Follow data dependencies rather than memorizing an instruction cycle. The instruction register cannot receive the requested instruction before the PC address has been sent to memory and the result has reached MDR, so 3 precedes 5. To add two register values on one bus, first save one operand in TEMP1: step 2 must precede step 1. The ALU result is latched into TEMP2 before R0 can receive it, so 1 precedes 4. Fetch followed by execution therefore gives 3→5→2→1→4. D violates the TEMP1 dependency; A,B attempt execution before the fetch sequence.

Derivation and answer

Fetch the instruction with PC→MAR and memory read(step3), then MDR→IR(step5). Load R1 into TEMP1(step2), add R2 through the bus with TEMP1 and store the result in TEMP2(step1), then TEMP2→R0(step4). Therefore3, 5, 2, 1, 4, C.

Original paper, page 4 · Answer key