detect hazard in MIPS- repost

by brad sue
Tags: detect, hazard, mips, repost
brad sue
brad sue is offline
Nov27-08, 09:43 PM
P: 284
hi please I would some help with the MIPS hazard.


      add $t0, $t0, $v0
      addi $v0, $v0, -1
      bnez $v0, Loop

      li $v0, 4
      la $a0, result

      li $v0, 1
      move $a0, $t0

      b main
I see an hazard at the instructions that are bolded
What I would do is take the underlined instructions and put it like this:
addi $v0, $v0, -1
la $a0, result      
bnez $v0, Loop
Do I get it right? do I miss another hazard?

thank you
Phys.Org News Partner Science news on
Going nuts? Turkey looks to pistachios to heat new eco-city
Space-tested fluid flow concept advances infectious disease diagnoses
SpaceX launches supplies to space station (Update)

Register to reply

Related Discussions
hazard function Set Theory, Logic, Probability, Statistics 3
MIPS help Programming & Computer Science 7
pros and cons of MIPS relative to instruction set choices Electrical Engineering 1
help with MIPS Programming & Computer Science 0
small MIPS programmes Introductory Physics Homework 2