GATE / CS ARCHIVE

SIMILAR QUESTIONS / COMPUTER ORGANIZATION & ARCHITECTURE

Schedule instruction micro-operations on a single bus

4 questions solved the same way, newest first. Back to Computer Organization & Architecture

How these are solved

Follow the actual bus and ALU-latch connectivity to schedule operand loads, arithmetic and result transfers without simultaneous conflicting bus drivers. The 2005 two-input-latch datapath differs from the 2020 TEMP1/TEMP2 input/output latch arrangement;

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

2 marks · MCQ
Report issue

Single-bus register addition

Datapath & Control Unit

Question 79, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. After instruction fetch, execute ADD R0, R1 meaning R0←R0+R1. Minimum execution cycles A2; B3; C4; D5.
Question 79, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. After instruction fetch, execute ADD R0, R1 meaning R0←R0+R1. Minimum execution cycles A2; B3; C4; D5.
Question 79, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. After instruction fetch, execute ADD R0, R1 meaning R0←R0+R1. Minimum execution cycles A2; B3; C4; D5.
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

The diagram has separate S and T input latches and a combinational ALU output returning directly to the bus. Cycle 1 transfers R0 to S; cycle 2 transfers R1 to T; cycle 3 transfers ALU(S+T) through the bus to R0. The single bus cannot carry both distinct operands in one cycle, and the result is latched after the two operands are ready. Three execution cycles are necessary and sufficient, option B; instruction fetch is excluded.

A single bus transports only one independently selected register value each cycle. Load S from R0 and T from R1 in separate cycles. Only after both inputs are latched can the combinational sum be selected onto the bus and captured in R0, using a third cycle. This supplies both a feasible schedule and a lower bound: two operand transfers plus a later result transfer cannot fit in two cycles.

Original paper, page 11

2 marks · MCQ
Report issue

Single-bus subroutine call

Datapath & Control Unit

Question 80, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. Two-word CALL Rn, sub: opcode fetch already increments PC to second word. Execute Rn←PC+1 and PC←M[PC]. Minimum execution cycles A2; B3; C4; D5.
Question 80, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. Two-word CALL Rn, sub: opcode fetch already increments PC to second word. Execute Rn←PC+1 and PC←M[PC]. Minimum execution cycles A2; B3; C4; D5.
Question 80, GATE 2005: Single-bus CPU: MAR, MDR, IR, PC, general registers and ALU input latches S, T share the bus; ALU output returns directly to it. All widths equal; increments must use ALU. Memory read takes two cycles: address→MAR then memory→MDR. Two-word CALL Rn, sub: opcode fetch already increments PC to second word. Execute Rn←PC+1 and PC←M[PC]. Minimum execution cycles A2; B3; C4; D5.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

At execution start PC addresses the second instruction word. A four-cycle schedule is: (1) broadcast PC to MAR and S; (2) read M[MAR] into MDR while loading the increment operand 1 into T; (3) send ALU(S+T) to Rn; (4) send MDR to PC. The external memory read does not occupy the internal bus carrying 1 in cycle 2. Three bus transfers of PC, return address, and target plus preparation of the increment require four cycles in this latched-input datapath. Thus C (4), assuming the usual constant-one ALU input/control needed for the specified increment operation, which the schematic does not explicitly draw.

Two different results must be preserved: the incremented return address and the target stored in memory. Broadcast PC to MAR and S together in the first cycle, since both need the same value. In the second, memory fills MDR while the internal bus supplies the increment constant to T. The third transfers S+T to Rn; the fourth transfers MDR to PC. Memory’s external transfer can overlap internal-bus work; counting it as another serialized internal transfer would overestimate. The constant input is a conventional control assumption explicitly identified.

Original paper, page 11

2 marks · MCQ
Report issue

Microcycles for push on an eight-bit datapath

Datapath & Control Unit

Question 2.13, GATE 2001: An unpipelined CPU has an 8-bit bus, ALU, general registers and MDR, but 16-bit SP and MAR. Byte-select mux/demux connect SP and MAR to the bus; memory operations take two cycles; SP can decrement locally. For push r, perform M[SP]←r then SP←SP−1. How many execution cycles: 2,3,4,5? The complete datapath is linked.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: The 16-bit SP must be copied to 16-bit MAR through an 8-bit bus. This requires two distinct bus transfers, one per byte, using the mux/demux controls.

Step 2: Copy the 8-bit register r to MDR in a third cycle. The memory write then uses two cycles with MAR supplying the address and MDR the byte. SP can be decremented locally in parallel after its old value has been transferred, so no additional bus cycle is needed for that decrement.

Total 2+1+2=5 cycles, D, in the standard clocked-transfer schedule with memory write starting after MAR/MDR are loaded. Instruction-fetch cycles are not part of this execution count.

Original paper, page 5