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

GATE 2007

184 questions

MCQ 1841-mark 184

Questions 126–130 of 184

Q126Parsing1 markMCQ−0.33 if wrong
Which one of the following is a top-down parser?

Q127Runtime Environment1 markMCQ−0.33 if wrong
Early binding refers to a binding performed at compile time and late binding refers to a binding performed at execution time. Consider the following statements:
i. Static scope facilitates w1 bindings.
ii. Dynamic scope requires w2 bindings.
iii. Early bindings w3 execution efficiency.
iv. Late bindings w4 execution efficiency.
The right choices of wl, w2, w3 and w4 (in that order) are

Q128Intermediate Code Generation1 markMCQ−0.33 if wrong
In a simplified computer the instructions are:
OP Rj, Ri- Performs Rj OP Ri and stores the result in register Ri.
OP m,Ri- Performs val OP Ri and stores the result in Ri. val denotes the content of memory location m.
MOV m, Ri- Moves the content of memory location m to register Ri.
MOV Ri, m- Moves the content of register Ri to memory location m.

The computer has only two registers, and OP is either ADD or SUB. Consider the following basic block:
t1=a+bt_1 = a + b
t2=c+dt_2 = c + d
t3=e−t2t_3 = e - t_2
t4=t1−t3t_4 = t_1 - t_3
Assume that all operands are initially in memory. The final value of the computation should be in memory. What is the minimum number of MOV instructions in the code generated for this basic block?

Q129System Call1 markMCQ−0.33 if wrong
The contents of the text file t1.txt containing four lines are as follows :
a1 b1
a2 b2
a3 b2
a4 b1
The contents of the text file t2.txt containing five lines are as follows :
a1 c1
a2 c2
a3 c3
a4 c3
a5 c4
Consider the following Bourne shell script :
awk -F ' ' '{print $1, $2}' t1.txt |
while read a b ; do
            awk -v aV=$a -v bV=$b -F ' ' '
            aV == $1 {print aV, bV, $2}' t2.txt
done 

Which one of the following strings will NOT be present in the output generated when the above script is run? (Note that the given strings may be substrings of a printed line.)

Q130Thread1 markMCQ−0.33 if wrong
Consider the following statements about user level threads and kernel level threads. Which one of the following statements is FALSE?