GATE 2024 (Session 2) Computer Science and Information Technology (CS) Questions with Solutions

GATE 2024 (Session 2)

65 questions

MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35

Questions 31–35 of 65

Q31Pipeline Processor1 markMSQ
An instruction format has the following structure:

Instruction Number: Opcode    destinationreg,    sourcereg−1,    sourcereg−2Opcode \; \; destination reg, \;\; source reg-1, \;\;source reg-2

Consider the following sequence of instructions to be executed in a pipelined processor:

I1: DIV R3, R1, R2
I2: SUB R5, R3, R4
I3: ADD R3, R5, R6
I4: MUL R7, R3, R8

Which of the following statements is/are TRUE

One or more options are correct.

Q32Network Layer Protocol1 markMSQ
Which of the following fields of an IP header is/are always modified by any router before it forwards the IP packet?

One or more options are correct.

Q33Array and Pointer1 markMSQ
Consider the following C function definition.

int fX(char *a){ 
char *b = a; 
while(*b)
b++;
return b - a;}
Which of the following statements is/are TRUE?

One or more options are correct.

Q34Set Theory1 markNAT
Let PP be the partial order defined on the set {1,2,3,4}\{1,2,3,4\} as follows
P={(x,x)∣x∈{1,2,3,4}}∪{(1,2),(3,2),(3,4)}P=\{(x, x) \mid x \in\{1,2,3,4\}\} \cup\{(1,2),(3,2),(3,4)\}
The number of total orders on {1,2,3,4}\{1,2,3,4\} that contain PP is ______

Q35Array1 markNAT
Let AA be an array containing integer values. The distance of AA is defined as the minimum number of elements in AA that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array [2,5,3,1,4,2,6][2,5,3,1,4,2,6] is _____