1

Im studying for my microprocessors exam at the moment and I've come across this question: In relation to the below code:

beq    $1,$2, TARGET
lw     $3, 40($4)
add    $3, $3, $3 
sw     $3, 40($4)
TARGET: or  $10,$11,$12

Assume the branch resolution takes place in the MEM stage. Can a Stall and a flush happen simultaneously? If so what are the consequences?

I know that MIPS is RISC based so the only answer I can come up with is that it can't as we can't do more than one instruction at a time. The "TARGET" part of the code is fetching from registers so we do not need a stall here as far as I know. I'm an engineering student and we haven't done much computer science stuff sorry.

Has our lecturer given us a trick question?

cjjones1
  • 11
  • 1

0 Answers0