Data hazards in computer architecture, Computer Engineering

Assignment Help:

Data hazards - computer architecture:

A main effect of pipelining is to alter the relative timing of instructions by overlapping their execution. This introduces control hazards  and data.  Data hazards take place  when the pipeline changes the  order of read/write accesses to operands so  that  the order differs from the order seen by in sequence  executing instructions on the un pipelined machine.

Assume the pipelined execution of these instructions:

2262_Data hazards in computer architecture.png

All of the instructions after the ADD instruction use the result of the ADD instruction (in R1). Instruction ADD writes the value of R1 in the WB stage (indicated black), and the SUB instruction reads the value at the time ID stage (ID sub). This difficulty is called a data hazard. Unless safety measures are taken to prevent it, the SUB instruction will read the incorrect value and try to use it.

The AND instruction is also affected by this data hazard. The write of R1 does not finish till the end of cycle 5 (indicated black). Therefore, the AND instruction that reads the registers during cycle 4 (ID and) will receive the incorrect result.

The OR instruction can be made to operate without incurring a hazard by a easy implementation technique. This technique is used to perform register file reads in the second half of the cycle, and writes in the first half. Because  WB  for ADD  both instruction  and ID or for OR are performed in 1 cycle 5, the write to register file by ADD instruction will perform in the first half of the cycle, and the read of registers by OR will perform in the second half of the cycle. The XOR instruction operates correctly, because its register read taken place in cycle 6 after the register write by instruction ADD.

The next page described forwarding, a technique to remove the stalls for the hazard involving the SUB and AND both instructions.

We will also categorize the data hazards and consider the cases when stalls cannot be removed. We will see what compiler can do to schedule the pipeline to ignore stalls.

A hazard is build whenever there is dependence amongst instructions, and they are close sufficient that the overlap caused by pipelining would change the order of access to an operand. Our instance hazards have all been with register operands, but it is also possible to build dependence by reading and writing the similar memory location. In DLX pipeline, though, memory references are always kept in order, prevent this type of hazard from arising.

All the data hazards described here involve registers within the CPU.  By convention, the hazards are named by the ordering in the program that has to be preserved by the pipeline.

797_Data hazards in computer architecture1.png

 


Related Discussions:- Data hazards in computer architecture

Explain working of counters, Q. Explain working of Counters? A counter ...

Q. Explain working of Counters? A counter is a register that goes through a predetermined sequence of states when clock pulse is applied. In principle value of counters is incr

Electronic brokerage facilitate search and retrieval, How does electronic b...

How does electronic brokerage facilitate search and retrieval of information? E Brokerage facilitates search and retrieval of Information: The success aspect of a brokera

Emerging cloud computing technology, A chart illustrating the differences a...

A chart illustrating the differences among the new cloud-based technologies (Workday) and the traditional . a. The new cloud-based solutions benefit Workday from every facet wh

Explain about the history of magento?, Varien, the company that owns Magent...

Varien, the company that owns Magento, formerly worked with osCommerce. They originally planned to discontinue osCommerce but later decided to rewrite it as Magento. Magento formal

Difference between perl and mod_perl, Perl is a language and MOD_PERL is a ...

Perl is a language and MOD_PERL is a module of Apache used to increase the performance of the application.

Define the term intranet, Define the term Intranet. Intranet: An...

Define the term Intranet. Intranet: An Intranet is a type of information system that facilitates communication within the organizations among widely dispersed department

Define relocatable programs, Relocatable programs? Ans. Relocatable pro...

Relocatable programs? Ans. Relocatable programs can be loaded almost anywhere inside the memory.

Define miss rate, Define miss rate? It is the number of misses' states ...

Define miss rate? It is the number of misses' states as a fraction of attempted accesses.

What is assembler, Q. What is Assembler? An assembly program is used to...

Q. What is Assembler? An assembly program is used to transfer assembly language mnemonics to binary code for every instruction after the complete program has been written with

What is arithmetic and logic unit, What is Arithmetic and Logic Unit Ar...

What is Arithmetic and Logic Unit Arithmetic and Logic Unit: The ALU is the 'core' of any processor. It implements all arithmetic operations (addition, multiplication, subtract

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd