Theory Assignment 1
Theory Assignment 1
To differentiate the basic design issues involved in creating process and threads. L4
To analyze the mechanisms involved in handling, scheduling and synchronizing
processes. L4
1. Suppose the hypothetical processor of figure 1.3 (page no 34) also has two I/O
instruction:
0011=Load AC from I/O
0111=Store AC to I/O
In these cases, 12-bit address identifies a particular external device. Show the program
execution using the format of Figure 1.4 (page no 35) for the following program:
a. Load AC from device 6.
b. Add content of memory location 880.
c. Store AC to device 7.
Assume that the next value retrieved from the device 6 is 10 and that location 880
contains a value of 8.
2. Consider a hypothetical 64-bit microprocessor having 64-bit instructions composed of two
fields. The first 2 bytes contain the opcode, and the remainder an immediate operand or an
operand address. What is the maximum directly addressable memory capacity?
hit=if the word is found in memory hit ratio is high
miss=is viceversa overal perfomance of computer is good
hit ratio=hit / no of request made by cpu
3. Suppose that a large file is being accessed by a computer memory system comprising of a
cache and a main memory. The cache access time is 50 ns. Time to access main memory
(including cache access) is 550 ns. The file can be opened either in read or in write mode.
A write operation involves accessing both main memory and the cache (write-through
cache). A read operation accesses either only the cache or both the cache and main memory
depending upon whether the access word is found in the cache or not. It is estimated that
read operations comprise of 70% of all operations. If the cache hit ratio for read operations
is 0.9, what is the average access time of this system?
4. Consider a computer with 400Mbytes of available memory (not used by os). Three
program, JOB1, JOB2 and JOB3 are submitted for execution at the same time with attribute
listed below.
For simple Batch environment, these job are executed in sequence JOB1, JOB2 then JOB3.
Find out CPU utilization, memory utilization and Throughput in case of uniprogramming
and multiprogramming system.
5. In a batch operating system, three jobs are submitted for execution. Each job involves an
I/O activity, CPU time and another I/O activity of the same time span as the first. Job JOB1
requires a total of 23 ms, with 3 ms CPU time; JOB2 requires a total time of 29 ms with 5
ms CPU time; JOB3 requires a total time of 14 ms with 4 ms CPU time. Illustrate their
execution and find CPU utilization for uniprogramming and multiprogramming systems.
6. Trace the following program segment and determine how many processes are created.
Draw a graph that shows how the processes are related.
7. Consider the set of processes with arrival time (in milliseconds), CPU burst time (in
milliseconds), and priority (high number implies high priority) as shown below.
8. Consider the set of processes with arrival time (in milliseconds), CPU burst time (in
milliseconds), and priority (lowest number implies high priority) as shown below.
9. Consider the following four processes with arrival times (in milliseconds) and their length
of CPU bursts (in milliseconds) as shown below:
10. Consider a multilevel feedback queue scheduling (MLFBQ) with three queues q1, q2 and
q3, where q1 has the highest priority and q3 has the lowest priority. q1 and q2 use round
robin algorithm with time quantum equal to 3 and 5 milliseconds respectively. q3 uses first-
come first-serve algorithm. Assume the arrival time of all processes as 0. A process
entering the ready queue will put in queue 0. Processes in queue q1, q2 will be demoted to
lower priority queue, if not completed on specified time quantum. Find the average waiting
time (A.W.T) and average turnaround time (A.T.A.T) for executing the following process?
P1 8
P2 22
P3 4
P4 12
11. Two concurrent processes P and Q are executing the following instructions. Synchronize
the execution of P and Q with suitable semaphore operations using the two Boolean
semaphores S and T. Also suggest the initial values of S and T such that the execution of
the processes will print the sequence 00110011…
Process P Process Q
While(true) While(true)
{ {
Print(“1”); Print(“0”);
Print(“1”); Print(“0”);
} }
12. Two concurrent processes P and Q are executing the following instructions. Synchronize
the execution of P and Q with suitable semaphore operations using the two Boolean
semaphores S and T and proper initialization of the semaphore values, so that the final
outcome will be in the following order:
Process P Process Q
Print(“1”); Print(“3”);
Print(“2”); Print(“4”);
a) 1 3 2 4 b) 3 1 2 4