You are on page 1of 14

What is the importance of having

a hierarchy of memory instead of


a single memory in the
computer architecture?
What is the importance of having
a hierarchy of memory instead of
a single memory in the
computer architecture?
1. What is the importance of having a hierarchy of memory instead of a single memory in the
computer architecture? decrease the bit cost, access frequency, and to increase the capacity,
access time.
2. What is Microprogramming? What are the advantages and drawbacks of
microprogramming compared to hardwired programming? Microprogramming a general
sequential circuit.
Advantage: making change to a hardwired control unit implies global change, that is, the
circuit will be almost totally changed.
it is costly and time consuming. In contrary, for a microprogrammed control unit,
making change to it is just changing the microprogram, the bit pattern in the micro
memory.
Microprograming advantage
 More flexible to accommodate with new instructions.
 Easier decoding and sequencing can be done.
 Easier to handle complex instruction sets.
 It requires a less chip area.

Disadvantage
Microprogram relies on fast micro memory. It requires high speed memory.
3. Explain briefly how the buses are used for the communication between several components
of a computer (Example: CPU and memory) The bus provides a communication path for the
data and control signals moving between the major components of the computer system. bus is a
high-speed internal connection. Buses are used to send control signals and data between the
processor and other components. Address bus – carries memory addresses from the processor to
other components such as primary storage and input/output devices. The address bus is
unidirectional
1.1 MACHINE LANGUAGE Any computer can directly understand its own machine language. Machine
language is the “natural language” of a computer and such is defined by its hardware design. Machine
languages generally consist of strings of numbers (ultimately reduced to 1s and 0s) that instruct
computers to perform their most elementary operations one at a time
4. a. Define a recursive function.[1 points] public class RecursionExample3 {
static int factorial(int n){
if (n == 1)
return 1;
else
return(n * factorial(n-1));
}
public static void main(String[] args) {
System.out.println("Factorial of 5 is: "+factorial(5));
}}
5. Write a recursive function that computes the greatest common divisor (GCD/HCF) of two
positive integers. [5 points
6. #include <iostream>
7. using namespace std;
8.
9. int main() {
10. int n1, n2, hcf;
11. cout << "Enter two numbers: ";
12. cin >> n1 >> n2;
13.
14. // swapping variables n1 and n2 if n2 is greater than n1.
15. if ( n2 > n1) {
16. int temp = n2;
17. n2 = n1;
18. n1 = temp;
19. }
20.
21. for (int i = 1; i <= n2; ++i) {
22. if (n1 % i == 0 && n2 % i ==0) {
23. hcf = i;
24. }
25. }
26.
27. cout << "HCF = " << hcf;
28.
29. return 0;
30. }

6. Write a function that accepts a positive integer and displays the digits of the number in reverse
order.[3 points]

#include <iostream>
using namespace std;
int main() {

int n, reversed_number = 0, remainder;

cout << "Enter an integer: ";


cin >> n;

while(n != 0) {
remainder = n % 10;
reversed_number = reversed_number * 10 + remainder;
n /= 10;
}

cout << "Reversed Number = " << reversed_number;

return 0;
}

7. Write a detailed algorithm of quick sort algorithm.[

 Step 1 - Consider the first element of the list as pivot (i.e., Element at first position in the list).
 Step 2 - Define two variables i and j. Set i and j to first and last elements of the list respectively.
 Step 3 - Increment i until list[i] > pivot then stop.
 Step 4 - Decrement j until list[j] < pivot then stop.
 Step 5 - If i < j then exchange list[i] and list[j].
 Step 6 - Repeat steps 3,4 & 5 until i > j.
 Step 7 - Exchange the pivot element with list[j] element

8. a. Define Formal Software Specification. (1 pt.)

What is formal software specification?


A formal software specification is a statement expressed in a language whose vocabulary, syntax, and
semantics are formally defined
9. Though the idea of Formal Specification to software is novel, it is not widely used in the software
industry. Describe the reasons behind this. So/n these methods are considered costly and unfeasible.
10. a. Define software system design.
System design is the process of designing the elements of a system such as the architecture, modules and
components, the different interfaces of those components and the data that goes through that system.
11. Compare and contrast function-oriented and object-oriented design methods.
12. What are the three most important design goals during the design of an interactive system which is to
be used by non-computer literate users?
1.Easy to learn
2. Easy to use
3. Memorable
13, a. Define regression testing. Regression Testing is defined as a type of software testing to confirm
that a recent program or code change has not adversely affected existing features.
14, b. How are test cases generated during regression testing? (2 pts.)
1. Select test cases with frequent defects:
2. Choose test cases with critical functionalities:
3. Select test cases with frequent code changes:
4. Cover end-to-end test flows:
5. Cover field validation test cases:
6. Select a risk-based testing approach:
15. c. What coverage criteria shall be used for regression testing? (2 pts.)
Entry criteria may include that all software changes have passed unit testing, a green build has passed
smoke and sanity testing, and the regression test suite is prepared.
16. Why is indexing very important in databases?
Indexes are used to quickly locate data without having to search every row in a database table every
time a database table is accessed.
CREATE INDEX index_name
ON table_name (column1, column2, ...);
View
CREATE VIEW view_name AS
SELECT column1, column2, ...
FROM table_name
WHERE condition;
Purpose of view
Restrict data and summarize data
17 Explain why a time-sharing operating system is not suitable for applications with hard real time
requirements.
The main difference between time sharing and the real-time operating system is that, In time sharing
OS, the response is provided to the user within a second. While in real time OS, the response is
provided to the user within time constraint.

In a distributed system, there's no shared memory, so the entire nature of inter


process communication must be completely rethought from scratch.
Describe the advantages and the
disadvantages of fiber optics
cable compared to copper cables
for computer communications?
Describe the advantages and the disadvantages of fiber optics cable compared to copper
cables for computer communications? The bandwidth provided by a copper cable is less than
that of the fiber optics. The crucial difference between copper cable and fiber optics is that
copper cable transmits signal in the form of electrical pulses while fiber optics possess signal
transmission in the form of light pulses.
2. (2 points) Explain what Ethernet is? How it solves the collision problem?

2. (2 points) Explain what


Ethernet is? How it solves the
collision problem?
On Ethernet using shared media, collisions are resolved using carrier-sense multiple access with
collision detection (CSMA/CD) in which the competing packets are discarded and re-sent one at a
time.
Connection-oriented service involves the creation and termination of the connection for sending the data
between two or more devices. In contrast, connectionless service does not require establishing any
connection and termination process for transferring the data over a network.

4. (2 points) Explain the


fundamental differences between
a hub and a switch.
4. (2 points) Explain the fundamental differences between a hub and a switch.
There is only one collision domain in a Hub. In a Switch, each port has its own collision domain.
1.1 Discuss briefly software process, project and product. (6 points)
A software process is the set of activities and associated outcome that produce a software product.

1.2 a. Define coupling and


cohesion. (2 points)
1.1 Discuss briefly software
process, project and product.
(6 points)
1.2 a. Define coupling and cohesion. (2 points)
Coupling refers to the interdependencies between modules, while cohesion describes how related
the functions within a single module are.
Cohesion is the concept of intra-module. Coupling is the concept of inter-module.
Increasing cohesion is good for software. Increasing coupling is avoided for software.
Cohesion represents the functional strength Coupling represents the independence
of modules. among modules.
Highly cohesive gives the best software. Whereas loosely coupling gives the best 
b. How are coupling and
cohesion used in modularization
criteria? (2 Points)
b. How are coupling and cohesion used in modularization criteria? (2 Points)

the greater the cohesion of each module in the system, the lower the coupling between modules
is.

For interactive operating systems,


write the advantages of
preemptive scheduling algorithms
over the non-
preemptive scheduling algorithms
11. For interactive operating systems, write the advantages of preemptive scheduling algorithms
over the non-preemptive scheduling algorithms.
Preemptive non-pre
CPU utilization is more efficient compared to -CPU utilization is less efficient compared to
Non-Preemptive Scheduling. preemptive Scheduling.
Waiting and response time of preemptive Waiting and response time of the non-
Scheduling is less. preemptive Scheduling method is higher.
Preemptive more robust

Explain why a cache memory, in addition to RAM (or primary memory), is needed in computer systems.
(2 points)
Cache memory is important because it improves the efficiency of data retrieval. It stores program
instructions and data that are used repeatedly.

2.4 Give two possible methods


that are used to reduce disk access
time. (2 points)
2.4 Give two possible methods that are used to reduce disk access time. (2 points)
Seek time and rotational latenxy,disk ,disc cache
If a magnetic disk has 100 cylinders, each containing 10 tracks of 10 sectors, and each sector
can contain 128 bytes, what is the maximum capacity of the disk in bytes?
The maximum capacity of the disk is 1280000 bytes.
Given data:
1 sector contains 128 bytes.
There are 10 sectors in one track.
One cylinder contains 10 tracks.
There are 100 cylinders.
• The total number of tracks
= Number of cylinders × Tracks in one cylinder
= 100×10
= 1000
• Number of sectors
= Number of tracks × Sectors in one track
= 1000×10
= 10000
• Total amount of data
= Total number of sector × data present in one sector
= 10000×128
= 1280000 bytes
The total capacity of data in terms of bytes is 1280000 bytes. (Answer)

A computer’s memory is
composed of 8K words of 32 bits
each. How many bits are required
for memory
address if the smallest
addressable memory unit is a
word?
A computer’s memory is composed of 8K words of 32 bits each. How many bits are required for
memory address if the smallest addressable memory unit is a word?
 Answ:13 bits is the correct option
1. 1k of memory is equivalant to 1024 bytes. Hence, 32k memory reprentss 32*1024=32768
bytes of memory.
2. One memory location occupies one Byte of memory so 32k memory (32768 bytes) will
be having a total of 32768 memory locations. So if 0000 (H) represents the first memory
location then the last location in deciaml number system would be 32767.
Decimal number can be easily converted to hexadecimal number system, for instance
hexadeciaml representation of 32767 will be 7FFF (H), where H reprents hexadecimal
representation. So the last memory location in hexadecimal of a 32k memory will be 7FFF
(H).
Expla 1GB = 1024MB. 1MB = 1024KB. 1kB = 1024 Bytes. 1 Byte = 8 bits.
Page -9-
iii. Cars with price greater than
Birr 280,000 are luxury cars. List
the customer number, name and
address of customers who have
ordered more than one luxury car.
(3 points)

iv. List the name and position of


staff members who have only sold
cars to customers living in the
cities “Addis Ababa” or
“Mekelle”.
( 3
p o i n t s )

Page -8-
Part III: Database Management Systems (20 points)
3.1 Based on the description given below, answer the questions that follow.
The Cheapest Car Company sells new and used cars from different makers such
as Ford, Volvo and Toyota
and of different models such as Camry, Falcon, Corolla, Carina. custNo,
serialNo and staffNo are the sole
keys of Customer, Car and Staff, respectively. Customers make orders to buy
cars; a customer can make
several orders. Each order has a unique order number (orderNo) and only one
car is ordered in one order.
An order is processed by one staff member.
Customer(custNo, custName, street, city, postcode)
Car(serialNo, model, year, maker, price)
Staff(staffNo, staffName, position)
Order(orderNo, staffNo, date, custNo, serialNo, amount_paid)
Attribute amount_paid of relation Order is the amount that a customer pays for
an order; a Customer may
not pay in full for the order. The other attributes are self-explanatory.
a. Discuss the likely Functional Dependencies in Order. (2 points)

b. Give the foreign keys in Order and the relevant referential integrity
constraints. (2 points)

c. Write an SQL query for each of the following:


i. In how many cities does the company have customers? (2 points)
ii. List the details of customers whose name contains the string “Wolde”. (2
points)

3.2 When is the concept of a weak entity used in database modeling?


(2 points)

Concept of weak entity types is used in data modeling when we want to


specify a new entity type similar to the one we already.
4 Compare and contrast virtual circuit switching and datagram switching based
on factors such as
addressing (addressing information in every packet), routing and effects of
node failures.
The desired reasons that lead to the occurrence of null values in relations are as given below: When
value of an attribute is not applicable for a tuple. it can be marked as NULL. 
5. Compare and contrast virtual circuit switching and datagram switching based
on factors such as addressing (addressing information in every packet), routing
and effects of node failures.
Virtual Circuit is the connection oriented service in which there is an implementation of
resources like buffers, CPU, bandwidth, etc., used by virtual circuit for a data transfer
session. On other hand Datagram is the connection less service where no such resources
are required for the data transmission.
Application of queue?
Examples of queues in "real life":

 A ticket line;
 An escalator;
 A car wash.

Examples of queues in computing:

 A printer queue;
 An input stream;

The Queue ADT


Contains the methods enqueue, dequeue, front, isEmpty.

You might also like