HPC Answer Key
HPC Answer Key
2.
a. Flow Dependency (True Dependency)
Flow Dependency is a type of data dependency which occurs when an instruction
depends on the result of a previous instruction. A Flow dependency is also known as
read-after-write (RAW) or data dependency or true dependency, For example:
A=3
B=A
C=B
Anti-Dependency
An anti-dependency is a type of data dependency which occurs when an instruction
requires a value that is updated later. Anti-Dependency is also known as write-after-read
(WAR). In the following example: Instruction 2 anti-depends on instruction 3 — the
ordering of these instructions cannot be changed, nor can they be executed in parallel
(possibly changing the instruction ordering), as this would affect the final value of A.
B=3
A=B+1
B=7
Example:
The first instruction multiply the value of R1 and R2 and write it to R3. And the second
instruction add the value of R5 and R6 and then write it in R2.
B=3
0. C = B
A=C+1
B=7
A new variable, C, has been declared as a copy of B in a new instruction, instruction 0.
As a result the anti-dependency between 2 and 3 has been removed. That means these
instructions may now be executed in parallel. However, the modification has bring a new
dependency. Instruction 2 is now truly dependent on instruction 0. And instruction 0 is
truly dependent on instruction 1. As flow dependencies, these new dependencies are
impossible to safely remove.
Output Dependency
An Output Dependency is a type of data dependency which occurs when the ordering of
instructions affects the final output value of any variable. Output Dependency is also
known as write-after-write (WAW), In the example below, there is an output dependency
between instructions 3 and 1 — changing the order of those instructions in this example
will change the final value of A, thus these instructions cannot be executed in parallel.
B=3
A=B+1
B=7
B=3
A=B+1
C=7
Here, changing the name of variable B to C at 3rd statement removed the output
dependency. But there is still a true dependency which cannot be removed.
All the stages in a uniform delay pipeline will complete their operations by taking
the same time. The cycle time in this pipeline is described as follows:
Cycle Time (Tp) = Stage Delay
If there are buffers between the stages, then the cycle time will be described as
follows:
Cycle time (Tp) = Stage Delay + Buffer Delay
3.
● Let the time to distribute the jobs to k individuals be kq. Observe that this time is
proportional to the number of individuals.
● The time to complete n jobs by a single individuals = np
● The time to complete n jobs by k individuals = kq + np/k
● Speedup due to parallel processing =
B. Drawbacks of MISD: