Computer Organisation and Architecture

Verified

Added on  2022/11/07

|15
|3260
|478
AI Summary
This document discusses various aspects of computer organisation and architecture, including CPU, main memory, storage devices, and more. It also covers topics like deadlock, waiting time, burst time, turnaround time, completion time, and different scheduling algorithms like FCFS, SJN, SRT, and Round Robin. The document provides solved assignments and essays on these topics.
tabler-icon-diamond-filled.svg

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
Running head: COMPUTER ORGANISATION AND ARCHITECTURE
Computer Organisation and Architecture
Name of the Student:
Name of the University:
Author note:
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
2COMPUTER ORGANISATION AND ARCHITECTURE
Question 1:
CPU – Most of the modern-day CPU tends to perform multitasking operations with respect to
the fact that the users, as well as the tasks, are well played by this unit. Moreover, the CPU is
depicted to be shared amongst the various processes as well as the hardware timers that are
engaged to assure that there will be no single process which may monopolise the environment
of the CPU (Abdoos 2017). The OS selects which will be the next process that gets executed
by the processor and how much time it will be taken to complete the execution. This method
is known as process scheduling.
Main memory – It refers to the primary memory of the system. The main memory consists of
a vast storage system, which is directly accessed by the processor. A program starts execution
from the main memory (Abirami, Sridhar and Vaidhyanathan 2015). The potential operating
system tends to implement a vast range of the system flags. This will help the deadlock to be
prevented.
Storage devices – O.S. manages communication between devices through the use of various
drivers. It performs the functionalities for operating the device –
Monitor all devices. The I/O controller program is used to monitor all the devices. It decides
the next process, which gets the processor to execute the task and the time required by the
processes to accomplish the task. Perform de-allocation for the devices as well. The
significant unit of the storage potentially faces the situation of deadlock when the resources
of the different files are being accessed from the various resources (Gupta, Yadav and Goyal
2016). Thus to avoid the situation of deadlock, it may follow a simple process that it needs to
maintain the overall status of a particular device.
Document Page
3COMPUTER ORGANISATION AND ARCHITECTURE
Files - The significant situation in the file system can also be identified to face a situation of
deadlock. The condition to prevent a deadlock will have adhered in this section. The
operating system may intend to maintain a respective status flag with respect to the specific
file. This file will further be examined with respect to the different processes which will be
attempted before writing has started (Verma, Bhardwaj and Yadav 2016). However, within
an environment where file-sharing persists, without the supervision of the operating system, a
significant lock file needs to be maintained which is to be read in respect to the application
level which will further determine the status of the file. This will help the deadlock situation
to be prevented with respect to the file systems.
Question 2:
In the database system, a deadlock occurs when more than one database sessions have some
data in the locked state (Silberschatz, Gagne and Galvin 2018). If a database session request
for data to lock, which is get locked by another database session, in this situation, deadlock
arises. Since the session is waiting for each other to release the lock and can be able to update
their session and unlock the session. In this scenario, nothing will happen since both the
sessions are waiting for each other and are called deadlock.
When a fund may be transferred between the two accounts using the following stages:
lock A ( I ) update A ( I ) unlock A ( I )
lock A ( J ) update A ( J ) unlock A ( J )
In the above scenario, there are two account A ( I ) and A( J ). Let’s us assume that the
account A re1quests for a transaction to lock using lock A ( I ). And call another transaction
Document Page
4COMPUTER ORGANISATION AND ARCHITECTURE
A ( J ) to lock some data in order to run the transaction (Siahaan 2016). If the first account
(say A) holds any data or resources when executing the session, and second account (say, B)
requires same resources to execute the transaction, both the sessions are waiting for each
other to release the lock and waiting indefinitely period of time. In this situation, a deadlock
occurs.
However, in the above system the account A request for a resource to lock(i), then update the
session and unlock(i) it. And then the next account B request for the resource to lock(j), then
update the session and unlock(j) it. Therefore, both the sessions need not be waits for each
other to get the resource, and deadlock does not occur.
Question 3:
Waiting time – The waiting time calculates total time required by a process to finish the task.
The waiting time is potentially described to be the time that is necessarily spent by a
significant process that is depicted to be waiting within the sectors of the ready queue that are
trying to get back to the CPU for processing. In other terms, the waiting time is depicted with
respect to the time, indifference of the burst time and turnaround time.
WT = (TAT – BT)
TAT – Turnaround Time
BT – Burst Time
WT – Waiting Time
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
5COMPUTER ORGANISATION AND ARCHITECTURE
Burst time :– Burst time compute the amount of time that a job required to execute on CPU.
It is sometimes referred to as running time or execution time (van Harten 2015). The burst
time for the processes are not predefined, and it can be known only after the execution of the
processes.
Turnaround time :– Turnaround time compute the amount of time interval when a enters into
a ready queue and the time a process take to finish the job.
TAT = (BT + WT)
Or, TAT = (CT– AT)
TAT – Turnaround Time
BT – Burst Time
WT – Waiting Time
CT – Completion Time
AT – Arrival Time
It is depicted that the range of time interval in respect to the fact that the execution time of the
respective processes with respect to the amount of time associated with the process of
completion (Ramadha and Siahaa 2016). The sum of the periods in respect to time that are
spent waiting for the consideration of the memory to get entry within the CPU, executing the
process within the CPU as well as executing the input as well as the output. This is most
important with respect to the fact that the evaluation of the scheduling algorithms within the
Document Page
6COMPUTER ORGANISATION AND ARCHITECTURE
operating system (Salim and et al. 2019). The significant factors that tend to influence the
turnaround time are potentially stated below:
1. Memory that is needed for the execution of the application.
2. The appropriate waiting time needed for the application to get executed.
3. The significant resources that are needed for executing the application
4. The environment where the operation will be executed.
Completion time – When a process finishes the execution on CPU and exits from the CPU,
this time is known as completion time. It is sometimes referred to as exit time.
Arrival time – The arrival time is the point of time when a process gets into a ready queue.
This time is known as arrival time.
Question 4:
FCFS :– In the FCFS algorithm, multiple processes execute their job in a FCFS manner this
means that the process comes first will get CPU first (Pang and et al. 2019). This algorithm is
simple to implement. It follows the FIFO queue technique in which the job that comes first
will always finish the task first. Thus the average waiting time of FCFS algorithm is high, and
the performance is low.
Document Page
7COMPUTER ORGANISATION AND ARCHITECTURE
A B C D E
0 12 19 21 39
40
Calculating waiting WT and TAT for FCFS algorithm,
WT for job A = 12 – 0 = 12
WT for job B = 19 – 3 = 16
WT for job C = 21 - 5 = 16
WT for job D = 39 – 8 = 31
WT for job E = 40 – 11 = 29
Average waiting time = (12+16+16+31+29)/5 = 20.8
TAT for job A = 12 – 0 = 12
TAT for job B = 12 – 3 = 8
TAT for job C = 19 – 5 = 14
TAT for job D = 21 – 8 = 13
TAT for job E = 39 – 11 = 28
Average TAT = (12 + 8 + 14+ 13 + 28)/5 = 15
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
8COMPUTER ORGANISATION AND ARCHITECTURE
SJN :– The Shortest Job Next(SJN) algorithm sometimes refer to as Shortest Job First(SJF).
The SJN/SJF algorithm can be divided into two types, either it can be pre-emptive, or it can
be non-pre-emptive. This algorithm minimises the average waiting time. The algorithm is
easy and simple to implement in a Batch processing system since the CPU time is already
predefined by the system. The processor required to know the time that is taken by the
process to complete the transaction.
A E C B D
0 3 12 13 15 22 30
Calculating WT and TAT for SJF algorithm,
WT for job A = 0 - 0 = 0
WT for job B = 15 - 3 = 12
WT for job C = 13 - 5 = 8
WT for job D = 22 – 8 = 14
WT for job E = 12 – 11 = 1
Average WT = (0+12+8+14+1)/5 = 7
TAT for job A = 12 – 0 = 12
TAT for job B = 22 – 3 = 19
Document Page
9COMPUTER ORGANISATION AND ARCHITECTURE
TAT for job C = 13 – 5 = 8
TAT for job D = 30 – 8 = 22
TAT for job E = 13 – 11 = 2
Average TAT = (12+19+8+22+2)/5 = 12.6
Shortest-Remaining-Time :– It defines the pre-emptive scheduling of SJN algorithm. In the
SRT scheduling, the job gets the processor when it is close to completion. However, if a job
with shorter completion time period is entered into the queue, then the previous job can be
pre-empted by the new job (Malhotra 2016). In an interactive system environment, it is not
possible to implement SRT algorithm, where the process execution time is not defined. It is
useful to implement in a batch processing environment the process with the shortest time
period will get prioritised.
A B C B E A D
0 3 5 7 12 13 22 36
Calculate WT and TAT for SRT algorithm,
WT for job A = 13 – 3 = 10
WT for job B = 7 – 3 =4
WT for job C = 5-5 = 0
WT for job D = 22 - 8 = 14
Document Page
10COMPUTER ORGANISATION AND ARCHITECTURE
WT for job E = 12 – 11 = 1
Average WT = (10 + 4 + 0 + 13 + 1)/5 = 5.8
TAT for job A = 22 – 0 = 22
TAT for job B = 5 – 3 = 2
TAT for job C = 7 – 5 = 2
TAT for job D = 36 – 8 = 28
TAT for job E = 13 – 12 = 1
Average TAT = (22+2+2+28+1)/5 = 11
Round Robin :– The RR algorithm is a pre-emptive scheduling algorithm. In which, every
process will get executed for the fixed period of time, which is known as quantum (Lee and
Shin 2019.). A process gets executed by the processor for the given quantum of the time
period, and it is pre-empted by other processes to accomplish for the given quantum of time.
A B C D E A B D A D A D D
0 3 6 8 11 12 15 18 21 24 27 30 33
35
Calculating WT and TAT for RR algorithm,
WT for job A = 27 – 9 – 6 - 3 = 9
WT for job B = 3 – 3 = 0
tabler-icon-diamond-filled.svg

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
11COMPUTER ORGANISATION AND ARCHITECTURE
WT for job C = 6 - 5 = 1
WT for job D = 33 – 7 – 3 – 3 = 20
WT for job E = 12 – 11 = 1
Average WT = (9+ 0 + 1 + 20 + 1)/5 = 6.2
TAT for job A = 30 – 0 = 30
TAT for job B = 18 - 3 = 15
TAT for job C = 8 -5 = 3
TAT for job D = 35 – 8 = 27
TAT for job E = 12 – 11 = 1
Average TAT = (30+15+3+27+1)/5 = 15.2
Question 5:
a. Deadlock: A deadlock describes a situation in which multiple processes and resources
are simultaneously used by the system that is a process holds some resources and
waiting for other resource which is obtained by some other processes. In this
situation, deadlock happens. Deadlock must happen in the system if the following
situation happens concurrently, these are:
Document Page
12COMPUTER ORGANISATION AND ARCHITECTURE
Mutual exclusion - in which resources are shared by one process at a time this means that
the resources must be non shareable.
Hold and wait - in which processes can hold one resource at a time, and waiting for other
resources.
No pre-emption - in which resources can be able to take from some other processes only
after the process releases the resources.
Circular wait – In a system, multiple processes are waits for other resources to use which
may be acquired by some other processes and form a circular graph.
Figure. 1: A system is deadlocked
Yes, the above system is in a deadlocked state. The above system consisting of three
processes those are - P1, P2, P3 and the three resources those are - R1, R2, R3. The processes
can hold one or more resources. R1 resource is obtained by P1, and waiting to get other
resource R2 that is hold by P2, R2 resource is obtained by P2 and waiting for other resource
R3 that is hold by P3 and R3 resource is obtained by P3 and waiting for other resource R2
that is acquired by the P3 (Dash and Samantra 2016). Therefore each processes waiting for a
resource to release and they can finish the execution.
Document Page
13COMPUTER ORGANISATION AND ARCHITECTURE
b. Process P1, P2 and P3 are blocked as they require other resources to finish the task.
c. The resulting graph after reduction is given below: the above following figure
displays the system represent a safe state. Each resource is free to share by the
processes. Therefore there is no such situation arise when a process needed to wait for
a resource to release, which might be acquired by other processes. It satisfies the
mutual exclusion condition. This means that is a resource is shared by only one
process.
References
Abdoos, M., 2017. Improved deadlock prevention algorithms in distributed systems. Int. J.
Eng. Appl. Comput. Sci, 2(02), pp.75-78.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
14COMPUTER ORGANISATION AND ARCHITECTURE
Abirami, B., Sridhar, K. and Vaidhyanathan, V., 2015. Performance Analysis of O.S.
Scheduling for a Reconfigurable Computing Environment. Indian Journal of Science and
Technology, 8(22), p.1.
Banerjee, P., Shree, R. and Verma, R.K., 2017. Generic Round Robin Scheduling for Real
Time Systems. International Journal, 7(5).
Dash, A.R. and Samantra, S.K., 2016. An optimised round Robin CPU scheduling algorithm
with dynamic time quantum. arXiv preprint arXiv:1605.00362.
Gupta, A.K., Yadav, N.S. and Goyal, D., 2016. Design and Performance Evaluation of Smart
Job First Dynamic Round Robin (SJFDRR) Scheduling Algorithm with Smart Time
Quantum. American Scientific Research Journal for Engineering, Technology, and Sciences
(ASRJETS), 26(4), pp.66-78.
Lee, J. and Shin, H.C., 2019. Burst Suppression Segmentation of EEG Using Adaptive
Binarization in Time and Frequency Domains. IEEE Access, 7, pp.54550-54561.
Malhotra, D., 2016. Deadlock prevention algorithm in grid environment. In MATEC Web of
Conferences (Vol. 57, p. 02013). EDP Sciences.
Pang, S., Chen, H., Liu, H., Yao, J. and Wang, M., 2019. A deadlock resolution strategy
based on spiking neural P systems. Journal of Ambient Intelligence and Humanized
Computing, pp.1-12.
Ramadhan, Z. and Siahaan, A.P.U., 2016. Dining Philosophers Theory and Concept in
Operating System Scheduling. IOSR J. Comput. Eng, 18(6), pp.45-50.
Document Page
15COMPUTER ORGANISATION AND ARCHITECTURE
Salim, A.W., Wiranata, F., Mahidin, C.M., Waruwu, R.F., Wardani, S. and Dharma, A.,
2019, July. Implementation Resource Request Alghoritm In Simulation of Deadlock
Avoidance. In Journal of Physics: Conference Series (Vol. 1230, No. 1, p. 012096). IOP
Publishing.
Siahaan, A.P.U., 2016. Comparison analysis of CPU scheduling: FCFS, SJF and Round
Robin. International Journal of Engineering Development and Research, 4(3), pp.124-132.
Silberschatz, A., Gagne, G. and Galvin, P.B., 2018. Operating system concepts. Wiley.
Singgih, I.K., Jin, X., Hong, S. and Kim, K.H., 2016. Architectural design of terminal
operating system for a container terminal based on a new concept. Industrial Engineering &
Management Systems, 15(3), pp.278-288.
van Harten, M.C., Hoebers, F.J., Kross, K.W., van Werkhoven, E.D., van den Brekel, M.W.
and van Dijk, B.A., 2015. Determinants of treatment waiting times for head and neck cancer
in the Netherlands and their relation to survival. Oral oncology, 51(3), pp.272-278.
Verma, M., Bhardwaj, N. and Yadav, A.K., 2016. Real time efficient scheduling algorithm
for load balancing in fog computing environment. Int. J. Inf. Technol. Comput. Sci, 8(4),
pp.1-10.
chevron_up_icon
1 out of 15
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]