r/askscience • • Jan 18 '17

Ask Anything Wednesday - Engineering, Mathematics, Computer Science

Welcome to our weekly feature, Ask Anything Wednesday - this week we are focusing on Engineering, Mathematics, Computer Science

Do you have a question within these topics you weren't sure was worth submitting? Is something a bit too speculative for a typical /r/AskScience post? No question is too big or small for AAW. In this thread you can ask any science-related question! Things like: "What would happen if...", "How will the future...", "If all the rules for 'X' were different...", "Why does my...".

Asking Questions:

Please post your question as a top-level response to this, and our team of panellists will be here to answer and discuss your questions.

The other topic areas will appear in future Ask Anything Wednesdays, so if you have other questions not covered by this weeks theme please either hold on to it until those topics come around, or go and post over in our sister subreddit /r/AskScienceDiscussion , where every day is Ask Anything Wednesday! Off-theme questions in this post will be removed to try and keep the thread a manageable size for both our readers and panellists.

Answering Questions:

Please only answer a posted question if you are an expert in the field. The full guidelines for posting responses in AskScience can be found here. In short, this is a moderated subreddit, and responses which do not meet our quality guidelines will be removed. Remember, peer reviewed sources are always appreciated, and anecdotes are absolutely not appropriate. In general if your answer begins with 'I think', or 'I've heard', then it's not suitable for /r/AskScience.

If you would like to become a member of the AskScience panel, please refer to the information provided here.

Past AskAnythingWednesday posts can be found here.

Ask away!

450 Upvotes

304 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jan 20 '17

Offset doesn't sound right to me if you're going into a register and not into memory.

1

u/Afgncaapvaljean Jan 20 '17

It depends on the infrastructure, but there's real advantage to have an offset on something like this. Consider the case where there's no offset. Let's say all my registers currently have useful data. I now need to do a memory write to store the data in one of my registers so that I can give it the value "1", to do an add. Storing to memory costs time and power, and reading the value back in from memory costs MORE time and power, and the case of "add an integer from -32 to 31 to another number" comes up ALL THE TIME in computer programming. Having one of your instructions be a single register add with an offset can be worth it.