The Frank Anthony Public SCHOOL, BANGALORE 2020-2021 Computer Science I Semister Paper 1
The Frank Anthony Public SCHOOL, BANGALORE 2020-2021 Computer Science I Semister Paper 1
(a) X + 0 + X' = 1
(b) X' + 0 + X = 0
(c) X· + 1 + X = 1
(d) X . 1 . X' = 0
3 If A=0, B=0, C=1 and D=1, then the Maxterm will be: [1]
1
(a) A' + B' + C + D
(b) A’ B' C D
(c) A + B + C'+D'
(d) A’+B+C+D’
4 The compliment of the Boolean expression F(A,B,C) = ( (A' + B)' .(C' + D'))' is: [1]
(a) Conjunction
(b) Implication
(c) Disjunction
(d) Equivalence
2
(a) 3
(b) 8
(c) 7
(d) 4
9 The valid SOP Gray code combination for variable a and b are [2]
(b) (a^b)
(c) (a˅b')
(d) (a.b)
11 If the input to a full Adder is a=1 b=1 c=0 then what will be the output of Sum and Carry [1]
12 A matrix MAT[15][10] is stored in the memory in Column Major Wise with each element
requiring 4 bytes of storage. If the base address at MAT[2][4] is 2200, then the address [2]
of MAT[7][4] will be:
3
(a) 2016
(b) 2220
(c) 2319
(d) 2328
13 With reference to the given proposition P => ~Q , answer the following questions:
(i) ~Q => P
(ii) P => ~Q
(iii) ~P => Q
(iv) ~P => ~Q
(i) ~P => Q
(ii) Q => ~P
(iii) ~Q => P
(iv) ~Q => P
14 The reduced expression for the Boolean expression F(X,Y,Z) = π(0,1,2,3,4,5,6,7) is: [2]
(b) 1
(c) 0
15 With reference to the code given below answer the following questions: [3]
int c=5;int d=1;
while( --c > 1);
while( d++ < 3);
System.out.println( c *d);
What is the output of the code?
a) 6
b) 4
c) 4*7
d) 4*5
4
16 What is the output of the statement given below? [2]
System.out.print('A'+45+""+'A');
a) A45A
b) 6545A
c) 110A
d) SYNTAX ERROR
a) 24\\9\\200021
b) 24\9\200021
c) 24\9\2021
d) None
18 The logic gate that represents the simplification of Boolean Expression [2]
a) AND gate
b) OR gate
c) NAND gate
d) NOR gate
(a) Contradiction
(b) Tautology
(c) Contingency
(d) Disjunction
5
20 Reduce the given Boolean function F(A,B,C,D) = ∑(0,2,8,9,10,11,13,15) by using 4-
variable Karnaugh map and answer the following questions:
a) What will be the least number of groups and their types formed for reduction? [1]
(i) 2 Quad i.
(ii) 3 quad
(iii) 2 pair and 1 Quad
(iv) 4 pair
b) The reduced expression of the Boolean function given above [2]
(i) B'D' + AD + AB'
(ii) B'D' +AD
(iii) B'C'D' + B'CD'+AD
(iv) B'C'D' + B'CD' +AC'D +ACD
a) What will be the least number of groups and their types formed for reduction? [1]
(i) 3 Quad i.
(ii) 2 quad
(iii) 2 pair and 1 Quad
(iv) 4 pair
b) The reduced Boolean expression of the Boolean Function given above [2]
(i) (A'+B').(B+D').(A'+D')
(ii) (A'+B+D).(A+B+D').(A'+B')
(iii) (A'+B').(B+D')
(iv) (A'+B+D').(A+B+D’)
22 A smart TV chip controls whether or not the children are allowed to watch TV based
on the following conditions-
If the login time is between 5pm to 7pm and the login password is correct
OR
If the login password is correct and the show rating is General
OR
6
If the chip recognizes the bio-metric information of the parent and the login time is
not between 5 and 7
T Login time is between 5pm and 7pm
B Bio-metric information of the parent is correct
P Login password is correct
R Show rating is General
In all the above cases 1 indicates yes and 0 indicates no
Output: W [1 indicates Yes and 0 indicates No]
Write the truth table for the given conditions and answer the following questions given
below. [2]
a) The POS expression for W(T, B, P, R) will be:
(i) W(T, B, P, R) = π(0,1,2,8,9,12,13)
(ii) W(T, B, P, R) = π(3,4,5,6,7,10,11,14,15)
(iii) W(T, B, P, R) = Σ(0,1,2,8,9,12,13)
(iv) W(T, B, P, R) = Σ(3,4,5,6,7,10,11,14,15)
b) Number of inputs in the truth table that satisfies only for the 3rd condition in the
above question. [1]
(i) 2
(ii) 1
(iii) 4
(iv) 3
23.
From the logic circuit given above where A, B, C are inputs. Answer the following
questions:
a) Expression at (1) is: [1]
(i)A+B
(ii)(A+B)'
7
(iii)A.B
(iv)(A.B)'
8
27 With reference to the code given below, answer the questions that follows:
void Fun()
{ int a[][] = {{11,12,11,12},{13,14,15},{16,17,18}};
for(int i=0; i<a[1].length ; i++)
System.out.print(a[2][2-i]);
}
a) What will a.length give in the above code? [1]
(i) 4
(ii) 2
(iii) 3
(iv) 1
b) What is the output of the above code? [2]
(i) 131415
(ii) 161718
(iii) 11121112
(iv) 181716
28 What is the conditional statement to print elements above the left Diagonal in a
double dimensional array of ‘M’ number of rows and ‘N’ number of columns? The row
index is represented by ‘r’ and the column index is represented by ‘c’. [2]
a) r<c
b) r>c
c) (r+c) >N
d) (r+c)<N
29 With reference to the code given below, answer the following question
void Fun(int a[], int n)
{ int t; int i,k;
for(k=1;k<=n; ++k)
{ t=a[0];
for( i=1; i<a.length ; ++i)
a[i-1] = a[i];
a[i-1] = t;
}
}
9
a) What will be the output of the method Fun() when the value of
a[]={11, 12, 13, 14, 15} and n=2? [3]
(i) 11 12 13 14 15
(ii) 12 13 14 15 11
(iii) 13 14 15 11 12
(iv) 14 15 11 12 13
b) What is the method fun() performing? [1]
(i) Shift the values left by n times
(ii) Shift the values right by n times
(iii) Rotates the values left by n times
(iv) Rotates the values right by n times
31 The method Addition Add(Addition X) copies the content of the objet X to the current
object in the reverse order and returns the current object. The data members / attributes for
the class being :
int a[] = new int[5];
int n;
10
There are some places in the code marked as ?1?, ?2?, ?3?, ?4?, ?5?
which are to be replaced by a code/statement so that the program works properly.
Addition Add(Addition X)
{ for(int i=0 ; ?1?-------; ?2?----)
?3?--- = ?4?------;
return ?5?----;
}
(a) What is the statement or the expression at ?1? [1]
(i) i <= n
(ii) i<n
(iii) i=n
(iv) i>n
(b)What is the statement or the expression at ?2? [1]
(i) ++i;
(ii) i=i+2
(ii) i+=2
(iv) i—
(c) What is the statement or the expression at ?3? [1]
(i) a[i]
(ii) X.a[i]
(iii) a[i].X
(iv)X
(d)What is the statement or expression at ?4? [1]
(i)X.a[i]
(ii)X,a[n-i]
(iii)X.a[(n-1)-i]
(iv)X.a[n]
(e)What is the statement or expression at ?5? [1]
(i) a
(ii)X
(iii)X.a
(iv)this
11
32 The following code searches for a number (no) in the array (a[]) and returns the
subscript if found else returns -1. There are some places in the code marked as ?1?, ?2?,
?3?, ?4?, ?5? which are to be replaced by a code/statement so that the program works
properly. [1]
int BSearch(int a[], int no)
{ int mid ;
int low=0; int high = ?1?;
while( low <= high)
{ mid = (low+high)/2;
if( ?2?)
return mid;
else if( ?3?)
low= mid +1;
else
high= ?4?;
}
?5?;
}
Answer the following questions:
a) What is the statement or the expression at ?1? [1]
(i) a.length()
(ii) a.length
(iii) a.length-1
(iv) length
b) What is the statement or the expression at ?2? [1]
(i) no > a[mid]
(ii) no == a[mid]
(iii) no < a[mid]
(iv) no
c) What is the statement or the expression at ?3? [1]
(i) no > a[mid]
(ii) no == a[mid]
(iii) no < a[mid]
12
(iv) no
d) What is the statement or the expression at ?4? [1]
(i) high= mid +1
(ii) high= mid -1
(iii) high = mid
(iv) high = mid
e) What is the statement or the expression at ?5? [1]
(i) mid
(ii) mid -1
(iii) mid+1
(iv) -1
13