Your next chapter starts hereExplore admission guide

DUET CSE 2007-2008 - Previous Year

Reading mode — untimed, no attempt is recorded
Back
Question 1a Programming

1. (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$]

Solution

\[\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;
}
Question 1b Programming

1. (b) What is inheritance? Give its real world example. [ইনহেরিটেন্স কি? ইহার একটি বাস্তব উদাহরণ দাও ।] (05)

Solution

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(); }
Question 2a Historical: Discrete Mathematics

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)$ সমীকরণটি ইকুইভ্যালেন্স কিনা তাহা ট্রুথ টেবিলের মাধ্যমে দেখাও ।]

Solution
pqNOT(p AND q)NOT(p OR NOT q)
0010
0111
1010
1100

দুই column এক নয়। প্রশ্নে লেখা equivalence ভুল; De Morgan-এর সঠিক সূত্র:

\[\neg(p\land q)\equiv\neg p\lor\neg q\]

Question 2b Data Structure Incomplete source data

2. (b) Represent the following graph by a matrix. [নিম্নলিখিত গ্রাফটিকে একটি ম্যাট্রিক্স এর সাহায্যে প্রকাশ কর ।] (08)

Solution

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-কে নিশ্চিত উত্তর বলা যাবে না।

Question 3a Data Structure

3. (a) What is mean by the data structure? Montion the data structure operations [ডাটা স্ট্রাকচার বলতে কি বুঝায়? ডাটা স্ট্রাকচারের অপারেশন সমূহ উল্লেখ কর ।]

Solution
Operationকাজ
Traversalসব element visit
Insertionনতুন element যোগ
DeletionElement বাদ
Searchনির্দিষ্ট element খোঁজা
Sortনির্দিষ্ট order-এ সাজানো
Mergeদুই structure combine
Question 3b Data Structure

3. (b) Define stack and queue with examples [উদাহরণসহ স্ট্যাক ও কিউ এর সংজ্ঞা দাও।] (08)

Solution
StackQueue
LIFO: last in, first outFIFO: first in, first out
Push/pop একই top-এEnqueue rear-এ, dequeue front-এ
উদাহরণ: call stack, undoউদাহরণ: print queue, BFS
Question 4a Database Management

