GATE 2024 (Session 2)
65 questions
MCQ 32 · MSQ 18 · NAT 151-mark 30 · 2-mark 35
Questions 56–60 of 65
A functional dependency is termed as a useful functional dependency if and only if it satisfies all the following three conditions:
is not the empty set. is not the empty set. Intersection of and is the empty set.
For a relation with 4 attributes, the total number of possible useful functional dependencies is ______
is not the empty set. is not the empty set. Intersection of and is the empty set.
For a relation with 4 attributes, the total number of possible useful functional dependencies is ______
Answer: 50
X and Y must both be non-empty and have nothing in common. Every one of the 4 attributes can be put in X, in Y, or in neither: ways.
Take away the cases where X is empty () and where Y is empty (). Then add back the case where both are empty (1):
Answer: 50
Take away the cases where X is empty () and where Y is empty (). Then add back the case where both are empty (1):
Answer: 50
A processor with 16 general purpose registers uses a 32-bit instruction format. The instruction format consists of an opcode field, an addressing mode field, two register operand fields, and a 16-bit scalar field. If 8 addressing modes are to be supported, the maximum number of unique opcodes possible for every addressing mode is _________
Answer: 32
The 32 bits are shared by four fields.
- Register fields: 16 registers need bits each, so two fields use bits.
- Addressing mode field: 8 modes need bits.
- Scalar field: 16 bits.
Bits left for the opcode: . So the number of opcodes is . The addressing mode has its own field, so all 32 opcodes can be used with every addressing mode.
Answer: 32
- Register fields: 16 registers need bits each, so two fields use bits.
- Addressing mode field: 8 modes need bits.
- Scalar field: 16 bits.
Bits left for the opcode: . So the number of opcodes is . The addressing mode has its own field, so all 32 opcodes can be used with every addressing mode.
Answer: 32
A non-pipelined instruction execution unit operating at 2 GHz takes an average of 6 cycles to execute an instruction of a program P. The unit is then redesigned to operate on a 5-stage pipeline at 2 GHz. Assume that the ideal throughput of the pipelined unit is 1 instruction per cycle. In the execution of program P, 20% instructions incur an average of 2 cycles stall due to data hazards and 20% instructions incur an average of 3 cycles stall due to control hazards. The speedup (rounded off to one decimal place) obtained by the pipelined design over the non-pipelined design is ________
Answer: 2.9 to 3.1
Non-pipelined unit: 6 cycles for each instruction.
CPI of the pipelined unit:
The clock is the same (2 GHz), so the speedup is:
Answer: 3
CPI of the pipelined unit:
The clock is the same (2 GHz), so the speedup is:
Answer: 3
The number of distinct minimum-weight spanning trees of the following graph is _______
Answer: 9
Apply the idea of Kruskal's algorithm.
- The four edges of weight 1 (a-b, a-f, c-d, d-e) make no cycle, so every MST has them. This gives the components {a, b, f}, {c, d, e} and {g}.
- Next, g has to be joined to both components with edges of weight 2:
Joining g to {a, b, f}: g-a, g-b, g-f 3 choices
Joining g to {c, d, e}: g-c, g-d, g-e 3 choices
- Edges of weight 3 are not needed at all.
Count of MSTs: (each has weight 8).
Answer: 9
- The four edges of weight 1 (a-b, a-f, c-d, d-e) make no cycle, so every MST has them. This gives the components {a, b, f}, {c, d, e} and {g}.
- Next, g has to be joined to both components with edges of weight 2:
Joining g to {a, b, f}: g-a, g-b, g-f 3 choices
Joining g to {c, d, e}: g-c, g-d, g-e 3 choices
- Edges of weight 3 are not needed at all.
Count of MSTs: (each has weight 8).
Answer: 9
The chromatic number of a graph is the minimum number of colours used in a proper colouring of the graph. The chromatic number of the following graph is _______
Answer: 2
Label the 8 vertices 1 to 8 going around the octagon.
- Each of the 8 outer sides joins two neighbouring vertices, so one end is odd and the other is even.
- Each inner line (2 vertical, 2 horizontal and 4 slanted) joins two vertices that are 3 steps apart around the octagon. Again, one end is odd and the other is even.
Now give colour 1 to the odd vertices and colour 2 to the even vertices. No edge has both ends in the same colour. So the graph is bipartite. The graph also has edges, so at least 2 colours are needed.
Answer: 2
- Each of the 8 outer sides joins two neighbouring vertices, so one end is odd and the other is even.
- Each inner line (2 vertical, 2 horizontal and 4 slanted) joins two vertices that are 3 steps apart around the octagon. Again, one end is odd and the other is even.
Now give colour 1 to the odd vertices and colour 2 to the even vertices. No edge has both ends in the same colour. So the graph is bipartite. The graph also has edges, so at least 2 colours are needed.
Answer: 2