Question 1 (i) According to the Principle of duality, the Boolean equation (A+B’) • (A+1)= A + B’ will be
equivalent to: [1]
(a) (A’+B) • (A’+ 1) = A’ + B
(b) (A • B’)+(A • 0) = A • B’
(c) (A’ • B)+(A’ • 1) = A’ • B
(d) (A’ • B)+(A’ • 0) = A’ • B
(ii) When a sequence of OR, NOT, NOR are connected in series, the logic gate obtained is: [1]
(a) AND (b) NOT (c) OR (d) XOR
(iii)Idempotence Law states that: [1]
(a) X + X = X (b) X + X’ = 0 (c) X + X = 1 (d) X + X’ = X
(iv) Assertion: For proposition ~A =>B its contra positive is B=> ~ A [1]
Reason: Contra positive is the converse of inverse for any proposition.
(a) Both Assertion and Reason are true, and Reason is the correct explanation for the Assertion.
(b) Both Assertion and Reason are true, but Reason is not the correct explanation for the Assertion.
(c) Assertion is true but Reason is false.
(d) Assertion is false but Reason is true.
(v) According to De Morgan’s law (a + b + c’)’ will be equal to: 1
(a) a’ + b’ + c’ (b) a’ + b’ + c (c) a’ . b’ . c’ (d) a’ . b’ . c
(vi) The dual of (X’ + 1) . (Y’ + 0) = Y’ is: 1 (a) X . 0 + Y . 1 = Y (b) X’ . 1 + Y’ . 0 = Y’ (c) X’ . 0 + Y’ . 1 = Y’ (d)
(X’ + 0) + (Y’ + 1) = Y’
(vii) The reduced expression of the Boolean function F(P, Q) = P’ + PQ is: 1 (a) P’ + Q (b) P (c) P’ (d) P + Q
(viii) If (~p => ~q) then its contra positive will be: 1 (a) p => q (b) q => p (c) ~q => p (d) ~p => q
(ix) (vii) Verify if (A + A’)’ is a Tautology, Contradiction, or a Contingency. 1
x) State any one purpose of using the keyboard this in Java program
Question 2
i) An array ARR [-5.....15, 10....20] stores elements in Row Major Wise with each element
requiring 2 bytes of storage. Find the address of ARR [10] [15] when the base address is
2500. [2]
ii) The following function is a part of some class: int jolly(int[ ] x, int n, int m) {
if (n < 0)
return m;
else if(n m) ?x[n]:m;
return jolly(x, - -n, m); }
(a) What will be the output of jolly( ) when the value of x[ ]= {6, 3, 4, 7, 1}, n = 4 and m = 0?
[2]
(b) What function does jolly() perform, apart from recursion? [1]
(iv) The following function is a part of some class which is used to find the smallest digit
present in a number. There are some places in the code marked by ?1?, ?2?, ?3? which must
be replaced by an expression / a statement so that the function works correctly?
int small_dig(int n) {
int min =? 1 ? ;
while (n ! = 0) {
int q = n / 10;
int r =?2? * 10;
min = r > min ? 3 ? : r;
n = q;
}
return min;
}
(a) What is the expression or statement at ?1? [1]
(b) What is the expression or statement at ?2? [1]
(c) What is the expression or statement at ?3? [1]
iii) A matrix ARR[ – 4…6, 3….8] is stored in the memory with each element requiring 4 bytes of
storage. If the base address is 1430, find the address of ARR[3][6] when the matrix is stored in Row
Major Wise 2
iv) The following function Mystery( ) is a part of some class. What will the function Mystery( ) return
when the value of num=43629, x=3 and y=4 respectively? Show the dry run/ working.
PART – II (50 Marks) Answer six questions in this part, choosing two questions from Section A, two from
Section B
SECTION - A
Answer any two questions.
Question 4
(a) Given the Boolean function F(A, B, C, D) = ( 0, 2, 3, 4, 5, 8, 10, 11, 12, 13 ).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e.
octal, quads and pairs). [4]
(ii) Draw the logic gate diagram for the reduced expression using only NAND gates. Assume that the
variables and their complements are available as inputs. [1]
(b) Given the Boolean function: F(P, Q, R, S) = ( 0, 1, 2, 8, 9, 11, 13, 15 ).
(i) Reduce the above expression by using 4-variable Karnaugh map, showing the various groups (i.e.
octal, quads and pairs). [4]
(ii) Draw the logic gate diagram for the reduced expression using only NOR gates. Assume that the
variables and their complements are available as inputs.
SECTION – B Answer any two questions.
Each program should be written in such a way that it clearly depicts the logic of the problem. This can
be achieved by using mnemonic names and comments in the program. (Flowcharts and Algorithms are
not required.) The programs must be written in Java.
Question 7
Design a class ArmNum to check if a given number is an Armstrong number or not. [A number is said to
be Armstrong if sum of its digits raised to the power of length of the number is equal to the number]
Example : 371 = 33 + 73 + 13 1634 = 14 + 64 + 34 + 44 54748 = 55 + 45 + 75 + 45 + 85 Thus 371, 1634 and
54748 are all examples of Armstrong numbers.
Some of the members of the class are given below: [10]
Class name : ArmNum Data members/instance variables:
n : to store the number l : to store the length of the number
Methods/Member functions:
ArmNum (int nn) : parameterized constructor to initialize the data member n=nn
int sum_pow(int i) : returns the sum of each digit raised to the power of the length of the number using
recursive technique eg. 34 will return 32 + 42 (as the length of the number is 2)
void isArmstrong( ) : checks whether the given number is an Armstrong number by invoking the
function sum_pow( ) and displays the result with an appropriate message
Specify the class ArmNum giving details of the constructor( ), int sum_pow(int) and void isArmstrong( ).
Define a main( ) function to create an object and call the functions accordingly to enable the task.10