4. (a) What is meant by the data abstraction? Mention the levels of Data abstraction. (ডাটা এবস্ট্রাকশন বলতে কি বুঝায়? ডাটা এবস্ট্রাকশনের বিভিন্ন স্তরগুলো উল্লেখ কর। (06)

Solution

Data abstraction ব্যবহারকারীকে অপ্রয়োজনীয় storage details থেকে আলাদা রাখে।

Levelঅর্থ
Physicalডেটা কীভাবে disk-এ সংরক্ষিত
Logicalকোন data, structure ও relationship আছে
View/externalনির্দিষ্ট ব্যবহারকারীর দেখা অংশ
Question 4b Database Management

4. (b) What are the different data models of database system? [ডাটাবেস সিস্টেমে কি কি রকম ডাটা মডেল আছে?]

Solution
  1. Relational model: tables, rows, columns।
  2. Hierarchical model: parent-child tree।
  3. Network model: record এবং multiple links।
  4. Entity-relationship model: conceptual entities ও relationships।
  5. Object-oriented model: objects ও classes।
  6. Object-relational model: relational-এর সঙ্গে object features।
Question 5 Database Management

5. Define DBMS, Mention the advantages and disadvantage of DBMS over conventional file processing. [DBMS এর সংজ্ঞা লিখ। প্রচলিত ফাইল প্রসেসিং এর তুলনায় DMBS এর সুবিধা ও অসুবিধাগুলি লিখ।] (10)

Solution

DBMS হলো database সংজ্ঞা, সংরক্ষণ, query ও পরিবর্তন করার software; এটি integrity, access control, transactions এবং recovery পরিচালনা করে।

  1. নিয়ন্ত্রিত redundancy ও consistency।
  2. Constraints দিয়ে data integrity।
  3. Authorization ও access control।
  4. Transactions ও concurrent access।
  5. Backup এবং crash recovery।
  6. Data independence ও SQL query।

অসুবিধা: software/hardware ও administration খরচ, complexity, migration effort এবং central service failure-এর প্রভাব।

Question 6a Historical: Software Development

6 (a): System Analysis ও ডিজাইন বলতে কি বোঝ? Analysis ছাড়া কি সিস্টেম ডিজাইনের কাজ কি শুরু করা যায়?

Solution

System analysis হলো বর্তমান system, problem ও user requirements পরীক্ষা করে নতুন system কী করবে তা নির্ধারণ করা।

  1. Stakeholder interview ও observation।
  2. Existing process ও data flow পর্যালোচনা।
  3. Functional/non-functional requirements সংগ্রহ।
  4. Model, validate ও prioritise requirements।
  5. Requirements specification প্রস্তুত।

Design নির্ধারণ করে system কীভাবে তৈরি হবে; analysis মূলত কী দরকার তা নির্ধারণ করে।

Question 6b Historical: Software Development

6 (b). Describe the steps in Feasibility Analysis. [ফিজিবিলিটি এনালাইসিস এর ধাপ গুলো বর্ণনা কর।] (10)

Solution
  1. Problem ও scope নির্ধারণ।
  2. Alternative solution চিহ্নিত করা।
  3. Technical feasibility যাচাই।
  4. Economic cost-benefit analysis।
  5. Operational, legal ও schedule feasibility যাচাই।
  6. Risk তুলনা করে recommendation ও feasibility report তৈরি।
Question 8 Operating System

8. What do you mean by a process of an operating system? What are the states of a process? [একটি অপারেটিং সিস্টেমের প্রসেস বলতে কি বুঝায়? একটি প্রসেসের স্টেটগুলি কি কি?] (13)

Solution

Process হলো execution-এ থাকা program।

Stateঅর্থ
Newতৈরি হচ্ছে
ReadyCPU পাওয়ার অপেক্ষা
RunningCPU-তে চলছে
Waiting/blockedI/O/event-এর অপেক্ষা
TerminatedExecution শেষ

প্রধান transition: New → Ready → Running; Running → Ready (preemption), Running → Waiting (I/O), Waiting → Ready (event complete), Running → Terminated।

Question 9 Operating System

9. Explain briefly the causes of deadlock in the operating system? (অপারেটিং সিস্টেমের ডেড লক এর কারণগুলি সংক্ষেপে বর্ণনা কর।) (13)

Solution

Deadlock-এ processes একে অন্যের held resource-এর জন্য অনির্দিষ্টকাল অপেক্ষা করে। প্রয়োজনীয় চারটি Coffman condition:

  1. Mutual exclusion
  2. Hold and wait
  3. No preemption
  4. Circular wait

উদাহরণ: P1 R1 ধরে R2 চায়, P2 R2 ধরে R1 চায়। শর্তগুলোর অন্তত একটি প্রতিরোধ করে deadlock prevention করা যায়।

Question 10a Microprocessor & Microcomputer

10. (a) How many address lines are required to address a 1 Tera memory locations? [1 Tera memory locations কে address করার জন্য কতটি এড্রেস লাইন প্রয়োজন হয়।] (03)

Solution

\[n=\lceil\log_2N\rceil=\boxed{40}\]

Binary অর্থে 1 tera location = 2^40। Decimal 10^12 location ধরলেও ceiling(log2 N) = 40।

Question 10b Microprocessor & Microcomputer

10. (b) Classify the instruction set of microprocessors? [মাইক্রোপ্রসেসরের ইন্সট্রাকশন সেট এর শ্রেণি বিন্যাস কর।] (03)

Solution
Class8085 example
Data transferMOV, MVI, LDA
ArithmeticADD, SUB, INR
LogicalANA, ORA, XRA, CMP
BranchJMP, JZ, CALL, RET
Stack, I/O ও machine controlPUSH, POP, IN, OUT, HLT
Question 10c Microprocessor & Microcomputer

10. (c) What types of registers are used in 8085? (৮০৮৫ এ কি কি রকম রেজিস্টার ব্যবহার করা হয়।)

Solution
  1. Accumulator A।
  2. General-purpose B, C, D, E, H, L; BC, DE, HL pairs হিসেবে ব্যবহারযোগ্য।
  3. Flag register: S, Z, AC, P, CY।
  4. 16-bit program counter (PC) এবং stack pointer (SP)।
  5. Internal instruction register ও temporary registers।
Question 11a Data Communication & Computer Network

11. (a) Write the basic features and components of Data Communication. (ডাটা কমিউনিকেশনের মৌলিক বৈশিষ্ট্য ও উপাদানগুলো লিখ) (06)

Solution

Components: sender, receiver, message, transmission medium এবং protocol।

Featureঅর্থ
Deliveryসঠিক destination-এ পৌঁছানো
AccuracyError ছাড়া data পাওয়া
Timelinessপ্রয়োজনীয় সময়ের মধ্যে পৌঁছানো
JitterPacket arrival delay-এর variation কম থাকা
Question 11b Data Communication & Computer Network

11. (b) What do you mean by the digital to analog modulation? Name its different types [digital to analog modulation বলতে কি বুঝ? উহার বিভিন্ন প্রকার নামগুলি লিখ।] (06)

Solution

Digital data অনুযায়ী analog carrier-এর amplitude, frequency বা phase পরিবর্তন করাকে digital-to-analog modulation বলে।

  1. ASK: amplitude shift keying।
  2. FSK: frequency shift keying।
  3. PSK: phase shift keying।
  4. QAM: amplitude ও phase একসঙ্গে পরিবর্তন।
Question 12a Data Communication & Computer Network

12. (a) Classify computer networks. [কম্পিউটার নেটওয়ার্কের শ্রেণিবিন্যাস কর] (05)

Solution
Networkপরিসরসাধারণ বৈশিষ্ট্য
LANRoom/building/campusসীমিত area, সাধারণত এক প্রতিষ্ঠানের নিয়ন্ত্রণ
MANCity/metropolitan areaএকাধিক LAN সংযোগ
WANRegion/country/worldদূরবর্তী network যুক্ত; carrier infrastructure ব্যবহার হতে পারে
Question 12b Data Communication & Computer Network

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)

