1. S --> AB|AS
A --> a|aA
B --> b
What is the grammar accepted by the above?
Ans. aa*b
2. How many address lines are needed to address a 64Kb segment with each register storing upto 512 bytes.
Ans. 14 address lines
3. Find the expression representing the following K-map
1 1 1
1 1
1 1 1
4. For the POS form of the expression given below
_ _ _
X.Y.Z + X.Y.Z + X.( Y + Z )
5. In a computer system the ROM :
(a) contains boot software
(b) is permanent
(c) Both of the above
(d) None of the above
Ans. (c)
6. The binary equivalent of 3B7F is
Ans. 0011 1011 0111 1111
7. The register used by the shift reduce passing method is
Ans. Stack
8. A microprogram can be defines as to consist of
Ans. A primitive operation
9. Find the output for the following C program
int array[4][4] = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16};
for (i=2;i<0;i--)
for (j=2;j<=0;j--)
printf("%d", arr[i][j]);
10. Find the output for the following C program
#include<stdio.h>
void main()
{int i,x,sum=0;
int arr[6]=[1,2,3,4,5,6]
for (i=0;i<4;i++)
sum+ = func(arr[i]);
printf("%d", sum);
}
func(int x)
{ int val,x;
val = 2;
return(x+ val++);
}
11. Given the following data:
Process P1 takes 2 seconds
Process P2 takes 3 seconds
Process P3 takes 4 seconds
Process P4 takes 1 second
Process P5 takes 6 seconds
Find the average time in case of shortest job first (SJF) scheduling.
12. Given a string STOCK and a stack of size 4.
Which of the following strings cannot be generated using this stack.
(a) TSOCK
(b) TOSKC
(c) STOCK
(d) TKOSC
(e) None of these
13. Inversion of a matrix will take which of the following time complexities?
(a) O(n)
(b) O(n²)
(c) O(log n)
(d) O(n³)
(e) None of these
Saturday
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment