0% found this document useful (0 votes)
47 views

The Frank Anthony Public SCHOOL, BANGALORE 2020-2021 Computer Science I Semister Paper 1

The document contains a computer science exam paper with 27 multiple choice questions testing concepts in Boolean algebra and logic gates. The questions cover topics like Boolean laws, Karnaugh maps, logic circuits, truth tables, and coding concepts involving arrays.

Uploaded by

mohamed sahil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views

The Frank Anthony Public SCHOOL, BANGALORE 2020-2021 Computer Science I Semister Paper 1

The document contains a computer science exam paper with 27 multiple choice questions testing concepts in Boolean algebra and logic gates. The questions cover topics like Boolean laws, Karnaugh maps, logic circuits, truth tables, and coding concepts involving arrays.

Uploaded by

mohamed sahil
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

THE FRANK ANTHONY PUBLIC

SCHOOL, BANGALORE 2020-2021


COMPUTER SCIENCE
I SEMISTER PAPER 1
(THEORY)
---------------------------------------------------------------------------------------------------------------------
Maximum Marks: 70
Time allowed: One and a half hours
(Candidates are allowed additional 15 minutes for only reading the paper.)
ALL QUESTIONS ARE COMPULSORY
The marks intended for questions are given in brackets [ ].

Select the correct option for each of the following questions.

1. The law which represents the Boolean equation A ( A + B) = A is: [1]

(a) Associative Law

(b) Distributive Law

(c) Commutative Law

(d) Absorption Law

2 The dual of the Boolean equation X . 1. X' = 0 is: [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) (A' + B') +(C'+D')

(b) (A' + B') .(C'+D')

(c) (A . B') . (C' + D')

(d) (A' . B') +(C'.D')

5 The propositional operator <=> represents: [1]

(a) Conjunction

(b) Implication

(c) Disjunction

(d) Equivalence

6 Half-adder are used for: [1]

(a) Adding two bits

(b) Converting Decimal to Binary

(c) Converting Binary to Decimal

(d) Adding three bits

7 Universal gates are [1]

(a) AND gate and OR gate

(b) NOR gate and NOT gate

(c) NAND gate and NOR gate

(d) AND gate and NOT gate

8 The 3x8 decoder has ---------- input combinations [1]

2
(a) 3

(b) 8

(c) 7
(d) 4

9 The valid SOP Gray code combination for variable a and b are [2]

(a) a+b a+b’ a'+b' a'+b

(b) a'b' a'b ab ab'

(c) a'b' a'b ab’ ab

(d) a'+b' a'+b a+b a'+b

10 The proposition (a v b ) is represented by: [1]

(a) (a˅b) ^ (a˅b') ^ (a'˅b)

(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]

(a) Sum = 1 Carry = 0

(b) Sum = 0 Carry = 1

(c) Sum = 1 Carry = 1

(d) Sum = 0 Carry = 0

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:

(a) the inverse of the proposition is: [1]

(i) ~Q => P

(ii) P => ~Q

(iii) ~P => Q

(iv) ~P => ~Q

(b) the contra-positive of the proposition is: [1]

(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]

(a) XY’ + X’Y

(b) 1

(c) 0

(d) None of the above

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

17 What is the output of the statement given below? [2]


System.out.print(String.valueOf(24)+"\\"+'9'+"\\"+(Integer.parseInt("2000")+21));

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'B'C + ( A + B + C )' + A' B' C' D

a) AND gate

b) OR gate

c) NAND gate

d) NOR gate

19 The proposition q ˅ [ p ˅ ( ~ q)] is [2]

(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

21 Reduce the given Boolean function F(A,B,C,D) = π(1,3,9,11,12,13,14,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) 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)'

b) Expression at (2) is: [1]


(i)A+B+C
(ii)(A+B)' +C
(iii)(A+B)' .C
(iv)(A.B)’+C
c) Expression at (3) is: [2]
(i) ((A+B)'.C+(A+B)’)’
(ii) ((A,B)'+C+(A.B)’)’
(iii) ((A.B)'.C)
(iv) ((A+B).C)
24 The complement of the Boolean Expression [2]
( A' + B ) . (A+B' )'
a) (A+ B' ) . (A+B' )
b) (A' + B ) . ( A + B' )
c) (A' + B' ) + (A . B' is)
d) (A+ B) . (A' + B')
25 Complete the law P + P.Q = ------- [1]
a) P
b) P'
c) Q'
d) P+Q

26 The Canonical Sum of Product for X(A,B) = A+B’ is [2]


a) (A+B) . (A'+B).(A'+B')
b) (A'.B') + (A.B')+(A.B)
c) (A+B) .(A'+B)
d) (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

30 With reference to the following method answer the following question.


boolean XYZ(int n)
{
for (int i = 2; i < n; i++)
if (n % i == 0)
return false;
return true;
}
a) What will be the output of the method XYZ, if the value of n=7 [1]
i) true
ii) false
b) What will be the output of the method XYZ, if the value of n = 4? [1]
i) true
ii) false
c) State in one line what is the method doing? [1]
(i) return true if the number is positive else false
(ii) return true if the number is even else false
(iii) return true if the number is prime else false
(iv) return true if the number is composite else false

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

You might also like