The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+3 votes
112 views

difference between data dependency and data hazard?

how many data dependency and data hazard are there in this example?

asked in CO & Architecture by Active (1.5k points) | 112 views

1 Answer

+1 vote

Dependencies in a pipelined processor

There are mainly three types of dependencies possible in a pipelined processor. These are :
1) Structural Dependency
2) Control Dependency
3) Data Dependency

These dependencies may introduce stalls in the pipeline.

Stall : A stall is a cycle in the pipeline without new input.


Data Hazards

Data hazards occur when instructions that exhibit data dependence, modify data in different stages of a pipeline. Hazard cause delays in the pipeline. There are mainly three types of data hazards:

1) RAW (Read after Write) [Flow dependency]
2) WAR (Write after Read) [Anti-Data dependency]
3) WAW (Write after Write) [Output dependency]


Data hazards in Above question.

RAW WAR WAW
 I1-I2 (R1)  I1-I2 (R2)  I1-I4(R1)
 I1-I3(R1)  I1-I3(R3)  
 I2-I3(R2)  I2-I3(R3)  
 I2-I4(R2)  I3-I4(R1)  
  I2-I4(R1)  

ref: http://www.geeksforgeeks.org/computer-organization-and-architecture-pipelining-set-2-dependencies-and-data-hazard/

answered by Loyal (7.5k points)
edited by
0
these are dependencies what will be data hazards and also explain the difference between them please
0
done!
0
Doubt @ Akash:
I2 and I4 are not considered as Anti-Dependency because of R1?
+1
@saxena

edited


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

40,814 questions
47,492 answers
145,719 comments
62,250 users