DUET CSE 2007-2008 - Previous Year
Reading mode — untimed, no attempt is recorded1. (a) Write a program in $\text{C/C}^{++}$ to calculate the summation of the following series. [নিম্নলিখিত ধারাটির যোগফল নির্ণয়ের জন্য একটি $\text{C/C}^{++}$ প্রোগ্রাম লিখ। $1^2+2^2+3^2+\dots\dots\dots\dots\dots+n^2$]
\[\sum_{k=1}^n k^2=\frac{n(n+1)(2n+1)}6\]
#include <stdio.h>
int main(void) {
long long n, sum = 0;
if (scanf("%lld", &n) != 1 || n < 0 || n > 1000000) return 1;
for (long long i = 1; i <= n; ++i) sum += i * i;
printf("%lld\n", sum);
return 0;
}
1. (b) What is inheritance? Give its real world example. [ইনহেরিটেন্স কি? ইহার একটি বাস্তব উদাহরণ দাও ।] (05)
Inheritance-এ derived class base class-এর accessible data ও behaviour পুনর্ব্যবহার করে এবং নতুন behaviour যোগ করতে পারে। উদাহরণ: Vehicle থেকে Car ও Bus।
#include <iostream>
class Vehicle {
public:
void start() const { std::cout << "Started\n"; }
};
class Car : public Vehicle {
public:
void drive() const { std::cout << "Driving\n"; }
};
int main() { Car c; c.start(); c.drive(); }
2. (a) Use a truth table to verify the equivalence $\neg(p \wedge q) \Leftrightarrow \neg(p \vee \neg q)$. [$\neg(p \wedge q) \Leftrightarrow \neg(p \vee \neg q)$ সমীকরণটি ইকুইভ্যালেন্স কিনা তাহা ট্রুথ টেবিলের মাধ্যমে দেখাও ।]
| p | q | NOT(p AND q) | NOT(p OR NOT q) |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 0 |
| 1 | 1 | 0 | 0 |
দুই column এক নয়। প্রশ্নে লেখা equivalence ভুল; De Morgan-এর সঠিক সূত্র:
\[\neg(p\land q)\equiv\neg p\lor\neg q\]
2. (b) Represent the following graph by a matrix. [নিম্নলিখিত গ্রাফটিকে একটি ম্যাট্রিক্স এর সাহায্যে প্রকাশ কর ।] (08)
Original graph image নেই, তাই তার নির্দিষ্ট adjacency matrix যাচাই করা যায় না। Vertex order v1,…,vn নিলে:
\[a_{ij}=\begin{cases}1,&v_i\to v_j\text{ edge থাকলে}\\0,&\text{অন্যথায়}\end{cases}\]
Undirected graph-এ matrix symmetric। Self-loop থাকলে diagonal entry 1। Original graph ছাড়া source-এর matrix-কে নিশ্চিত উত্তর বলা যাবে না।
3. (a) What is mean by the data structure? Montion the data structure operations [ডাটা স্ট্রাকচার বলতে কি বুঝায়? ডাটা স্ট্রাকচারের অপারেশন সমূহ উল্লেখ কর ।]
| Operation | কাজ |
|---|---|
| Traversal | সব element visit |
| Insertion | নতুন element যোগ |
| Deletion | Element বাদ |
| Search | নির্দিষ্ট element খোঁজা |
| Sort | নির্দিষ্ট order-এ সাজানো |
| Merge | দুই structure combine |
3. (b) Define stack and queue with examples [উদাহরণসহ স্ট্যাক ও কিউ এর সংজ্ঞা দাও।] (08)
| Stack | Queue |
|---|---|
| LIFO: last in, first out | FIFO: first in, first out |
| Push/pop একই top-এ | Enqueue rear-এ, dequeue front-এ |
| উদাহরণ: call stack, undo | উদাহরণ: print queue, BFS |
4. (a) What is meant by the data abstraction? Mention the levels of Data abstraction. (ডাটা এবস্ট্রাকশন বলতে কি বুঝায়? ডাটা এবস্ট্রাকশনের বিভিন্ন স্তরগুলো উল্লেখ কর। (06)
Data abstraction ব্যবহারকারীকে অপ্রয়োজনীয় storage details থেকে আলাদা রাখে।
| Level | অর্থ |
|---|---|
| Physical | ডেটা কীভাবে disk-এ সংরক্ষিত |
| Logical | কোন data, structure ও relationship আছে |
| View/external | নির্দিষ্ট ব্যবহারকারীর দেখা অংশ |
4. (b) What are the different data models of database system? [ডাটাবেস সিস্টেমে কি কি রকম ডাটা মডেল আছে?]
- Relational model: tables, rows, columns।
- Hierarchical model: parent-child tree।
- Network model: record এবং multiple links।
- Entity-relationship model: conceptual entities ও relationships।
- Object-oriented model: objects ও classes।
- Object-relational model: relational-এর সঙ্গে object features।
5. Define DBMS, Mention the advantages and disadvantage of DBMS over conventional file processing. [DBMS এর সংজ্ঞা লিখ। প্রচলিত ফাইল প্রসেসিং এর তুলনায় DMBS এর সুবিধা ও অসুবিধাগুলি লিখ।] (10)
DBMS হলো database সংজ্ঞা, সংরক্ষণ, query ও পরিবর্তন করার software; এটি integrity, access control, transactions এবং recovery পরিচালনা করে।
- নিয়ন্ত্রিত redundancy ও consistency।
- Constraints দিয়ে data integrity।
- Authorization ও access control।
- Transactions ও concurrent access।
- Backup এবং crash recovery।
- Data independence ও SQL query।
অসুবিধা: software/hardware ও administration খরচ, complexity, migration effort এবং central service failure-এর প্রভাব।
6 (a): System Analysis ও ডিজাইন বলতে কি বোঝ? Analysis ছাড়া কি সিস্টেম ডিজাইনের কাজ কি শুরু করা যায়?
System analysis হলো বর্তমান system, problem ও user requirements পরীক্ষা করে নতুন system কী করবে তা নির্ধারণ করা।
- Stakeholder interview ও observation।
- Existing process ও data flow পর্যালোচনা।
- Functional/non-functional requirements সংগ্রহ।
- Model, validate ও prioritise requirements।
- Requirements specification প্রস্তুত।
Design নির্ধারণ করে system কীভাবে তৈরি হবে; analysis মূলত কী দরকার তা নির্ধারণ করে।
6 (b). Describe the steps in Feasibility Analysis. [ফিজিবিলিটি এনালাইসিস এর ধাপ গুলো বর্ণনা কর।] (10)
- Problem ও scope নির্ধারণ।
- Alternative solution চিহ্নিত করা।
- Technical feasibility যাচাই।
- Economic cost-benefit analysis।
- Operational, legal ও schedule feasibility যাচাই।
- Risk তুলনা করে recommendation ও feasibility report তৈরি।
8. What do you mean by a process of an operating system? What are the states of a process? [একটি অপারেটিং সিস্টেমের প্রসেস বলতে কি বুঝায়? একটি প্রসেসের স্টেটগুলি কি কি?] (13)
Process হলো execution-এ থাকা program।
| State | অর্থ |
|---|---|
| New | তৈরি হচ্ছে |
| Ready | CPU পাওয়ার অপেক্ষা |
| Running | CPU-তে চলছে |
| Waiting/blocked | I/O/event-এর অপেক্ষা |
| Terminated | Execution শেষ |
প্রধান transition: New → Ready → Running; Running → Ready (preemption), Running → Waiting (I/O), Waiting → Ready (event complete), Running → Terminated।
9. Explain briefly the causes of deadlock in the operating system? (অপারেটিং সিস্টেমের ডেড লক এর কারণগুলি সংক্ষেপে বর্ণনা কর।) (13)
Deadlock-এ processes একে অন্যের held resource-এর জন্য অনির্দিষ্টকাল অপেক্ষা করে। প্রয়োজনীয় চারটি Coffman condition:
- Mutual exclusion
- Hold and wait
- No preemption
- Circular wait
উদাহরণ: P1 R1 ধরে R2 চায়, P2 R2 ধরে R1 চায়। শর্তগুলোর অন্তত একটি প্রতিরোধ করে deadlock prevention করা যায়।
10. (a) How many address lines are required to address a 1 Tera memory locations? [1 Tera memory locations কে address করার জন্য কতটি এড্রেস লাইন প্রয়োজন হয়।] (03)
\[n=\lceil\log_2N\rceil=\boxed{40}\]
Binary অর্থে 1 tera location = 2^40। Decimal 10^12 location ধরলেও ceiling(log2 N) = 40।
10. (b) Classify the instruction set of microprocessors? [মাইক্রোপ্রসেসরের ইন্সট্রাকশন সেট এর শ্রেণি বিন্যাস কর।] (03)
| Class | 8085 example |
|---|---|
| Data transfer | MOV, MVI, LDA |
| Arithmetic | ADD, SUB, INR |
| Logical | ANA, ORA, XRA, CMP |
| Branch | JMP, JZ, CALL, RET |
| Stack, I/O ও machine control | PUSH, POP, IN, OUT, HLT |
10. (c) What types of registers are used in 8085? (৮০৮৫ এ কি কি রকম রেজিস্টার ব্যবহার করা হয়।)
- Accumulator A।
- General-purpose B, C, D, E, H, L; BC, DE, HL pairs হিসেবে ব্যবহারযোগ্য।
- Flag register: S, Z, AC, P, CY।
- 16-bit program counter (PC) এবং stack pointer (SP)।
- Internal instruction register ও temporary registers।
11. (a) Write the basic features and components of Data Communication. (ডাটা কমিউনিকেশনের মৌলিক বৈশিষ্ট্য ও উপাদানগুলো লিখ) (06)
Components: sender, receiver, message, transmission medium এবং protocol।
| Feature | অর্থ |
|---|---|
| Delivery | সঠিক destination-এ পৌঁছানো |
| Accuracy | Error ছাড়া data পাওয়া |
| Timeliness | প্রয়োজনীয় সময়ের মধ্যে পৌঁছানো |
| Jitter | Packet arrival delay-এর variation কম থাকা |
11. (b) What do you mean by the digital to analog modulation? Name its different types [digital to analog modulation বলতে কি বুঝ? উহার বিভিন্ন প্রকার নামগুলি লিখ।] (06)
Digital data অনুযায়ী analog carrier-এর amplitude, frequency বা phase পরিবর্তন করাকে digital-to-analog modulation বলে।
- ASK: amplitude shift keying।
- FSK: frequency shift keying।
- PSK: phase shift keying।
- QAM: amplitude ও phase একসঙ্গে পরিবর্তন।
12. (a) Classify computer networks. [কম্পিউটার নেটওয়ার্কের শ্রেণিবিন্যাস কর] (05)
| Network | পরিসর | সাধারণ বৈশিষ্ট্য |
|---|---|---|
| LAN | Room/building/campus | সীমিত area, সাধারণত এক প্রতিষ্ঠানের নিয়ন্ত্রণ |
| MAN | City/metropolitan area | একাধিক LAN সংযোগ |
| WAN | Region/country/world | দূরবর্তী network যুক্ত; carrier infrastructure ব্যবহার হতে পারে |
12. (b) What are the problems of TCP/IP model? What types of protocols are used in TCP/IP model [TCP/IP মডেল এর কি কি সমস্যা আছে? TCP/IP মডেলে কি কি ধরনের protocols ব্যবহার করা হয়?] (07)
| TCP/IP layer | Protocols/technology |
|---|---|
| Application | HTTP, DNS, SMTP, FTP |
| Transport | TCP, UDP |
| Internet | IP, ICMP |
| Link/network access | Ethernet, Wi-Fi |
Model-এর সীমা: session/presentation আলাদা layer নয়; physical ও data-link বিস্তারিত link layer-এ মিশে থাকে; service/interface/protocol separation OSI-এর মতো স্পষ্ট নয়। Security নিজে model-এর guarantee নয়, TLS/IPsec-এর মতো ব্যবস্থা প্রয়োজন।
13. (a) Using Boolean algebraic techniques, simplify the following expression (Boolean এলজাবরা ব্যবহার করে করে নিম্নে সমীকরণকে সরলীকরণ কর।) (07)
Source solution-এর প্রথম line-এ দেওয়া expression ব্যবহার করলে:
\[Y=AB\bar C\bar D+\bar AB\bar C\bar D+\bar ABC\bar D+ABC\bar D\]
\[=B\bar D(A+\bar A)(C+\bar C)=\boxed{B\bar D}\]
পরে source-এ D-এর bar বদলে দেওয়া হয়েছে, তাই printed B(A XOR D) এই expression-এর উত্তর নয়। মূল expression আলাদা হলে original scan প্রয়োজন।
13. (b) Draw the circuit and truth table of a 4$\times$1 multiplexer (একটি 4$\times$1 মাল্টিপ্লেক্সারের লজিক সার্কিট ও ট্রুথ টেবিল আঁকা।)
Decoder n-bit code অনুযায়ী সর্বোচ্চ 2^n output-এর একটি activate করে। 4:1 MUX চার input থেকে select bits অনুযায়ী একটি বেছে নেয়।
\[Y=I_0\bar S_1\bar S_0+I_1\bar S_1S_0+I_2S_1\bar S_0+I_3S_1S_0\]
| S1 | S0 | Y |
|---|---|---|
| 0 | 0 | I0 |
| 0 | 1 | I1 |
| 1 | 0 | I2 |
| 1 | 1 | I3 |
দুটি select inverter, চারটি 3-input AND এবং একটি 4-input OR দিয়ে gate circuit তৈরি হয়।
14. Draw a logic circuit for CMOS NAND gate and write the advantages of using CMOS [CMOS NAND গেট এর জন্য একটি লজিক সার্কিট অংকন কর এবং CMOS ব্যবহারের সুবিধা লিখ] (14)
CMOS NAND-এ দুই pMOS VDD থেকে output-এর মধ্যে parallel এবং দুই nMOS output থেকে ground-এর মধ্যে series। A প্রতিটি network-এর একটি gate, B অন্যটি drive করে।
\[Y=\overline{AB}\]
A = B = 1 হলে nMOS path ON, pMOS OFF, output 0। অন্য সব অবস্থায় অন্তত একটি pMOS ON ও series nMOS path broken, output 1। সুবিধা: কম static power, বড় noise margin, high integration density; switching-এ dynamic power লাগে।
15. There are four electric lamp for 60 W each and three fans for 50 W each in a hour. It each of the lamps and fans are used for 6 hours daily on the average. What will be the electric cost of the house in the month of February, 2009, Given the unit price is 3.15 Tk [একটি বাড়ীতে 60 W এর চারটি বাতি এবং 50 W এর তিনটি পাখা আছে। বাতি এবং পাখাগুলি দৈনিক গড়ে ছয় ঘন্টা করে ব্যবহার হলে 2009 সালের ফেব্রুয়ারী মাসে বৈদ্যুতিক খরচ কত হবে? দেওয়া আছে, প্রতি ইউনিটের মূল্য 3.15 টাকা।] (14)
\[P=4(60)+3(50)=390\,\mathrm W=0.39\,\mathrm{kW}\]
\[E=0.39(6)(28)=65.52\,\mathrm{kWh}\]
\[\text{Cost}=65.52(3.15)=\boxed{206.388\text{ Tk}}\approx206.39\text{ Tk}\]
February 2009-এ 28 দিন। প্রশ্নে দেওয়া rate ব্যবহার করা হয়েছে; অন্য charge ধরা হয়নি।