Exercises
Exercises
Chapter 7
7.1 List three broad classifications of external, or peripheral,
devices.
Ans. External or peripheral devices can be broadly classified as:
a. Human Readable (Appropriate for communicating with the
computer user e.g. Keyboard, Printer, Screen etc. )
b. Machine Readable (Appropriate for communicating with the
equipment e.g. monitoring and control)
c. Communication (Appropriate for communicating with remote
devices e.g. Modem, NIC (Network Interface Card) etc.)
When you hit interrupt through keyboard it will be initially sent
to PIC then PIC sends a signal on INT pin of processor (due to
which processor will aware that there is something interrupt due
to some device), when processor will free it will send READY
signal to PIC then PIC sends information regarding interrupt
device and interrupt type to processor via data bus line and finally
interrupt is executed.
7.7 When a DMA module takes control of a bus, and while it
retains control of the bus, what does the processor do?
Ans. When a DMA module takes control of a bus, and while
it retains control of the bus, what does the processor do?
The processor either doesn't need to use the bus at the time, or
it is forced to suspend operation temporarily.
The processor deals with other things, while the bus operation
is left to DMA.
Chapter 8
8.1 What is an operating system?
Ans. the software that supports a computer's basic functions,
such as scheduling tasks, executing applications, and controlling
peripherals.
8.2 List and briefly define the key services provided by an OS.
Ans.
Chapter 10
10.1 Briefly explain the following representations: sign
magnitude, twos complement, biased.
Chapter 12
12.6 What is the relationship between the IRA character code and
the packed decimal representation?
Ans. For the IRA bit pattern 011XXXX, the digits 0 through 9 are
represented by their binary equivalents, 0000 through 1001, in
the right-most 4 bits. This is the same code as packed decimal.
12.7 What is the difference between an arithmetic shift and a
logical shift?
Ans. Arithmetic shift preserve sign bit, whereas Logical
shift cannot preserve sign bit. Arithmetic shift perform
multiplication and division operation, whereas Logical
shift perform only multiplication operation. Arithmetic shift is
used for signed interpretation, whereas Logical shift is used for
unsigned interpretation.
12.8 Why are transfer of control instructions needed?
Ans.
1. In the practical use of computers, it is essential to be able to
execute each instruction more than once and perhaps many
thousands of times. It may require thousands or perhaps millions
of instructions to implement an application. This would be
unthinkable if each instruction had to be written out separately. If
a table or a list of items is to be processed, a program loop is
needed. One sequence of instructions is executed repeatedly to
process all the data.
12.9 List and briefly explain two common ways of generating the
condition to be tested in a conditional branch instruction.
Ans. There are two common ways of generating the condition to
be tested in a conditional branch instruction. First, most machines
provide a 1-bit or multiple-bit condition code that is set as the
result of some operations. Another approach that can be used
with a three-address instruction format is to perform a
comparison and specify a branch in the same instruction.
12.10 What is meant by the term nesting of procedures?
Ans. When the sub routine is declared within the scope
of procedure or function, then the function or sub routine is to
be nested or calling the procedure CALL inside the procedure,
then it is said to be nesting of procedure.
12.11 List three possible places for storing the return address for
a procedure return.
Ans. The return address for a procedure return can be
stored in three places:
Register
Start of procedure
Top of stack.
Chapter 14
Chapter 16
Chapter 17
17.1 List and briefly define three types of computer system
organization.
Ans.
1. Instruction fetch strategies that simultaneously fetch
multiple instructions, often by predicting the outcomes of,
and fetching beyond, conditional branch instructions. These
functions require the use of multiple pipeline fetch and
decode stages, and branch prediction logic.
2. Logic for determining true dependencies involving register
values, and mechanisms for communicating these values to
where they are needed during execution.
3. Mechanisms for initiating, or issuing, multiple instructions in
parallel.
4. Resources for parallel execution of multiple instructions,
including multiple pipelined functional units and memory
hierarchies capable of simultaneously servicing multiple
memory references.
5. Mechanisms for committing the process state in correct
order.
17.4 What are some of the key OS design issues for an SMP?
Ans. SMP has some key OS design issues;
1. Simultaneous concurrent processes: OS routines need
to be reentrant to allow several processors to execute the
same IS code simultaneously. With multiple processors
executing the same or different parts of the OS, OS tables
and management structures must be managed properly to
avoid deadlock or invalid operations.
2. Scheduling: Any processor may perform scheduling, so
conflicts must be avoided. The scheduler must assign ready
processes to available processors.
3. Synchronization: With multiple active processes having
potential access to shared address spaces or shared I/O
resources, care must be taken to provide effective
synchronization. Synchronization is a facility that enforces
mutual exclusion and event ordering.
4. Memory management: Memory management on a
multiprocessor must deal with all of the issues found on
uniprocessor machines. In addition, the operating system
needs to exploit the available hardware parallelism, such as
multiported memories, to achieve the best performance. The
paging mechanisms on different processors must be
coordinated to enforce consistency when several processors
share a page or segment and to decide on page
replacement.
5. Reliability and fault tolerance: The operating system
should provide graceful degradation in the face of processor
failure. The scheduler and other portions of the operating
system must recognize the loss of a processor and
restructure management tables accordingly.
17.6 What is the meaning of each of the four states in the MESI
protocol?
Ans.
Modified: The line in the cache has been modified (different
from main memory) and is available only in this cache.
Exclusive: The line in the cache is the same as that in main
memory and is not present in any other cache.
Shared: The line in the cache is the same as that in main
memory and may be present in another cache.
Invalid: The line in the cache does not contain valid data.
17.9 What are the differences among UMA, NUMA, and CC-NUMA?
Ans.
1. Uniform memory access (UMA): All processors have
access to all parts of main memory using loads and stores.
The memory access time of a processor to all regions of
memory is the same. The access times experienced by
different processors are the same.
2. Nonuniform memory access (NUMA): All processors have
access to all parts of main memory using loads and stores.
The memory access time of a processor differs depending on
which region of main memory is accessed. The last
statement is true for all processors; however, for different
processors, which memory regions are slower and which are
faster differ.
3. Cachecoherent NUMA (CC-NUMA): A NUMA system in
which cache coherence is maintained among the caches of
the various processors.
Chapter 18