Consider the following program :
main ( )
{
putchar (‘M’)
first ();putchar (‘r’);
}
first ( )
{…………}
second ( )
{putchar (‘i’);}
If Minister is the required output, then the body of first must be
-
Solution
The required output is Minister.So, the firstly M will be print by the first statement given in the program. Now, the function first ( ) is called. To print “insite”,the body of first
( ) should be
first ( )
{
second ( ); /* it prints ‘i’ */putchar (‘n’)
second ( ); * itprints‘i’*/
putchar (‘s’) ;
putchar (‘t’) ;
putchar (‘e’) ;
}
and the last statement putchar (‘r’) given in the program will print r.
-
Solution
\(\overline{ab}+\overline{bd}+\overline{ad}\)
Consider the digital circuit given in figure below which compares two numbers B0, B1, B2, B3 and A0, A1, A2, A3. To get output y = 0, which of the following pair is correct ?
-
Solution
For outputY = 0, all 4inputs of NAND gate should be high(i.e., 1), toget high, any one input of XOR gate should behigh. Hence 0010 and 1101 is right answer
Which one of the following array represents a binary max-heap?
-
Solution
A tree is Max-heat if data at every node in the tree is greater than or equal to its children's data in array representation of heap tree, a node at index i, has its left child at index (2i + 1)and right child at index (2i + 2).
Consider the following Karnaugh map. Determine the corresponding switching function in its minimal form.
-
Solution
The Karnaugh map is
Pair 1 has common B' and C, so minterm will be B'C.Pair2 has common B' and D' and so minterm will be B'D'.Pair3 has common A, B and D. Sominterm will be ABD.So, F(A, B, C,D) = B'C +B'D' + ABD
The Boolean function f(x,y,z)= x’yz’+ xyz’ + xyz is equivalent to(a)yz + xy(b)yz’+ xy(c)y’z + xy(d)y’z + x’y’
-
Solution
f(x,y,z) = x'yz'+ xyz'+ xyz
= x'yz'+ xyz' + xyz'+ xyz
= yz'+ (x +x') + xy(z+ z')
= yz'+ xy
What is the application of XOR GATE?
-
Solution
Truth table is
A B Y
0 0 0
1 1 1
1 0 1
1 1 0It gives output 0 if both signals are same and gives output 1 if both signals are different.
Consider the following gates :
1. NAND
2. NOR
3. EX-OR
4. EX-NOR
Which of the following can design any combinational circuit?
-
Solution
Any circuit can be designed using NAND and NOR gate.
If the input to the digital circuit (in the figure) consisting of a cascade of 19 X-NOR gates is A, the output will be
-
Solution
Output of gate 1 = 1\(\bigodot\)A
\(=1\bigodot A+\overline{1}\bigodot \overline{A}=A\)
Output of gate 2 = A\(\bigodot\)A=1
Output of gate 3 = 1\(\bigodot\)A=A
Output of gate 4 = A\(\bigodot\)A=1
∵Output of even numbered gate is 1
∴Output of gate 18 = 1
Output of gate 19 = 1\(\bigodot\)A=A
In the following expressions, AND and OR arithmetic operators are used.
(42 OR 72) AND 55
What is the value of expression ……..?
-
Solution
First convert all in binary
(42)10= (101010)2
(72)10= (1001000)2
(55)10= (110111)2
(42 OR 72) = (101010)2 OR (1001000)2= (1110010)2
(42 OR 72) AND 55 = (1110010)2 AND (110111)2
= (110010)2 = (50)10