PREVIOUS YEAR SOLVED PAPERS - GATE 2017 Shift 1

56. The number of integers between 1 and 500 (both inclusive) that are divisible by 3 or 5 or 7 is ______.

  • Option : A
  • Explanation :
    {integers between 1 to 500 divisible by 3}
    {integers between 1 to 500 divisible by 5}
    {integers between 1 to 500 divisible by 7}
    To find number of integers between 1 to 500 that are divisible by 3 or 5 or 7 is to find

    (166+100+71) - (33+23+14)+4
    337-70+4 = 271
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


57. Consider a RISC machine where each instruction is exactly 4 bytes long. Conditional and unconditional branch instructions use PC- relative addressing mode with Offset specified in bytes to the target location of the branch instruction. Further the Offset is always with respect to the address of the next instruction in the program sequence. Consider the following instruction sequence.

Inst. No.Instruction
i:add R2, R3, R4
i + 1:sub R5, R6, R7
i + 2:cmp R1, R9, R10
i + 3beq R1, offset
If the target of the branch instruction is i, then the decimal value of the Offset is _____.

Note – Numerical Type question

  • Option : B
  • Explanation :
    I10-3
    24-7
    I38-11
    I412-15
     16-
    I4 is the branch instruction & is the target.
    0 = 16+ relative value
    ∴ relative value = -16
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


58. In a RSA cryptosystem a participant A uses two prime numbers p = 13 and q = 17 to generate her public and private keys. If the public key of A is 35. Then the private key of A is ______.

  • Option : C
  • Explanation :
     Given DataAs per RSA Algorithm
     P = 13Step1: Calculate n = pxq = 13x 17 = 221
     Q = 17Step2: Calculate ϕ(n) = (p-1)(q-1) = (12)(16) = 192
     E = 35Step3: de mod ϕ(n) = 1 (or) de = 1modϕ(n)
     ⇒ d x 35 mod 192 = 1  ⇒ d = 11
    D = ?
    So, D is 11
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


59. Let A be an array of 31 numbers consisting of sequence of 0’s followed by a sequence of 1’s. The problem is to find the smallest index i that A[i] is 1 by probing the minimum numbers of locations in A. The worst case number of probes performed by an optimal algorithm is _____.

  • Option : D
  • Explanation :
    The best way to solve such a problem is by using Binary Search. Search the sorted array by repeatedly dividing the search interval in half. Begin with an interval covering the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper half.
    Find mid element
    Is mid = 1 ?
    Is mid >1?(not possible here)
    Is mid < 1 ?
    Proceed accordingly, Worst case of this problem will be 1 at the end of the array i.e 00000…..1 OR 1…….0000. It will take log n time worst case.
    n=31, Hence log231 = 5.
    Therefore, option D is correct.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


60. Instructions execution in a processor is divided into 5 stages. Instruction Fetch (IF), Instruction Decode (ID), Operand Fetch (OF), Execute (EX), and Write Back (WB), These stages take 5,4,20, 10 and 3 nanoseconds (ns) respectively. A pipelined implementation of the processor requires buffering between each pair of consecutive stages with a delay of 2ns. Two pipelined implementations of the processor are contemplated.
(i) a naïve pipeline implementation (NP) with 5 stages and
(ii) an efficient pipeline (EP) where the OF stage id divided into stages OF1 and OF2 with execution times of 12 ns and 8 ns respectively.
The speedup (correct to two decimals places) achieved by EP over NP in executing 20 independent instructions with no hazards is _____.

  • Option : A
  • Explanation :
    Given,
    For Navie pipeline (NP)
    Number of stages (k) = 5
    Tp = max (stage delay + buffer delay)
    Tp = max 7, 6, 22, 12, 5 = 22 n sec.
    Number of instructions (n) = 20
    So, erection time for navie pipeline
    ETNP = k + (n −1) × Tp = 5 + 20 −1 × 22 = 528n sec
    Now, for efficient pipeline
    k = 6, n = 20, Tp = 14nsec.
    EEP = k + (n −1) ×Tp = 6 + 20 −1 ×14 = 350n sec.
    Therefore, Speedup = 528/350= 1.508
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Related Quiz.
GATE 2017 Shift 1