Recent questions tagged goclasses-cs-dpp-day-300

2 2 votes
1 1 answer
198
198 views
A $4:2$ priority encoder has active-high inputs $\mathrm{D}_0,\mathrm{D}_1,\mathrm{D}_2,\mathrm{D}_3$, where $\mathrm{D}_3$ has the highest priority and $\mathrm{D}_0$ ha...
6 6 votes
2 2 answers
221
221 views
For a $4:2$ binary encoder with active-high inputs $\mathrm{I}_0,\mathrm{I}_1,\mathrm{I}_2,\mathrm{I}_3$ and outputs $\mathrm{Y}_1,\mathrm{Y}_0$, assume exactly one input...
4 4 votes
2 2 answers
200
200 views
A $1:4$ DEMUX has data input $\mathrm{D}$ and select lines $\mathrm{S}_1,\mathrm{S}_0$. Which of the following output equations is correct?$\mathrm{Y}_0=\mathrm{S}_1\math...
6 6 votes
2 2 answers
257
257 views
A $2:1$ MUX has inputs $\mathrm{I}_0,\mathrm{I}_1$, select line $\mathrm{S}$, and active-low enable input $\mathrm{E}$. When $\mathrm{E}=1$, the output is $0$. When $\mat...
3 3 votes
2 2 answers
240
240 views
8 8 votes
3 3 answers
391
391 views
What is the output of the following code?#include <stdio.h void update(int n, int *p) { if (n <= 0) return; *p = *p + n; update(n - 2, p); *p = *p + n; } int main() { int...
6 6 votes
2 2 answers
260
260 views
What is the output of the following code?#include <stdio.h int fun(int n) { if (n <= 0) return 1; if (n == 1) return 2; return fun(n - 1) + 2 * fun(n - 2); } int main() {...
6 6 votes
2 2 answers
331
331 views
What is the output of the following code?#include <stdio.h int fun(int n) { int x = n; if (n <= 0) return 0; x = x + 2; return x + fun(n - 2); } int main() { printf("%d",...
6 6 votes
2 2 answers
351
351 views
How many times is $\texttt{fun()}$ called when the following code is executed? (Count the first call also).#include <stdio.h int fun(int n) { if (n <= 1) return 1; return...
6 6 votes
3 3 answers
337
337 views
What is the output of the following code?#include <stdio.h int fun(int n) { if (n <= 1) return n + 1; if (n % 2 == 0) return fun(n - 1) + fun(n - 2); return fun(n - 2) + ...
To see more, click for the full list of questions or popular tags.