Answers
Answers
Answers
ANS -
(1) Processor
- Controls the operation of computer & performs its data processing function.
- contents of disk memory are same even shut down called real or primary memory.
- external environment consists of devices including secondary memory devices & terminals.
-Provides for communication among processors, main memory & I/O modules.
ANS -
- Enable the machine or assembly language programmer to minimize main memory references by
optimizing register use and for high level languages compiler will do this task.
- ex. Data and address registers, index registers, segment pointer, stack pointer.
- used by the processor to control the operation of processor & by privileged as routines to control the
execution of programs.
Q 1.3 In general terms, what are the four distinct actions that a machine instruction can specify?
ANS -
(4) control
- An instruction may specify that the sequence of execution be altered called control.
- suppose processor fetch instruction from location 149, it specify that next instruction from location
182. so processor sets pc to 182 so next instruction fetch from 182 instead 150.
ANS -
- A mechanism by which other modules (i/o,memory) may interrupt the normal sequence of the
Class of interrupts -
(2) timer generated by timer for perform certain function on regular basis.
(3) I/O generated by i/o controller, to signal normal completion of an operation or variety of
ANS -
When at running of a single interrupt execution the other one interrupt is occur at same time called
multiple interrupts.
- It means that processor ignores any any of new interrupt request signal. In generally new interrupt is
- drawback the first batch of input has not been proceed before the second batch arrives, data will be
(2) allow an higher priority interrupt during the time of lower priority interrupt execution.
- ex. System with 3 i/o devices printer, disk, communication line. Priorities are 2, 4, 5 respectively so
when any interrupt are arrived at interrupt execution then as per its priority it can be executed.
ANS -
there are three characteristics of memory are Namely, Capacity, Access time and Cost.
The various characteristics which distinguish in between of memory hierarchy elements are:
They have moderate access time, moderate cost per bit &
They have high capacity, low cost per bit & slower access.
ANS -
cache memory - The part of Random Access Memory or Main Memory that is easily accessible to the
- As the microprocessor processes data, it looks first in the cache memory and if it finds the data in
cache memory, then in main memory, it takes less time for that compare with RAM.
- Cache memory is intended to provide memory access time approaching that of the fastest memories
available.
- As compare with registers memory, cache memory is low cost per bit and has faster access time.
Q 1.8 List and briefly define three techniques for I/O operations.
ANS -
Programmed I/O -
- Programmed input/output is a method of transferring data between the CPU and Input/Output
peripherals.
- the processor is responsible for extracting data from main memory for output and storing data in main
- The CPU issues a command then waits for I/O operations to be complete.
For example, a magnetic-tape unit may be instructed to rewind or to move forward one record.
- Status: Used to test various status conditions associated with an I/O module and its peripherals.
- Transfer: Used to read and/or write data between processor registers and external devices.
Interrupt-driven I/O
- in programmed I/O The processor, while waiting, must repeatedly interrogate the status of the I/O
module. As a result, the performance level of the entire system is severely degraded.
- The processor then executes the data transfer, as before, and then resumes its former processing.
- Thus both of the above forms of I/O suffer from two inherent drawbacks:
1. The I/O transfer rate is limited by the speed with which the processor can test and service a device.
2. The processor is tied up in managing an I/O transfer; a number of instructions must be executed for
- The DMA function can be performed by a separate module on the system bus or it can be
- the processor wishes to read or write a block of data, it issues a command to the DMA module, by
Q 1.9 What is the distinction between spatial locality and temporal locality?
ANS -
- The concept that a resource that is referenced at one point in time will be referenced again sometime
- If a particular memory location is referenced at a particular time, then it is likely that nearby
memory locations will be referenced in the near future is called as spatial locality.
Q 1.10 In general, what are the strategies for exploiting spatial locality and temporal locality?
ANS -
- Temporal locality is exploited by keeping recently used instruction and data values in
1.1 Suppose the hypothetical processor of Figure 1.3 also has two I/O instructions:
In these cases, the 12-bit address identifies a particular external device. Show the program
execution (using format of Figure 1.4) for the following program:
3. Store AC to device 6.
Assume that the next value retrieved from device 5 is 3 and that location 940 contains
a value of 2.
300: 3000
301: 6000
302: 9000
1: 3000 . IR
2: 3 . AC
3: 6000 . IR
4: 3 + 2 = 5 . AC
5: 9000 . IR
6: AC . Device 6
two fields. The first byte contains the opcode and the remainder an immediate operand
or an operand address.38
b. Discuss the impact on the system speed if the microprocessor bus has
c. How many bits are needed for the program counter and the instruction register?
Ans:
a. 2^24 = 16 MBytes
b. (1) If the address bus is 32 bits, the whole address can be transferred at once and decoded in
memory. But the data bus is only 16 bits, so it will require 2 cycles to fetch a 32-bit instruction or
operand.
(2) The 16 bits of the address placed on the address bus can't access the whole memory. Thus a more
complex memory interface control is needed to latch the first part of the address and then the second
part (since the microprocessor will -2-end in two steps). For a 32-bit address, one may assume the first
half will decode to access a "row" in memory, while the second half is sent later to access a "column"
in memory. In addition to the two-step address operation, the microprocessor will need 2 cycles to fetch
the 32 bit instruction/operand.
1.5 Consider a 32-bit microprocessor, with a 16-bit external data bus, driven by an 8-MHz input
clock. Assume that this microprocessor has a bus cycle whose minimum duration equals four
input clock cycles. What is the maximum data transfer rate across the bus that this
microprocessor can sustain in bytes/s? To increase its performance, would it be better to make its
external data bus 32 bits or to double the external clock frequency supplied to the
microprocessor? State any other assumptions you make and explain. Hint: Determine the
Clock cycle = Doubling the frequency may mean adopting a new chip manufacturing technology;
doubling the external data bus means wider on-chip data bus drivers/latches and modifications to the
bus control logic. In the first case, the speed of the memory chips will also need to double not to slow
down the microprocessor; in the second case, the "wordlength" of the memory will have to double to be
1.7 In virtually all systems that include DMA modules, DMA access to main memory is
If a processor is held up in attempting to read or write memory, usually no damage occurs except a
slight loss of time. However, a DMA transfer may be to or from a device that is receiving or sending
data in a stream (e.g., disk or tape), and cannot be stopped. Thus, if the DMA module is held up (denied
1.9 A computer consists of a CPU and an I/O device D connected to main memory M via a shared
bus with a data bus width of one word. The CPU can execute a maximum of 106 instructions per
second. An average instruction requires five processor cycles, three of which use the memory bus.
A memory read or write operation uses one processor cycle. Suppose that the CPU is
continuously executing background programs that require 95% of its instruction execution
TWO-LEVEL MEMORIES
Assume that one processor cycle equals one bus cycle. Now suppose that very large blocks of data
a. If programmed I/O is used and each one-word I/O transfer requires the CPU to execute two
instructions, estimate the maximum I/O data transfer rate, in words per second, possible through
D.
a. The processor can only devote 5% of its time to I/O. Thus the maximum I/O instruction execution
rate is 106 0.05 = 50,000 instructions/second. The I/O transfer rate is therefore 25,000 words/second.
b. The number of machine cycles available for DMA control is 10^6 (0.05 5 +
2.2 The kernel is a portion of the operating system that includes the most heavily used
memory. The kernel runs in a privileged mode and responds to calls from processes
operating system.
2.5 The execution context, or process state, is the internal data by which the operating
system is able to supervise and control the process. This internal information is
separated from the process, because the operating system has information not
permitted to the process. The context includes all of the information that the
operating system needs to manage the process and that the processor needs to
execute the process properly. The context includes the contents of the various
processor registers, such as the program counter and data registers. It also includes
information of use to the operating system, such as the priority of the process and
whether the process is waiting for the completion of a particular I/O event.
2.6. List and briefly explain five storage management responsibilities of a typical OS.
2.6 Process isolation: The operating system must prevent independent processes from
interfering with each other's memory, both data and instructions. Automatic
allocation and management: Programs should be dynamically allocated across the
limitations, and the operating system can achieve efficiency by assigning memory
able to define program modules, and to create, destroy, and alter the size of
level of the memory hierarchy, creates the potential for one program to address the
applications. At other times, it threatens the integrity of programs and even of the
operating system itself. The operating system must allow portions of memory to be
programs require means for storing information for extended periods of time, after
2.7. Explain the distinction between a real address and a virtual address.
2.7 A virtual address refers to a memory location in virtual memory. That location is
on disk and at some times in main memory. A real address is an address in main
memory.
2.8 Round robin is a scheduling algorithm in which processes are activated in a fixed
cyclic order; that is, all processes are in a circular queue. A process that cannot
proceed because it is waiting for some event (e.g. termination of a child process or
2.9 A monolithic kernel is a large kernel containing virtually the complete operating
management. All the functional components of the kernel have access to all of its
as a single process, with all elements sharing the same address space. A
3.1 An instruction trace for a program is the sequence of instructions that execute for
that process.
3.2 New batch job; interactive logon; created by OS to provide a service; spawned by
3.3 For the processing model of Figure 3.6, briefly define each state.
3.3 Running: The process that is currently being executed. Ready: A process that is
prepared to execute when given the opportunity. Blocked: A process that cannot
execute until some event occurs, such as the completion of an I/O operation. New:
A process that has just been created but has not yet been admitted to the pool of
executable processes by the operating system. Exit: A process that has been released
from the pool of executable processes by the operating system, either because it
3.5 Swapping involves moving part or all of a process from main memory to disk.
When none of the processes in main memory is in the Ready state, the operating
system swaps one of the blocked processes out onto disk into a suspend queue, so
3.6 There are two independent concepts: whether a process is waiting on an event
(blocked or not), and whether a process has been swapped out of main memory
2. The process may or may not be waiting on an event. If it is, this blocked condition is independent of the suspend condition, and
occurrence of the blocking event does not enable the process to be executed.
3. The process was placed in a suspended state by an agent; either itself, a parent process, or the operating system, for the
purpose of preventing its execution.
4. The process may not be removed from this state until the agent explicitly orders the removal.
3.8 For what types of entities does the OS maintain tables of information for management purposes?
3.8 The OS maintains tables for entities related to memory, I/O, files, and processes.
3.9 Process identification, processor state information, and process control information.
3.10 The user mode has restrictions on the instructions that can be executed and the
memory areas that can be accessed. This is to protect the operating system from
damage or alteration. In kernel mode, the operating system does not have these
3.11 1. Assign a unique process identifier to the new process. 2. Allocate space for the
process. 3. Initialize the process control block. 4. Set the appropriate linkages. 5.
3.12 An interrupt is due to some sort of event that is external to and independent of the
3.14 What is the difference between a mode switch and a process switch?
3.14 A mode switch may occur without changing the state of the process that is currently in the Running state. A process switch
involves taking the currently executing process out of the Running state in favor of another process. The process switch involves
saving more state information.