ACA Assignment 4
ACA Assignment 4
Model Paper
UNIT – 1
Organizational Structure
Interconnection Network
UNIT – 2
The Cache Coherence Problem is the challenge of keeping multiple local caches
synchronized when one of the processors updates its local copy of data which is
shared among multiple caches.
Imagine a scenario where multiple copies of same data exists in different caches
simultaneously, and if the processors are allowed to update their own copies freely,
an inconsistent view of memory can result.
2) 4-Way Interleaved - Four memory blocks are accessed at the same time.
CISC Processor
It is known as Complex Instruction Set Computer.
Volatile Memory: This loses its data, when power is switched off.
Non-Volatile Memory: This is a permanent storage and does not lose
any data when power is switched off.
UNIT – 3
a. What is pipelining.
Answer- Pipelining is the process of accumulating instruction from the processor through a
pipeline. It allows storing and executing instructions in an orderly process. It is also
known as pipeline processing.
Pipelining is a technique where multiple instructions are overlapped during
execution. Pipeline is divided into stages and these stages are connected with one
another to form a pipe like structure. Instructions enter from one end and exit from
another end.
Pipelining increases the overall instruction throughput.
In pipeline system, each segment consists of an input register followed by a
combinational circuit. The register is used to hold data and combinational circuit
performs operations on it. The output of combinational circuit is applied to the input
register of the next segment.
Registers are used for storing the intermediate results between the above
operations.
Instruction Pipeline
In this a stream of instructions can be executed by
overlapping fetch, decode and execute phases of an instruction cycle. This type of
technique is used to increase the throughput of the computer system.
An instruction pipeline reads instruction from the memory while previous
instructions are being executed in other segments of the pipeline. Thus we can
execute multiple instructions simultaneously. The pipeline will be more efficient if
the instruction cycle is divided into segments of equal duration.
c. Define the term collision vector & state diagrams.
Answer – Collision vector - As the pipeline becomes more complicated, we can use a
collision vector to analyze the pipeline and control initiation of execution. The
collision vector is a method of analyzing how often we can initiate a new operation
into the pipeline and maintain synchronous flow without collisions. We construct the
collision vector by overlaying two copies of the reservation table, successively
shifting one clock to the right, and recording whether or not a collision occurs at that
step. If a collision occurs, record a 1 bit, if a collision does not occur, record a 0 bit.
For example, our reservation table would result in the following collision vector:
Using the collision vector, we construct a reduced state diagram to tell us when we
can initiate new operations.
State Diagram - The Reduced State Diagram The reduced state diagram is a way to
determine when we can initiate a new operation into the pipeline and avoid
collisions when some operations are already in process in the pipeline.
1. Functional units can access the result of any operation without involving a
floating-point-register, allowing multiple units waiting on a result to proceed
without waiting to resolve contention for access to register file read ports.
2. Hazard Detection and control execution are distributed. The reservation
stations control when an instruction can execute, rather than a single
dedicated hazard unit.
Instruction order
Instructions are issued sequentially so that the effects of a sequence of instructions,
such as exceptions raised by these instructions, occur in the same order as they
would on an in-order processor, regardless of the fact that they are being executed
out-of-order (i.e. non-sequentially).
Register renaming
Tomasulo's Algorithm uses register renaming to correctly perform out-of-order
execution. All general-purpose and reservation station registers hold either a real
value or a placeholder value. If a real value is unavailable to a destination register
during the issue stage, a placeholder value is initially used. The placeholder value is a
tag indicating which reservation station will produce the real value. When the unit
finishes and broadcasts the result on the CDB, the placeholder will be replaced with
the real value.
Each functional unit has a single reservation station. Reservation stations hold
information needed to execute a single instruction, including the operation and the
operands. The functional unit begins processing when it is free and when all source
operands needed for an instruction are real.
Exceptions
Practically speaking, there may be exceptions for which not enough status
information about an exception is available, in which case the processor may raise a
special exception, called an "imprecise" exception. Imprecise exceptions cannot
occur in in-order implementations, as processor state is changed only in program
order (see RISC Pipeline Exceptions).
Programs that experience "precise" exceptions, where the specific instruction that
took the exception can be determined, can restart or re-execute at the point of the
exception. However, those that experience "imprecise" exceptions generally cannot
restart or re-execute, as the system cannot determine the specific instruction that
took the exception.
UNIT – 4
Cache is a random access memory used by the CPU to reduce the average time taken
to access memory.
Multilevel Caches is one of the techniques to improve Cache Performance by
reducing the “MISS PENALTY”. Miss Penalty refers to the extra time required to bring
the data into cache from the Main memory whenever there is a “miss” in cache.
For clear understanding let us consider an example where CPU requires 10 Memory
References for accessing the desired information and consider this scenario in the
following 3 cases of System design:
Case 1 : System Design without Cache Memory
d. Explain the cache inconsistency problem in multi computer and how snoopy protocol can be used
In a multiprocessor system, data inconsistency may occur among adjacent levels or within
the same level of the memory hierarchy. For example, the cache and the main memory may
have inconsistent copies of the same object.
As multiple processors operate in parallel, and independently multiple caches may possess
different copies of the same memory block, this creates cache coherence problem. Cache
coherence schemes help to avoid this problem by maintaining a uniform state for each
cached block of data.
Let X be an element of shared data which has been referenced by two processors, P1 and
P2. In the beginning, three copies of X are consistent. If the processor P1 writes a new data
X1 into the cache, by using write-through policy, the same copy will be written immediately
into the shared memory. In this case, inconsistency occurs between cache memory and the
main memory. When a write-back policy is used, the main memory will be updated when
the modified data in the cache is replaced or invalidated.
In general, there are three sources of inconsistency problem −
Snoopy protocols achieve data consistency between the cache memory and the shared
memory through a bus-based memory system. Write-invalidate and write-update policies
are used for maintaining cache consistency.
In this case, we have three processors P1, P2, and P3 having a consistent copy of data
element ‘X’ in their local cache memory and in the shared memory (Figure-a). Processor P1
writes X1 in its cache memory using write-invalidate protocol. So, all other copies are
invalidated via the bus. It is denoted by ‘I’ (Figure-b). Invalidated blocks are also known
as dirty, i.e. they should not be used. The write-update protocol updates all the cache
copies via the bus. By using write back cache, the memory copy is also updated (Figure-c).
UNIT – 5
Answer – Critical Section - A Critical Section is a code segment that accesses shared
variables and has to be executed as an atomic action. It means that in a group of
cooperating processes, at a given point of time, only one process must be executing
its critical section. If any other process also wants to execute its critical section, it
If the machine has the capability of causing an interrupt after a specified time
interval, then the operating system will execute each program for a given length of
time, regain control, and then execute another program for a given length of time,
and so on. In the absence of this mechanism, the operating system has no choice but
to begin to execute a program with the expectation, but not the certainty, that the
program will eventually return control to the operating system.
If the machine has the capability of protecting memory, then a bug in one program is
less likely to interfere with the execution of other programs. In a system without
memory protection, one program can change the contents of storage assigned to
other programs or even the storage assigned to the operating system. The resulting
system crashes are not only disruptive, they may be very difficult to debug since it
may not be obvious which of several programs is at fault.
Answer - In synchronous message passing, the components are processes, and processes
communicate in atomic, instantaneous actions called rendezvous. If two processes are to
communicate, and one reaches the point first at which it is ready to communicate, then it
stalls until the other process is ready to communicate. “Atomic” means that the two
processes are simultaneously involved in the exchange, and that the exchange is initiated
and completed in a single uninterruptable step. Examples of rendezvous models include
Hoare’s communicating sequential processes (CSP) [30] and Milner’s calculus of
communicating systems (CCS) [49]. This model of computation has been realized in a
number of concurrent programming languages, including Lotos and Occam. Rendezvous
models are particularly well matched to applications where resource sharing is a key
element, such as client-server database models and multitasking or multiplexing of
hardware resources. A key weakness of rendezvous-based models is that maintaining
determinacy can be difficult. Proponents of the approach, of course, cite the ability to
model no determinacy as a key strength.
Rendezvous models and PN both involve threads that communicate via message passing,
synchronously in the former case and asynchronously in the latter. Neither model
intrinsically includes a notion of time, which can make it difficult to interoperate with
models that do include a notion of time. In fact, message events are partially ordered,
rather than totally ordered as they would be where they placed on a time line.
Both models of computation can be augmented with a notion of time to
promote interoperability and to directly model temporal properties (see, for example, [50]).
In the Pamela system [51], threads assume that time does not advance while they are
active, but can advance when they stall on inputs, outputs, or explicitly indicate that time
can advance. By this vehicle, additional constraints are imposed on the order of events, and
determinate interoperability with timed models of computation becomes possible. This
mechanism has the potential of supporting low-latency feedback and configurable
hardware.
d. Classify language feature for parallelism.
1. Expressiveness
2. Reliability
3. Security
4. Verifiability.
(1) Expressibility of behaviours: with only three simple processing units, every
finite-state behaviour can be constructed.
Parallel forms reliability (also called equivalent forms reliability) uses one set of
questions divided into two equivalent sets (“forms”), where both sets contain
questions that measure the same construct, knowledge or skill.
This paper presents a set of language features for describing processes and
process interaction, gives examples of their use, and briefly discusses their
relation to the goals. Two constructs, resources and protected variables, are
introduced as the mechanisms for describing interaction. Resources are
extensions of the monitor concept of Hoare; protected variables are global
variables which can only be accessed by one process at a time. Two types of
access control are introduced: restrictions on scope rules for static access,
and capabilities for dynamic access. Examples include the interface to
machine devices, files and virtual devices, device scheduling, device
reservation, and buffer allocation.