<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by SHRUTIKA GADE on Medium]]></title>
        <description><![CDATA[Stories by SHRUTIKA GADE on Medium]]></description>
        <link>https://medium.com/@shrutika.gade22?source=rss-a3eb6f78fc16------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*wvVdM-0wvWhW-yYr</url>
            <title>Stories by SHRUTIKA GADE on Medium</title>
            <link>https://medium.com/@shrutika.gade22?source=rss-a3eb6f78fc16------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:00:48 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@shrutika.gade22/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Pipeline Hazards]]></title>
            <link>https://medium.com/@shrutika.gade22/pipeline-hazards-f6c317824b9f?source=rss-a3eb6f78fc16------2</link>
            <guid isPermaLink="false">https://medium.com/p/f6c317824b9f</guid>
            <category><![CDATA[pipe-lining]]></category>
            <category><![CDATA[pipeline]]></category>
            <dc:creator><![CDATA[SHRUTIKA GADE]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 17:00:55 GMT</pubDate>
            <atom:updated>2023-02-08T17:00:55.593Z</atom:updated>
            <content:encoded><![CDATA[<p>Pipelining is the process of collecting instructions from a processor using a pipeline. It allows you to save and execute instructions through a systematic process. It is also called pipeline processing.</p><p>Pipe installation is the method by which many instructions are concealed during execution. The pipe is divided into sections and these sections are connected to each other to form a pipe-like structure. Commands come in and out of another.</p><p>The pipeline is the method by which many instructions are concealed during execution. The pipeline is divided into stages and these stages are connected to each other to form a pipe-like structure. Instructions come in from one end of the pipe and out of another end. It increases the total instruction throughput.</p><p>In the pipeline system, each segment contains an input register followed by a combinational circuit. The register is used to hold data and the combinational circuit performs functions on it. The output of the combinational circuit is used in the input register of the next segment.</p><p>The pipeline is like setting up a modern line in a factory. For example, in the automotive industry, large connecting lines are formed and at each location, there are robotic arms to perform a specific task, and the car moves on to the next arm.</p><h4>TYPES OF PIPELINING</h4><p>In 1977 Handler and Ramamoorthy separated piping processors according to their performance.</p><p>1. Arithmetic Pipelining</p><p>Arithmetic Pipelining is designed to calculate the addition, multiplication, and division of a floating-point with high speed. Here, many arithmetic logic units are built into the system to perform parallel arithmetic calculations in a variety of data formats. Examples of arithmetic pipelined processors are Star-100, TI-ASC, Cray-1, and Cyber-205.</p><p>2. Instruction Pipelining</p><p>Here, a number of instructions are pipelined and the execution of the current instruction overlaps the execution of the next instruction. It is also known as instruction lookahead.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*TUZs3AHdaTR3Kddlodq5YA.png" /><figcaption>Pipelining</figcaption></figure><h4>PIPELINE HAZARDS</h4><p>Whenever a pipeline must stop because of some reason it is called pipeline hazards.</p><p>We rightly expect 1 CPI value and speedup equal to stages number in the pipeline. But there are a few factors that limit this. Hazards are problems that occur in the pipeline. Rising hazards in the pipeline prevent the subsequent instruction from executing during its fixed clock cycle. Hazards reduce the performance from the ideal speedup gained by pipelining.</p><p>There are mainly three types of hazards:</p><p>1. Data hazards</p><p>2. Control hazards</p><p>3. Structural hazards</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/616/1*6hAjPf_NlPQzwYY0r6QtPg.png" /><figcaption>Types of Pipeline Hazards</figcaption></figure><h4>DATA HAZARDS</h4><p>When an instruction is dependent on the outcome of a preceding instruction, and the previous instruction’s result has not yet been computed, data hazards occur. whenever the same storage is used by two separate instructions. The location must appear to be executed in the correct sequence.</p><p>There are four types of Data Hazards:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/582/1*-mLukbjbeS20o5OpA-_j2Q.png" /><figcaption>Data Hazards</figcaption></figure><p><strong>1)</strong> <strong>Read after Write (RAW): </strong>True dependency or Flow dependency are other terms for RAW. It happens when a value generated by one instruction is required by another instruction.</p><p>For example,</p><p>These hazards need the use of stalls.</p><p>ADD R1, — , — ;</p><p>SUB — , R1, — ;</p><p><strong>2)</strong> <strong>Write after Write (WAW): </strong>Output dependency is sometimes known as WAW. These hazards arise when an instruction’s output register is used for writing after it has been written by a previous instruction.</p><p>For example,</p><p>ADD R1, — , — ;</p><p>SUB R1, — , — ;</p><p><strong>3)</strong> <strong>Write after Read (WAR): </strong>Anti-dependency is often known as WAR. These hazards arise when an instruction’s output register is used after it has been read by a previous instruction.</p><p>For example,</p><p>ADD — , R1, — ;</p><p>SUB R1, — , — ;</p><p><strong>4)</strong> <strong>Read after Read (RAR): </strong>When two instructions read from the same register, RAR occurs. For example,</p><p>ADD — , R1, — ;</p><p>SUB — , R1, — ;</p><p>These Read after Read (RAR) hazards do not present an issue for the processor because reading a register value does not modify the register value.</p><h4>Data Hazards Handling:</h4><p><strong>1)</strong> <strong>Forwarding: </strong>It modifies the pipeline by adding special circuitry. This method works because the required values take less time to go via a wire than a pipeline segment does to compute its result.</p><p><strong>2)</strong> <strong>Code Reordering: </strong>Reordering code necessitates the use of specialized software. A hardware-dependent compiler is the name for this type of software.</p><p><strong>3)</strong> <strong>Stall Insertion: </strong>This method inserts one or more installs (no-op instructions) into the pipeline, delaying execution of the current instruction until the required operand is written to the register file. However, this method reduces pipeline efficiency and throughput.</p><h4>CONTROL HAZARDS</h4><p>Control hazard occurs when the pipeline generates incorrect branch prediction decisions, resulting in instructions entering the pipeline that must be discarded.</p><p>Stalling the pipeline until the branch decision is made is one of the strategies for dealing with the control hazard. The pipeline should have to be stopped for cycles at every branch because of the decision made in the Memory stages. The system’s performance and consistency would be severely harmed as a result.</p><p>Another technique is to predict whether the branch will take and start executing instructions depending on the predicted data. If the prediction was incorrect, the processor can discard the instructions once the branch decision is ready.</p><p>Assume that the predicted branch is not taken, and that the program is simply executed in sequence. The instructions after the branch must be rejected by clearing the registers for those instructions if the branch should have been taken. The branch misprediction penalty refers to these instruction cycles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/879/1*i4KoOqnby2LsSVi4tuvxPQ.png" /><figcaption>Control Hazards</figcaption></figure><p>The approaches for dealing with control hazards stalling are as follows:</p><p>1. Create a stall cycle for each branch.</p><p>2. Assume the branch is not taken and proceed to the next instruction; if the branch is taken, hardware to cancel the effect of the wrong path instruction is required.</p><p>3. If the prediction is incorrect, fetch the next PC instruction, cancelling the effect of the incorrect path instruction.</p><p>4. Fetch the next instruction and execute it anyway; if the instruction is on the correct path, useful work was done; if the instruction is on the incorrect path, hopefully no program state is lost.</p><h4>STRUCTURAL HAZARDS</h4><p>Structural Hazards occurs when two instructions request the same hardware resource at the same time, causing the pipeline to halt for one of the instructions.</p><p>The most common scenario is when two instructions access memory at the same time. While other instructions are being fetched, one instruction may need to access memory as part of the Execute or Write back phase. If both the instructions and the data are stored in the same memory, this is the case. Both instructions cannot run at the same time, so one must wait until the other completes the memory access portion. As a result, significant hardware resources are required to avoid structural dangers in general.</p><p>If there were no distinct data and instruction caches, a structural hazard would arise from memory access for instruction fetch and memory access for data:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*ZLqqA0tC7hNIZfFkgo5wuw.png" /><figcaption>Structural Hazards-01</figcaption></figure><p>When decoding (setting up input registers) refers to the same register as a register write, this is an example of a structural hazard:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*daW1l2IWhx0VZpFUhIZljA.png" /><figcaption>Structural Hazards-02</figcaption></figure><h4>CONCLUSION</h4><p>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. Simultaneous execution of more than one instruction takes place in a pipelined processor. Pipeline hazards are situations that prevent the next instruction in the instruction stream from executing during its designated clock cycles. Any condition that causes a stall in the pipeline operations can be called a hazard. Here we discussed three types of pipeline hazards — Data hazards, Control hazards, Structural hazards. Structural hazards happen because there are not enough duplication of resources and they must be handled at design time itself. Data hazards happen because of true data dependences and name dependences. Control hazards are caused by branches. Techniques to deal and prevent the hazard problem such as, by giving stalls is also discussed in this case study.</p><h4>REFERENCES</h4><p>https:/<a href="http://www.cs.umd.edu/~meesh/411/CA-online/chapter/pipeline-hazards/index.html">/www.cs.umd.edu/~meesh/411/C</a>A<a href="http://www.cs.umd.edu/~meesh/411/CA-online/chapter/pipeline-hazards/index.html">-online/chapter/pipeline-hazards/index.html</a></p><p><a href="https://witscad.com/course/computer-architecture/chapter/pipeline-hazards">Pipeline Hazards | Computer Architecture</a></p><p>https:/<a href="http://www.javatpoint.com/dependencies-and-data-hazard-in-pipeline-in-computer-">/www.javatpoint.com/dependencies</a>-<a href="http://www.javatpoint.com/dependencies-and-data-hazard-in-pipeline-in-computer-">and-data-hazard-in-pipeline-in-computer-</a> organization</p><p><strong>Researched and Compiled By: Vishwakarma Institute of Technology, Pune</strong></p><p><strong>CS-SEDA Group-01 (</strong><a href="https://medium.com/u/ad1a2baa4c57"><strong>Dr. S. T. Patil</strong></a>, <a href="https://medium.com/u/f6200427a2ce">Vaishnavi Arthamwar</a>, <a href="https://medium.com/u/7261315acfd1">Mayur Khadde</a>, <a href="https://medium.com/u/bea2a78bf252">Palak Pardeshi</a>, <a href="https://medium.com/u/a3eb6f78fc16">SHRUTIKA GADE</a>, <a href="https://medium.com/u/bb3ccdd70d11">Gouravsuram</a>)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f6c317824b9f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>