Solution
TCP/IP layerProtocols/technology
ApplicationHTTP, DNS, SMTP, FTP
TransportTCP, UDP
InternetIP, ICMP
Link/network accessEthernet, Wi-Fi

Model-এর সীমা: session/presentation আলাদা layer নয়; physical ও data-link বিস্তারিত link layer-এ মিশে থাকে; service/interface/protocol separation OSI-এর মতো স্পষ্ট নয়। Security নিজে model-এর guarantee নয়, TLS/IPsec-এর মতো ব্যবস্থা প্রয়োজন।

Question 13a Digital Electronics Source ambiguity: see solution note

13. (a) Using Boolean algebraic techniques, simplify the following expression (Boolean এলজাবরা ব্যবহার করে করে নিম্নে সমীকরণকে সরলীকরণ কর।) (07)

Solution

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 প্রয়োজন।

Question 13b Digital Electronics

13. (b) Draw the circuit and truth table of a 4$\times$1 multiplexer (একটি 4$\times$1 মাল্টিপ্লেক্সারের লজিক সার্কিট ও ট্রুথ টেবিল আঁকা।)

Solution

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\]

S1S0Y
00I0
01I1
10I2
11I3

দুটি select inverter, চারটি 3-input AND এবং একটি 4-input OR দিয়ে gate circuit তৈরি হয়।

mux 4 to 1
Question 14 Digital Electronics

14. Draw a logic circuit for CMOS NAND gate and write the advantages of using CMOS [CMOS NAND গেট এর জন্য একটি লজিক সার্কিট অংকন কর এবং CMOS ব্যবহারের সুবিধা লিখ] (14)

Solution

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 লাগে।

cmos nand
Question 15 Basic Electricity

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)

Solution

\[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 ধরা হয়নি।