a). Three Types
Of Pipeline Hazards
- Structural Hazards: They arise from conflicts
when the hardware cannot support all possible combinations of
instructions in simultaneous overlapped execution.
- Data Hazards: They arise when an instruction
depends on the result of previous instruction in way that is
exposed by overlapping of instructions in the pipeline.
- Control Hazards: They arise from pipelining of
branches and other instructions that change PC.
b).Three Types Of Cache
Misses
- Compulsory Miss: It is also known as cold
start misses or first references misses. These misses occur when
first access to a block happens. Block must be brought into
cache.
- Capacity Miss: These misses occur when the
program working set is much larger than the cache capacity. Since
Cache can not contain all blocks needed for program execution, so
cache discards these blocks.
- Conflict Miss: It is also known as collision
misses or interference misses. These misses occur when several
blocks are mapped to same set or block frame.These misses occur in
set associative or direct mapped block placement strategies.
c).Principle Of
Locality
- It refers to phenomenon in which computer program tends to
access same set of memory locations for particular time period. In
other words, Locality of Reference refers to
tendency of computer program to access instructions whose addresses
are near one another. The property of locality of reference is
mainly shown by loops and subroutine calls in a program.
d).Advantage
And Disadvantage Of The Write Back And Write Through Policy In The
Cache
Advantage->Low latency and high throughput for
write-intensive applications.
Disadvantage->There is data availability risk because cache
could fail before data is persisted to backing store. This result
in data being lost.
Advantage->Ensures fast retrieval while making sure data is
in backing store and is not lost in case the cache is
disrupted.
Disadvantage->Writing data will experience
latency as we have to write to two places every time.