DUET CSE 2011-2012 - Previous Year
Reading mode — untimed, no attempt is recorded1. (a) Find out the output from the given module of program. [নিম্নে C প্রোগ্রামিং এর একটি অংশ দেওয়া হল, অংশটি থেকে আউটপুট এর মান কি কি হবে বের কর?]
void main ()
{
int a, b, c, d;
a = 15;
b = 10;
c = ++a-b;
printf(“a=%d b=%d c=%d\n”, a, b, c);
d = b ++ + a;
printf(“a=%d b=%d d=%d\n”, a, b, d);
printf(“a/b=%d\n”, a%b);
printf(a%%b=%d\n”, a%b);
printf(“a*=b=%d\n”,a*=b);
printf(“%d\n”,(c>d)? 1:0);
printf(“%d\n”, (c<d)? 1;0);
}Printed program-এ string quotes নেই এবং শেষ ternary-তে colon-এর বদলে semicolon আছে; তাই মূল code compile হয় না। Quotes ও ternary ঠিক করলে, এবং source-এর a%b expression অপরিবর্তিত রাখলে:
a = 16 b = 10 c = 6
a = 16 b = 11 d = 26
a/b = 5
a%b = 5
a*=b = 176
0
1তৃতীয় line-এর label a/b হলেও calculation a%b; সত্যিই a/b করলে integer result 1।
1. (b) Write a program in C language to print the first 10 fibonacci number using recursion function. [রিকারসন ফাংশন ব্যবহার করে প্রথম 10 টি fibonacci number প্রিন্ট করার জন্য C ভাষায় একটি প্রোগ্রাম লিখ।]
#include <stdio.h>
unsigned int fib(unsigned int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
int main(void) {
for (unsigned int i = 0; i < 10; ++i)
printf("%u%c", fib(i), i == 9 ? '\n' : ' ');
return 0;
}Output: 0 1 1 2 3 5 8 13 21 34।
2. (a) What are the main features of OOP? [OOP এর প্রধান বৈশিষ্ট্যগুলো কি?]
- Encapsulation: data ও methods একই class-এ রাখা এবং access control।
- Abstraction: প্রয়োজনীয় interface প্রকাশ, implementation লুকানো।
- Inheritance: base class থেকে behaviour reuse/extend।
- Polymorphism: একই interface দিয়ে বিভিন্ন implementation।
Class, object এবং message/method call OOP-এর মৌলিক ধারণা।
(b) Distinguish between static binding and dynamic binding. [Static binding এবং dynamic binding এর মধ্যে পার্থক্য কর।]
| Static binding | Dynamic binding |
|---|---|
| Compile-time-এ function নির্বাচন | Run-time object type অনুযায়ী নির্বাচন |
| উদাহরণ: overload, non-virtual member | উদাহরণ: virtual function override |
| Declared type/argument type গুরুত্বপূর্ণ | Base reference/pointer দিয়ে derived virtual method call |
3. (a) Suppose A and B are sets and $|\text{A}| = 140$, $|\text{B}| = 90$.
(i) Find $|\text{A} \cup \text{B}|$ given that $|\text{A} \cap \text{B}| = 36$. (ii) Find $|\text{A} \cap \text{B}|$ given that $|\text{A} \cup \text{B}| = 150$.
[মনে কর, A ও B একটি সেট এবং $|\text{A}| = 140$, $|\text{B}| = 90$। (i) যদি $|\text{A} \cap \text{B}| = 36$ হয় তাহলে $|\text{A} \cup \text{B}|$ এর মান নির্ণয় কর। (ii) যদি $|\text{A} \cup \text{B}| = 150$ হয় তাহলে $|\text{A} \cap \text{B}|$ এর মান নির্ণয় কর।]
\[|A\cup B|=|A|+|B|-|A\cap B|\]
\[\text{(i)}\quad|A\cup B|=140+90-36=194\]
\[\text{(ii)}\quad|A\cap B|=140+90-150=80\]
3. (b) How many strings of three decimal digits are possible? If the string (i) do not contain the same digit three times (ii) begin with an odd digit (iii) have exactly three digits that are 9s. [তিন দশমিক সংখ্যার কতগুলো স্ট্রিং হবে যদি...]
(Top left text continues from the previous page's sub-questions)
[(i) একই অংক তিনবার না ধারণ করে (ii) বিজোড় অংক দ্বারা শুরু হয় (iii) তিনটি অংকেই 9 আছে।]
String-এ leading zero অনুমোদিত। প্রতিটি অবস্থানে 10টি digit।
\[N=10^3=1000\]
- তিন digit একই নয়: \(1000-10=990\)।
- Odd digit দিয়ে শুরু: \(5\times10\times10=500\)।
- ঠিক তিনটি 9 আছে: শুধু 999, অর্থাৎ 1টি।
4. (a) Which data structure is used to perform recursion and why? [কোন ডাটা স্ট্রাকচার রিকারশন সম্পন্ন করতে ব্যবহার করা হয় এবং কেন?]
Stack হলো LIFO data structure। Push top-এ যোগ করে, pop top থেকে সরায়। Recursion-এ প্রতিটি call-এর return address, arguments ও local context সংরক্ষিত হয়; সর্বশেষ call প্রথমে return করে।
push(10): [10]
push(20): [10, 20] <- top
pop(): returns 20; stack = [10]
4. (b) Compare link list with array. Give an algorithm for adding a new node at the end of single-linked-list. [লিংকড্ লিস্ট ও অ্যারের তুলনা কর। Single-linked-list এর শেষে একটি নতুন নোড যুক্ত করার অ্যালগরিদম লিখ।]
| Array | Singly linked list |
|---|---|
| Contiguous storage | Nodes pointer দিয়ে যুক্ত |
| Indexed access O(1) | Indexed access O(n) |
| Middle insertion O(n) | Known predecessor থাকলে insertion O(1) |
| কম per-element overhead | প্রতি node-এ next pointer লাগে |
append(head, value):
node = new Node(value, null)
if head == null: return node
current = head
while current.next != null:
current = current.next
current.next = node
return headTail pointer রাখলে append O(1), না থাকলে O(n)।
5. What is Weak Entity set? State the disadvantage of conventional file processing system. [Weak Entity set বলতে কি বুঝ? প্রচলিত File processing system এর অসুবিধাগুলো লিখ।]
Weak entity-এর নিজস্ব পূর্ণ key নেই; owner entity-এর key এবং partial key মিলে তাকে শনাক্ত করে। উদাহরণ: Employee(ID)-এর Dependent(Name), key = (ID, Name)।
- File system-এ data duplication ও inconsistency।
- Data isolation ও ad-hoc access কঠিন।
- Integrity ও security policy ছড়িয়ে থাকে।
- Concurrent update, atomicity ও recovery সামলানো কঠিন।
6. (a) What is software reuse? Mention the various aspects of software reuse. [সফটওয়্যার এর পুনঃব্যবহার বলতে কি বুঝ? সফটওয়্যার পুনঃব্যবহারের বিভিন্ন উপায়গুলো উল্লেখ কর।]
Software reuse হলো আগে তৈরি asset নতুন system-এ ব্যবহার করা।
- Code/function/library ও component reuse।
- Framework/service বা সম্পূর্ণ application reuse।
- Requirements, architecture/design pattern, test ও documentation reuse।
Reuse-এর আগে compatibility, quality, licensing ও maintenance যাচাই করতে হয়।
6. (b) Classify information system on the basis of implementation. Mention the five phases of system development tasks. [বাস্তবায়নের ভিত্তিতে ইনফরমেশন সিস্টেম এর শ্রেণীবিন্যাস কর। সিস্টেম উন্নয়ন কার্যনির্বাহে পাঁচটি পর্যায় উল্লেখ কর।]
Implementation অনুযায়ী information system manual, computer-based এবং hybrid হতে পারে। Computer-based system-এর কাজভিত্তিক শ্রেণি: TPS, MIS, DSS, EIS/ESS ও OAS।
- Planning ও feasibility
- Analysis
- Design
- Implementation ও testing
- Operation ও maintenance
7. (a) When does page fault occur? Describe the action taken by the operating system when a page fault occurs. [কখন পেজ ফল্ট সংঘটিত হয়? অপারেটিং সিস্টেমে গৃহীত কাজগুলির বর্ণনা দাও যখন একটি পেজ ফল্ট ঘটে।]
Process যে virtual page access করছে তার valid mapping থাকলেও page RAM-এ না থাকলে demand-paging page fault হয়। Invalid access-ও fault তুলতে পারে।
- CPU trap করে OS handler-এ যায়।
- OS address ও permission যাচাই করে; invalid হলে process-কে error দেয়।
- Free frame নেয় অথবা victim page নির্বাচন করে; dirty হলে backing store-এ লেখে।
- প্রয়োজনীয় page disk থেকে frame-এ আনে।
- Page table/TLB update করে interrupted instruction পুনরায় চালায়।
7. (b) What are sector and track of a disk?
[একটি ডিস্কের সেক্টর ও ট্র্যাক কি কি?]
Track হলো magnetic disk surface-এর concentric circular recording path। Sector হলো track-এর একটি subdivision, যেখানে নির্দিষ্ট পরিমাণ data রাখা হয়। একটি track-এ একাধিক sector থাকে।
8. (a) Mention the name of the flags of 8086 microprocessor.
[8086 মাইক্রোপ্রসেসরের ফ্ল্যাগগুলির নাম উল্লেখ কর।]
8086-এ একটি 16-bit FLAGS register আছে; এর 9টি flag সক্রিয়।
| Flag | কাজ |
|---|---|
| CF | Unsigned carry/borrow |
| PF | ফলাফলের নিচের 8 বিটে even parity |
| AF | Bit 3 থেকে bit 4-এ carry/borrow |
| ZF | ফলাফল শূন্য |
| SF | ফলাফলের sign bit |
| OF | Signed arithmetic overflow |
| TF | Single-step execution |
| IF | Maskable interrupt enable |
| DF | String operation-এর দিক: 0 হলে বৃদ্ধি, 1 হলে হ্রাস |
8. (a) Give examples of 8/16/32 bit microprocessor. Why is 8086 microprocessor called a 16 bit microprocessor?
[8/16/32 বিট মাইক্রোপ্রসেসরের উদাহরণ দাও। 8086 মাইক্রোপ্রসেসরকে 16-বিট মাইক্রোপ্রসেসর বলা হয় কেন?]
| Word size | উদাহরণ |
|---|---|
| 8-bit | Intel 8085 |
| 16-bit | Intel 8086 |
| 32-bit | Intel 80386 |
8086-এর ALU ও প্রধান general-purpose registers 16-bit; তাই এটি 16-bit processor। Address bus 20-bit হলেও processor word size 20-bit হয় না।
9. Differentiate between bit rate and baud rate. What are 10Base2, 10Base5 and 10BaseT Ethernet LANs?
[Bit rate এবং baud rate এর মধ্যে পার্থক্যগুলি লিখ। 10Base2, 10Base5 এবং 10BaseT Ethernet LAN বলতে কি বুঝ?]
Bit rate: প্রতি second-এ bit সংখ্যা। Baud rate: প্রতি second-এ symbol সংখ্যা।
\[R_b=R_s\log_2M\]
Mটি সমান bit-length-এর symbol থাকলে এই সম্পর্ক প্রযোজ্য।
| Standard | Media | Speed | Maximum segment |
|---|---|---|---|
| 10BASE2 | Thin coaxial | 10 Mbit/s | 185 m |
| 10BASE5 | Thick coaxial | 10 Mbit/s | 500 m |
| 10BASE-T | Twisted pair | 10 Mbit/s | 100 m |
10. What is propagation delay? Write the use of Infrared Communication.
[Propagation delay কাকে বলে? Infrared Communication এর ব্যবহার লিখ।]
\[t_p=d/v\]
Propagation delay হলো signal-এর medium ধরে sender থেকে receiver পর্যন্ত পৌঁছানোর সময়; d দূরত্ব, v propagation speed। এটি packet transmission time L/R থেকে আলাদা।
- Infrared remote control।
- স্বল্প দূরত্বের line-of-sight device communication।
- Optical sensing ও proximity detection।
11. Simplify the following Boolean expression: $Y = (\bar{A} + B)(A + B)$
[$Y = (\bar{A} + B)(A + B)$ বুলিয়ন সমীকরণকে সরলীকরণ কর।]
\[Y=(\bar A+B)(A+B)=B+\bar A A=\boxed B\]
12. (a) Draw an electronic circuit equivalent to NOT gate.
[NOT গেটের ফাংশন সম্পাদনকারী একটি সমতুল্য ইলেকট্রনিক সার্কিট অংকন কর।]
NPN transistor-এর emitter ground, collector load/resistor দিয়ে VCC-তে এবং base input resistor RB দিয়ে চালাও; output collector থেকে নাও।
| Input | State | Output |
|---|---|---|
| Low | Cutoff, IC ≈ 0 | High, VO ≈ VCC |
| High, যথেষ্ট base current | Saturation | Low, VO ≈ VCE(sat) |
\[R_B\approx\frac{V_{in,H}-0.7}{I_B}\]
Forced β দিয়ে যথেষ্ট base current বেছে নিতে হয়। এই circuit switching inverter/NOT gate হিসেবে কাজ করে; inductive load হলে flyback diode প্রয়োজন।
12. (b) The base current and the emitter current of a transistor are $0.08\text{ mA}$ and $9.6\text{ mA}$. Calculate $\alpha_{dc}$ and $\beta_{dc}$.
[একটি ট্রানজিস্টরের বেজ কারেন্ট 0.08 mA ও এমিটার কারেন্ট 9.6 mA হলে $\alpha_{dc}$ ও $\beta_{dc}$ এর মান বের কর।]
\[I_C=I_E-I_B=9.6-0.08=9.52\,\mathrm{mA}\]
\[\alpha_{dc}=\frac{I_C}{I_E}=\frac{9.52}{9.6}\approx0.9917,\qquad\beta_{dc}=\frac{I_C}{I_B}=\frac{9.52}{0.08}=119\]
13. Find (a) current flowing in branch AF and (b) voltage across branch CD from the circuit given below.
[নিম্নের সার্কিট হতে (a) AF ব্রাঞ্চের কারেন্ট ও (b) CD ব্রাঞ্চের ভোল্টেজ এর মান বের কর।]
(Circuit diagram showing a resistor network with a 24V source)
মূল চিত্র/ডেটা অসম্পূর্ণ: এই document-এ নির্ভরযোগ্য original circuit image ও সম্পূর্ণ সংযোগ নেই। তাই একক numerical answer নিশ্চিত করা যাচ্ছে না।
Supply voltage, labelled branches ও resistor connections নিশ্চিত করে node voltages বের করো।
\[I_{ij}=\frac{V_i-V_j}{R_{ij}},\qquad V_{CD}=V_C-V_D\]
Source solution-এ ধরে নেওয়া voltage বা branch numbering যাচাই ছাড়া numerical answer প্রকাশ করা হয়নি।
(i) How many times the program will print “Admission Test”? [নীচের প্রোগ্রামটি কতবার “Admission Test” প্রিন্ট করবে?]
# include <stdio.h>
int main ()
{
printf ("Admission Test");
main ();
return 0;
}- a. infinite times
- b. 32767 times
- c. 65535 times
- d. till stack doesn’t overflow
C-তে main recursion-এর base case নেই; বাস্তবে resource/stack exhaustion পর্যন্ত চলতে পারে। নির্দিষ্ট print count নিশ্চিত নয়; C++-এ main call অনুমোদিত নয়।
ii. int x = sizeof(!5.856). What will be the value of variable x? [int x = sizeof(!5.856) হলে x এর মান কত হবে?]
- 2
- 4
- 5
- 6
C-তে ! expression-এর type int, তাই sizeof(int), সাধারণত 4; standard নির্দিষ্ট byte count দেয় না। C++-এ result bool এবং sizeof(bool) implementation-dependent।
iii. 4 blue and 6 red marbles are in a jar. If you draw 2 marbles out of the jar, what is the probability that you get one of each color? [একটি জারে ৪ টি নীল ও ৬ টি লাল মার্বেল আছে। যদি তুমি উক্ত জার হতে ২ টি মার্বেল তোল তাহলে প্রত্যেকটি রঙ এর মার্বেল ওঠার সম্ভাবনা কত?]
- a. 4/15
- b. 1/8
- c. 8/15
- d. 1/24
\(P=\binom41\binom61/\binom{10}2=24/45=8/15\)।
iv. What is the 2’s compliment representation of -24 in a 16-bit microcomputer? [16-bit microcomputer এ -24 এর 2’s compliment কত হবে?]
- a. 4/15
- b. 1/8
- c. 1111 1111 1110 1000
- d. 1/24
24 = 0000 0000 0001 1000; invert + 1 = 1111 1111 1110 1000।
v. A 32 bit address bus allows access to memory of capacity ----- [একটি 32-বিট address bus এর মেমোরী ক্যাপাসিটি -----]
- a. 64 Mb
- b. 16 Mb
- c. 1 Gb
- d. 4 Gb
Byte-addressable হলে \(2^{32}\) bytes = 4 GiB; Gb নয়।
vi. Which relation is correct in case of transistor’s current gain? [ট্রানজিস্টরের কারেন্ট গেইন এর ক্ষেত্রে কোন সম্পর্কটি সত্য?]
- a. $\alpha = \beta / (1 + \beta)$
- b. $\alpha = \beta(1 + \beta)/\beta$
- c. $\alpha = \gamma / (1 + \gamma)$
- d. $\alpha = (1 + \gamma)/\gamma$
\(\alpha=I_C/I_E=\beta/(1+\beta)\)।
vii. The simplification of the Boolean expression $\overline{\overline{ABC} + \overline{ABC}}$ is: [$\overline{\overline{ABC} + \overline{ABC}}$ এর সরলীকরণ হচ্ছে : ]
- 0 ($\sqrt{}$
- 1
- A
- BC
প্রদত্ত expression অনুযায়ী \(\overline{\overline{ABC}+\overline{ABC}}=ABC\)। কোনো option মেলে না; source-এর পরের expression ভিন্ন।
viii. What is the equivalent resistance between terminal A and B of the following circuit? [নীচের সার্কিট A এবং B টারমিনালের সমতুল্য রেজিস্ট্যান্স কত হবে?] (Continuation of question viii from the previous page) (Circuit diagram showing terminals A and B connected to a bridge-like network of resistors with values $6\ \Omega$, $4\ \Omega$, $8\ \Omega$, and $2\ \Omega$, crossing between nodes C and D)
- $2\ \Omega$
- $6\ \Omega$
- $4\ \Omega$
- $8\ \Omega$
সঠিক resistor connection diagram অনুপস্থিত। শুধু resistor values থেকে equivalent resistance নিশ্চিত করা যায় না।
ix. FIFO scheduling is ----- [FIFO সিডিউলিং হলো -----]
- a. preemptive scheduling
- b. non preemptive scheduling
- c. deadline scheduling
- d. fair share scheduling
FCFS/FIFO CPU scheduling non-preemptive।
x. With an IP address of 201.142.23.12, what will be the default subnet mask? [[201.142.23.12 IP address – এর subnet mask কত হবে?]
- a. 0.0.0.0
- b. 255.0.0.0
- c. 255.255.0.0
- d. 255.255.255.0
পুরনো classful convention-এ 201.* Class C: 255.255.255.0।