GATE 2026 (Session 1)
65 questions
MCQ 28 · MSQ 24 · NAT 131-mark 30 · 2-mark 35
Questions 36–40 of 65
Consider the real valued variables and represented using the IEEE singleprecision floating-point format. The binary representations of and in hexadecimal notation are as follows:
Let .
Which one of the following is the binary representation of , in hexadecimal notation?
Let .
Which one of the following is the binary representation of , in hexadecimal notation?
Answer: (C)
IEEE-754 single precision has 1 sign bit, 8 exponent bits (bias 127) and 23 mantissa bits.
. Split as . The sign bit is , the exponent bits (unbiased ) and the mantissa . So .
. Split as . The sign bit is , the exponent bits (unbiased ) and the mantissa . So .
To add them, bring the exponent of to by shifting its mantissa right by bits: .
Now add: .
This is already normalized, as the leading digit is . So has sign , exponent bits and mantissa bits followed by 19 zeros:
Regroup in 4 bits from the left: .
Answer: (C)
. Split as . The sign bit is , the exponent bits (unbiased ) and the mantissa . So .
. Split as . The sign bit is , the exponent bits (unbiased ) and the mantissa . So .
To add them, bring the exponent of to by shifting its mantissa right by bits: .
Now add: .
This is already normalized, as the leading digit is . So has sign , exponent bits and mantissa bits followed by 19 zeros:
Regroup in 4 bits from the left: .
Answer: (C)
Consider a -bit saturating up/down counter that performs the saturating up count when the input is , and the saturating down count when is . The Next State table of the counter is as shown. The counter is built as a synchronous sequential circuit using D flip-flops.
Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
Which one of the following options corresponds to the expressions for the inputs of the D flip-flops, and ?
Answer: (B)
Use the given next-state table. First find the input combinations where . They are: .
Now group these minterms. and give . Next, and give . Then and give . These three product terms cover exactly the minterms needed, and no extra ones. So:
Do the same for D0. Here for . Grouping: and give . and give . and give . These cover exactly the required minterms:
These two expressions match option (B).
Answer: (B)
Now group these minterms. and give . Next, and give . Then and give . These three product terms cover exactly the minterms needed, and no extra ones. So:
Do the same for D0. Here for . Grouping: and give . and give . and give . These cover exactly the required minterms:
These two expressions match option (B).
Answer: (B)
The size of the physical address space of a processor is bytes. The capacity of a cache memory unit is bytes. The cache block size is bytes. The cache memory unit can be built as a direct mapped cache or as a -way set-associative cache, where and . Let the length of the TAG field be bits for the direct mapped cache, and bits for the set-associative cache.
Which one of the following options is true?
Which one of the following options is true?
Answer: (A)
Data: physical address space bytes, cache capacity bytes, and block size bytes.
Direct-mapped cache: the number of cache lines . So the index field has bits and the offset field has bits. The tag field then has bits.
-way set-associative cache (where ): the number of sets . So the index field has bits, and the offset field stays at bits. The tag field then has bits.
Compare the two: , because .
Answer:
Direct-mapped cache: the number of cache lines . So the index field has bits and the offset field has bits. The tag field then has bits.
-way set-associative cache (where ): the number of sets . So the index field has bits, and the offset field stays at bits. The tag field then has bits.
Compare the two: , because .
Answer:
Consider the following code snippet in C language that computes the number of nodes in a non-empty singly linked list pointed to by the pointer variable head.
struct node{
int elt;
struct node *next;
};
int getListSize (struct node *head)
{
if( E1 ) return 1;
return E2 ;
} Which one of the following options gives the correct replacements for the expressions and Answer: (B)
Count the nodes recursively: a node adds 1 to the count of the nodes after it. The function is called only on a non-empty list, so the last node is the stopping point.
E1: the base case is the last node, . Then the function returns 1, for that one node.
E2: otherwise the answer is 1 (this node) plus the size of the rest of the list, which starts at . So E2 is . This is option (B). For a list of nodes, the calls reach the last node after steps and the total is .
Why the others fail:
(A) and (D) call with the same . The argument never changes, so the recursion never ends.
(C) tests and returns 1 there. The calls go past the last node to NULL, and that NULL case adds 1 for a node that does not exist. The result is (and a one-node list would give 2).
Answer: (B)
E1: the base case is the last node, . Then the function returns 1, for that one node.
E2: otherwise the answer is 1 (this node) plus the size of the rest of the list, which starts at . So E2 is . This is option (B). For a list of nodes, the calls reach the last node after steps and the total is .
Why the others fail:
(A) and (D) call with the same . The argument never changes, so the recursion never ends.
(C) tests and returns 1 there. The calls go past the last node to NULL, and that NULL case adds 1 for a node that does not exist. The result is (and a one-node list would give 2).
Answer: (B)
Let be the set of all integers from to . Consider any order of insertion of the elements of into a binary search tree that creates a complete binary tree.
Which one of the following elements can NEVER be the third element that is inserted?
Which one of the following elements can NEVER be the third element that is inserted?
Answer: (D)
A complete binary tree on 15 keys is a perfect tree with 4 levels. As a BST on it is fixed: root 8; level 1: 4, 12; level 2: 2, 6, 10, 14; leaves: 1, 3, 5, 7, 9, 11, 13, 15.
A key can only be inserted after all its ancestors, since otherwise it would take the place of one of them. So an order gives this tree exactly when every key comes after its parent.
The 1st key is 8. The 2nd is 4 or 12. The 3rd is either the other level-1 key, or a child of the 2nd key. So the possible third keys are 2, 4, 6, 10, 12, 14.
For example 4 (order 8, 12, 4), 2 (order 8, 4, 2) and 10 (order 8, 12, 10) can all be third.
5 is the child of 6, whose parent is 4, whose parent is 8. The three keys 8, 4 and 6 must go in before 5, so 5 can be inserted 4th at the earliest. It can never be third.
Answer: (D)
A key can only be inserted after all its ancestors, since otherwise it would take the place of one of them. So an order gives this tree exactly when every key comes after its parent.
The 1st key is 8. The 2nd is 4 or 12. The 3rd is either the other level-1 key, or a child of the 2nd key. So the possible third keys are 2, 4, 6, 10, 12, 14.
For example 4 (order 8, 12, 4), 2 (order 8, 4, 2) and 10 (order 8, 12, 10) can all be third.
5 is the child of 6, whose parent is 4, whose parent is 8. The three keys 8, 4 and 6 must go in before 5, so 5 can be inserted 4th at the earliest. It can never be third.
Answer: (D)