Computer Science and Information Technology
GATE CSE year:2023 PYQs
Build your understanding with focused practice from past exam papers.
Questions 41–50 of 65. Imported answers require independent review unless marked reviewed.
Question 41
Open questionCSMCQ2 marksNeeds review
Consider the given C-code and its corresponding assembly code, with a few operands U1–U4 being unknown. Some useful information as well as the semantics of each unique assembly instruction is annotated as inline comments in the code. The memory is byte-addressable.
//C-code ;assembly-code (; indicates comments)
;r1-r5 are 32-bit integer registers
;initialize r1=0, r2=10
;initialize r3, r4 with base address of a, b
int a[10], b[10], i; L01: jeq r1, r2, end ;if(r1==r2) goto end
// int is 32-bit L02: lw r5, 0(r4) ;r5 <- Memory[r4+0]
for (i=0; i<10; i++) L03: shl r5, r5, U1 ;r5 <- r5 << U1
a[i] = b[i] * 8; L04: sw r5, 0(r3) ;Memory[r3+0] <- r5
L05: add r3, r3, U2 ;r3 <- r3+U2
L06: add r4, r4, U3
L07: add r1, r1, 1
L08: jmp U4 ;goto U4
L09: end
Which one of the following options is a CORRECT replacement for operands in the position (U1, U2, U3, U4) in the above assembly code?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 42
Open questionCSMCQ2 marksNeeds review
A 4 kilobyte (KB) byte-addressable memory is realized using four 1 KB memory blocks. Two input address lines (IA4 and IA3) are connected to the chip select (CS) port of these memory blocks through a decoder as shown in the figure. The remaining ten input address lines from IA11–IA0 are connected to the address port of these blocks. The chip select (CS) is active high.
The input memory address (IA11–IA0), in decimal, for the starting locations (Addr=0) of each block (indicated as X1, X2, X3, X4 in the figure are among the options given below. Which one of the following options is CORRECT?

Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 43
Open questionCSMCQ2 marksNeeds review
Consider a sequential digital circuit consisting of T flip-flops and D flip-flops as shown in the figure. CLKIN is the clock input to the circuit. At the beginning, Q1, Q2 and Q3 have values 0, 1 and 1, respectively.

Which one of the given values of (Q1, Q2, Q3) can NEVER be obtained with this digital circuit?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 44
Open questionCSMCQ2 marksNeeds review
A Boolean digital circuit is composed using two 4-input multiplexers (M1 and M2) and one 2-input multiplexer (M3) as shown in the figure. X0–X7 are the inputs of the multiplexers M1 and M2 and could be connected to either 0 or 1. The select lines of the multiplexers are connected to Boolean variables A, B and C as shown.

Which one of the following sets of values of (X0, X1, X2, X3, X4, X5, X6, X7) will realise the Boolean function
?Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 45
Open questionCSMCQ2 marksNeeds review
Consider the IEEE-754 single precision float point numbers P=0xC1800000 and Q=0x3F5C2EF4.
Which one of the following corresponds to the product of these numbers (i.e., P × Q), represented in the IEEE-754 single precision format?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 46
Open questionCSMCQ2 marksNeeds review
Let A be a priority queue for maintaining a set of elements. Suppose A is implemented using a max-heap data structure. The operation Extract-Max(A) extracts and deletes the maximum element from A. The operation Insert(A,key) inserts a new element key in A. The properties of a max-heap are preserved at the end of each of these operations.
When A contains n elements, which one of the following statements about the worst case running time of these two operations is TRUE?
Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 47
Open questionCSMCQ2 marksNeeds review
Consider the C function foo and the binary tree shown.
typedef struct node {
int val;
struct node *left, *right;
} node;
int foo(node *p) {
int retval;
if (p == NULL)
return 0;
else {
retval = p->val + foo(p->left) + foo(p->right);
printf("%d ", retval);
return retval;
}
}
When foo is called with a pointer to the root node of the given binary tree, what will it print?

Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 48
Open questionCSMCQ2 marksNeeds review
Let
, where
is a large positive integer greater than 100. Let
be a positive integer less than
. Let
be subsets of
with
and
. We say that a permutation of
separates
from
if one of the following is true.All members of
appear in the permutation before any of the members of
.All members of
appear in the permutation before any of the members of
.How many permutations of
separate
from
?Your answerChoose one option.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 49
Open questionCSMSQ2 marksNeeds review
Let
be an onto (or surjective) function, where
and
are nonempty sets. Define an equivalence relation
on the set
as
where
. Let
be the set of all the equivalence classes under
. Define a new mapping
as
Which of the following statements is/are TRUE?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answerQuestion 50
Open questionCSMSQ2 marksNeeds review
Suppose you are asked to design a new reliable byte-stream transport protocol like TCP. This protocol, named myTCP, runs over a 100 Mbps network with Round Trip Time of 150 milliseconds and the maximum segment life of 2 minutes. Which of the following is/are valid lengths of the Sequence Number field in the myTCP header?
Your answerSelect all correct options. You can choose more than one.
Log in to check the answer
You can attempt this question now. Sign in to view the answer key, explanations and discussion.Log in to check answer