hamburger

In Computer Science, Data Hazard occurs when

By BYJU'S Exam Prep

Updated on: September 25th, 2023

Data Hazard occurs due to data dependency. The location must appear executing in the sequential order whenever two different instructions use the same storage. Data hazard producing incorrect results can be eliminated.

Answer: Data Hazard occurs when the execution of an instruction depends on the result of the previous instruction and that result of instruction has not been computed yet.

Data dependencies can be categorized into four types Read after Read (RAR), Write after Write (WAW), Read after Write (RAW), and Write after Read (WAR).

Four types of Data dependency in Data Hazard

The four types of data dependencies have been elucidated below:

  • Read after Read (RAR) hazard does not cause a problem for the processor as reading a register value does not change the register value.

  • Write after Write (WAW) hazard occurs when the output register of an instruction tries to write its result to the same register.

  • Read after Write (RAW) hazard occurs when the value produced by an instruction is required by a subsequent instruction. It is also known as true dependency or flow dependency.

  • Write after Read (WAR) hazard occurs when the output register of an instruction is used immediately after read by a previous instruction.

Summary:

In Computer Science, Data Hazard occurs when

Data hazard occurs when exhibiting data dependence changes data in different stages of a pipeline. There are three types of hazards structural hazards, data hazards, and control hazards.

Read More:

PO, Clerk, SO, Insurance

Our Apps Playstore
POPULAR EXAMS
SSC and Bank
Other Exams
GradeStack Learning Pvt. Ltd.Windsor IT Park, Tower - A, 2nd Floor, Sector 125, Noida, Uttar Pradesh 201303 help@byjusexamprep.com
Home Practice Test Series Premium