- 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

You must be logged in to post a comment.

Inst. No. | Instruction |

i: | add R2, R3, R4 |

i + 1: | sub R5, R6, R7 |

i + 2: | cmp R1, R9, R10 |

i + 3 | beq 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 :

II _{1}0-3 _{2}4-7 I _{3}8-11 I _{4}12-15 16- _{4}is the branch instruction & is the target.

0 = 16+ relative value

∴ relative value = -16

You must be logged in to post a comment.

You must be logged in to post a comment.

- 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 log_{2}31 = 5.

Therefore, option D is correct.

You must be logged in to post a comment.

You must be logged in to post a comment.

- Option : A
- Explanation :

Given,

For Navie pipeline (NP)

Number of stages (k) = 5

T_{p}= max (stage delay + buffer delay)

T_{p}= max 7, 6, 22, 12, 5 = 22 n sec.

Number of instructions (n) = 20

So, erection time for navie pipeline

ET_{NP}= k + (n −1) × T_{p}= 5 + 20 −1 × 22 = 528n sec

Now, for efficient pipeline

k = 6, n = 20, T_{p}= 14nsec.

E_{EP}= k + (n −1) ×T_{p}= 6 + 20 −1 ×14 = 350n sec.

Therefore, Speedup = 528/350= 1.508

You must be logged in to post a comment.

You must be logged in to post a comment.

You must be logged in to post a comment.