CS and IT Gate 2017 Set-2 Questions with Answer

Ques 27 Gate 2017 Set-2


An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which of the following conditions, can the relational table for R be merged with that of A?

(A) Relation R is one-to-many and the participation of A in R is total.
(B) Relation R is one-to-many and the participation of A in R is partial.
(C) Relation R is many-to-one and the participation of A in R is total.
(D) Relation R is many-to-one and the participation of A in R is partial.

A

A

B

B

C

C

D

D


(ER model) is the correct answer.

Ques 28 Gate 2017 Set-2


Given the following binary number in 32 bit (single precision) IEEE-754 format:

00111110011011010000000000000000

The decimal value closest to this floating-point number is:

A

1.45 X 101

B

1.45 X 10-1

C

2.27 X 10-1

D

2.27 X 101


(N) is the correct answer.

Given:
32-bit IEEE-754 representation: 00111110011011010000000000000000
To find:
The closest decimal value of the given floating-point number.
Solution:
First, let me split the 32 bits into the sign, exponent, and mantissa fields according to the IEEE-754 single-precision format:
Sign bit, s = 0 (1 bit)
Exponent, E = 01111100 (8 bits)
Mantissa, M = 11011010000000000000000 (23 bits)
Since the sign bit is 0, the number is positive.
Now, converting the exponent field from binary to decimal:
E = (01111100)2 = 64 + 32 + 16 + 8 + 4 = 124
The bias for single-precision IEEE-754 is 127, so subtracting the bias gives:
Actual exponent, e = E - 127 = 124 - 127 = -3
Next, let me find the normalized significand (1.M):
Significand = 1 + (1 × 2-1) + (1 × 2-2) + (0 × 2-3) + (1 × 2-4) + (1 × 2-5) + (0 × 2-6) + (1 × 2-7)
Significand = 1 + 0.5 + 0.25 + 0.0625 + 0.03125 + 0.0078125 = 1.8515625
Now, calculating the value of the floating-point number:
Value = (-1)s × (Significand) × 2e
Value = 1.8515625 × 2-3 = (1.8515625) / 8
Value = 0.2314453125 ≈ 2.31 × 10-1
Comparing with the given choices, the value closest to this is 2.27 × 10-1.
Answer:
C) 2.27 X 10-1

Ques 29 Gate 2017 Set-2


Consider a quadratic equation x2 - 13x + 36 = 0 with coefficients in a base b. The solutions of this equation in the same base b are x = 5 and x = 6. Then b = ______.


(a) is the correct answer.

Ques 30 Gate 2017 Set-2


The representation of the value of a 16-bit unsigned integer X in a hexadecimal number system is BCA9. The representation of the value of X in octal number system is:

A

571244

B

736251

C

571247

D

136251


(Number Representation) is the correct answer.

Ques 31 Gate 2017 Set-2


The read access times and the hit ratios for different caches in a memory hierarchy are as given below:

Cache Read Access Time
(In Nanosecond)
Hit Ratio
I-Cache 2 0.8
D-Cache 2 0.9
L2-Cache 8 0.9

The read access time of main memory in 90 nanoseconds. Assume that the caches use the referred-word-first read policy and the writeback policy. Assume that all the caches are direct mapped caches. Assume that the dirty bit is always 0 for all the blocks in the caches. In execution of a program, 60% od memory reads are for instruction fetch and 40% are for memory operand fetch. The average read access time in nanoseconds (up to 2 decimal places) is _________


(a) is the correct answer.

Ques 32 Gate 2017 Set-2


A system shares 9 tape drives. The current allocation and maximum requirement of tape drives for 3 processes are shown below:

Process Allocation Time Maximum Requirement
P1 3 7
P2 1 6
P3 3 5

Which of the following best describes the current state of the system?

A

Safe, Deadlocked

B

Safe, Not Deadlocked

C

Not Safe, Deadlocked

D

Not Safe, Not Deadlocked


(D) is the correct answer.

Given:
Total number of tape drives = 9
Processes: P1, P2, P3
Allocation: P1 = 3, P2 = 1, P3 = 3
Max Requirement: P1 = 7, P2 = 6, P3 = 5
To find:
Whether the current state of the system is Safe/Not Safe and Deadlocked/Not Deadlocked.
Solution:
First, let me calculate the total allocated tape drives.
Total allocated = 3 + 1 + 3 = 7
Now let me find the currently available tape drives.
Available = Total - Total allocated = 9 - 7 = 2
Next, I need to calculate the remaining Need for each process using Need = Max - Allocation.
For P1: Need = 7 - 3 = 4
For P2: Need = 6 - 1 = 5
For P3: Need = 5 - 3 = 2
Now let me check which process can be satisfied with Available = 2.
Checking P1: Need(P1) = 4 > Available (2), so P1 cannot execute right now.
Checking P2: Need(P2) = 5 > Available (2), so P2 cannot execute right now.
Checking P3: Need(P3) = 2 ≤ Available (2), so P3 can execute and complete.
Once P3 finishes, it releases its allocated tape drives.
New Available = 2 + Allocation of P3 = 2 + 3 = 5
Now check the remaining processes with Available = 5.
Checking P1: Need(P1) = 4 ≤ Available (5), so P1 can run and complete.
Once P1 finishes, it releases its allocated drives.
New Available = 5 + Allocation of P1 = 5 + 3 = 8
Finally, check P2.
Need(P2) = 5 ≤ Available (8), so P2 can also finish.
A safe sequence exists: <P3, P1, P2>.
Since a safe sequence exists, the system is in a Safe state.
By definition, if a system is in a safe state, it is definitely Not Deadlocked.
Answer:
(B) Safe, Not Deadlocked

Ques 33 Gate 2017 Set-2


Which of the following is/are shared by all the threads in a process?

I. Program Counter
II. Stack
III. Address space
IV. Registers

A

III only

B

IV only

C

I and II only

D

III and IV only


(T) is the correct answer.

Given:
Items related to threads in a process:
I. Program Counter
II. Stack
III. Address space
IV. Registers
To find:
Which of these is/are shared by all the threads in a process.
Solution:
Let me recall what is unique to a thread and what is shared among threads of the same process.
A thread is a basic unit of CPU utilization, and each thread must have its own execution context.
So each thread needs its own Program Counter to keep track of which instruction to execute next.
Each thread also needs its own set of CPU registers to hold temporary values.
And each thread needs its own private Stack for local variables and function call management.
So, items I (Program Counter), II (Stack), and IV (Registers) are private to each individual thread.
Now looking at what they share: threads within the same process share the code section, data section, open files, heap, and the entire address space.
Therefore, only the address space (III) is shared by all threads in the process.
Looking at the options, this corresponds to III only.
Answer:
(A) III only

Unique Visitor Count

Total Unique Visitors

Loading......