Uploaded by Kwanele Phakathi

COS 122 Tutorial 1 Exercises

advertisement
Department of Computer Science
COS 122 Operating Systems
Tutorial 1 Exercises: Chapter 1 & 2
Exercises
1. Consider a hypothetical 20-bit processor with 20-bit instructions. The first
4 bits contain the opcode. The address bus has a size of 8 bits. Answer the
following questions:
a.
b.
c.
d.
How many different opcodes does the processor support?
How many locations of memory can the processor directly address?
How wide is the program counter?
How many cycle(s) will the system require to transfer a memory
address?
2. Suppose a processor has access to two levels of memory, i.e., cache and
main memory. Level 1 represents cache, while Level 2 represents main
memory respectively. Level 1 has an access time of 20 nanoseconds and
level 2 has an access time (which includes level 1 access) of 200
nanoseconds. It is estimated that 90 % of the memory accesses are found in
level 1. If a byte to be accessed is in level 1, then the processor will directly
COS 122 Operating Systems
1
31 July 2023
access it. If a byte to be accessed is not in level 1 then it must be in level 2,
and the byte will first be transferred to level 1 and then accessed by the
processor. For simplicity, we ignore the time that is required for the
processor to determine whether a byte can be found in level 1 or 2. What is
the average access time of this system? Write down intermediate steps of
your calculation.
3. Suppose we have four jobs in a computer system, in the order JOB1, JOB2,
JOB3 and JOB4. JOB1 requires 6 s of CPU time and 6 s of I/O time; JOB2
requires 4 s of CPU time and 12 s of disk time; JOB3 requires 8 s of CPU
time; and JOB4 requires 4 s of CPU time and 14 s of printer time. Define
the following quantities for system utilisation:
• Turnaround time = actual time to complete a job
• Throughput = average number of jobs completed per time period T
• Processor utilization = percentage of time that the processor is active
(not waiting)
Compute these quantities (with illustrations if needed) in each of the
following systems:
A uni-programming system, whereby each job executes to completion
before the next job can start its execution.
A multi-programming system that follows a simple round-robin scheduling.
Each process gets 2 s of CPU time turn-wise in a circular manner.
4. Let T’ be a system with MTTF=78 hours and MTTR=3 minutes. Determine
to which availability class T’ belongs.
COS 122 Operating Systems
2
31 July 2023
Download