GATE 2006 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2006

191 questions

MCQ 1911-mark 191

Questions 86–90 of 191

Q86IO Interface1 markMCQ−0.33 if wrong
Which of the following DMA transfer modes and interrupt handling mechanisms will enable the highest I/O band-width?

Q87Pipeline Processor1 markMCQ−0.33 if wrong
A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode (ID), Execute (EX) and Writeback (WB). The arithmetic operations as well as the load and store operations are carried out in the EX stage. The sequence of instructions corresponding to the statement X=(S−R∗(P+Q))/TX = (S - R * (P + Q))/T is given below. The values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of the instruction sequence.

ADDR5,R0,R1;R5←R0 + R1MULR6,R2,R5;R6←R2 * R5SUBR5,R3,R6;R5←R3 -R6DIVR6,R5,R4;R6←R5/R4STORER6,X;X←R6\begin{array}{lll} \text{ADD} & \text{$R5,R0,R1$} & \text{$;R5$} \leftarrow \text{R0 + R1} \\ \text{MUL}& \text{$R6,R2,R5$} & \text{$;R6$} \leftarrow \text{R2 * R5} \\ \text{SUB} & \text{$R5,R3,R6$} & \text{$;R5$} \leftarrow \text{R3 -R6} \\ \text{DIV} &\text{$R6,R5,R4$} & \text{$;R6$} \leftarrow \text{R5/R4} \\ \text{STORE} &\text{$R6,X$}& \text{$;X$} \leftarrow \text{R6} \\ \end{array}

The IF, ID and WB stages take 1 clock cycle each. The EX stage takes 1 clock cycle each for the ADD, SUB and STORE operations, and 3 clock cycles each for MUL and DIV operations. Operand forwarding from the EX stage to the ID stage is used. The number of clock cycles required to complete the sequence of instructions is

Q88Pipeline Processor1 markMCQ−0.33 if wrong
A pipelined processor uses a 4-stage instruction pipeline with the following stages: Instruction fetch (IF), Instruction decode (ID), Execute (EX) and Writeback (WB). The arithmetic operations as well as the load and store operations are carried out in the EX stage. The sequence of instructions corresponding to the statement X=(S−R∗(P+Q))/TX = (S - R * (P + Q))/T is given below. The values of variables P, Q, R, S and T are available in the registers R0, R1, R2, R3 and R4 respectively, before the execution of the instruction sequence.

ADDR5,R0,R1;R5←R0 + R1MULR6,R2,R5;R6←R2 * R5SUBR5,R3,R6;R5←R3 -R6DIVR6,R5,R4;R6←R5/R4STORER6,X;X←R6\begin{array}{lll} \text{ADD} & \text{$R5,R0,R1$} & \text{$;R5$} \leftarrow \text{R0 + R1} \\ \text{MUL}& \text{$R6,R2,R5$} & \text{$;R6$} \leftarrow \text{R2 * R5} \\ \text{SUB} & \text{$R5,R3,R6$} & \text{$;R5$} \leftarrow \text{R3 -R6} \\ \text{DIV} &\text{$R6,R5,R4$} & \text{$;R6$} \leftarrow \text{R5/R4} \\ \text{STORE} &\text{$R6,X$}& \text{$;X$} \leftarrow \text{R6} \\ \end{array}

The number of Read-After-Write (RAW) dependencies, Write-After-Read( WAR) dependencies, and Write-After-Write (WAW) dependencies in the sequence of instructions are, respectively,

Q89Pipeline Processor1 markMCQ−0.33 if wrong
A CPU has five-stages pipeline and runs at 1GHz frequency. Instruction fetch happens in the first stage of the pipeline. A conditional branch instruction computes the target address and evaluates the condition in the third stage of the pipeline. The processor stops fetching new instructions following a conditional branch until the branch outcome is known. A program executes 10910^{9} instructions out of which 20% are conditional branches. If each instruction takes one cycle to complete on average, then total execution time of the program is

Q90Loop1 markMCQ−0.33 if wrong
Consider the following C-function in which a[n] and b[m] are two sorted integer arrays and c[n+m] be another integer array.

void xyz (int a[],int b[],int c[]){
   int i, j, k;
   i=j=k=0;
   while((i < n) && (j < m))
            if (a[i] < b[j]) c[k++]=a[i++];
            else c[k++]=b[j++];
}
Which of the following condition(s) hold(s) after the termination of the while loop ?

I. j<\ltm, k=n+j-1, and a [n-1]<\ltb[j] if i=n
II. i<\ltn, k=m+i-1, and b[m-1]≤\leqa[i] if j=m