Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9056019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:05:34+00:00 2026-06-16T14:05:34+00:00

How many stalls do I need to execute the following instructions properly. I am

  • 0

How many stalls do I need to execute the following instructions properly. I am a little confused with what I did, so I am here to see experts answers.

lw $1,0($2);

beq $1,$2,Label;

Note that the check whether the branch will occur or not will be done in decoding stage. But the source register rs of beq which is $1 in this case will be updated after writeback stage of lw instruction. So do we need to forward new data from Memory in memory stage to Decoding stage of beq instruction.

Stage go like this:

enter image description here

IF: Instruction fetching;
ID: Instruction Decoding
Ex: Execution/ALU stage
MEM: reading data from memory
WB: storing data in destination register

This is what I have done so far.

When lw is in exec stage and beq in decoding stage, stalling condition becomes true and a bubble is created. Now lw is in Mem stage and beq is still in decoding stage due to bubble, again the stalling condition has become true and second stall has occured.and now lw is in WB (write back) and beq is in decoding stage but still the value of $1 will update at the end of WB stage which eventually means beq will still work with wrong value of $1.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T14:05:35+00:00Added an answer on June 16, 2026 at 2:05 pm

    looks like you will need a third stall to allow the register to be written back to the register file before decoding, or forward the data from the write-back stage to the decode stage. Either way this should be executed if the register to be written is equal to rs.

    You seem to need too many stalls because the branch is detected early in the decode stage, which is good, because it saves fetching unnecessary instructions that will be flushed anyway, but you must have proper hazard detection to go with that.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How many stalls do I need to execute the following instructions properly. I am
I'm learning about loop unrolling to avoid stalls caused by dependencies. I found many
Many times I found out that I need a software to create simple educational
Many years ago, I did which cd and it told me cd: shell built-in
many Places in the sample code i have seen 2 different way of @synthesize
Many threads have access to summary . Each thread will have an unique key
Many people use this method to add animation on switching views. When I try
Many search engines are not using meta keywords and Google through many recent updates
Many ARIA demonstration websites use code such as: <label for=name id=label-name>Your Name</label> <input id=name
Many methods in the BCL are marked with the [MethodImpl(MethodImplOptions.InternalCall)] attribute. This indicates that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.