# MARIE System - Powering Help

Discussion in 'Homework Help' started by CSITNERD, Dec 16, 2014.

1. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
For my assignment I have to use the MARIE system to create a simulation that will power two numbers together. So far I have done it so that it multiplies two numbers together but getting them to power each other is the hard part.

2. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
Forget the use of MARIE for the time being. Would you have a clue about how to raise a number a, to a power b?

$a^b = \text??$

If the answer is no, then you might want to research two different topics:
1. Logarithms
2. Power Series

3. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
Thanks for the help but its the MARIE simulator program that I'm having trouble with and my lack of knowledge on how I would do it

4. ### MikeML AAC Fanatic!

Oct 2, 2009
5,451
1,066
Look what less than 15sec with Google found... BTW: until reading this posting, I had never heard of Marie...

5. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
Thanks but thats just the basics of it

6. ### amilton542 Active Member

Nov 13, 2010
494
64
MARIE, it sounds like some Daddy's girl you'd meet at a local park.

I can see where you're your coming from. Knowledge of MATLAB, for me, was an educational conquest in its own right. But that's another story. Is there not a book you could consult?

7. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
You aren't giving us much to go on. Your first post indicated that "powering two numbers together" was the issue. Frankly, I have no idea what it means for two numbers to "power each other". Like Papabravo, I'm assuming that you mean that, given two numbers 'a' and 'b', you want to find 'y' such that y=a^b ('a' raised to the 'b' power). Is that correct? But when he suggested a couple of things to look at to understand how to raise one number by another, you said that that wasn't the issue and that the problem was MARIE. But when pointed to a reference for MARIE, you say that that isn't what you want.

So what is it that you DO want? What is the specific problem you are having?

It would also help to know a bit more about the task. Are 'a' and 'b' integers or floating point values? Can one or the other or both be negative?

8. ### Papabravo Expert

Feb 24, 2006
10,340
1,850
You can become an overnight MARIE guru and you still won't have the slightest idea how to evaluate the power function. You really should put the horse before the cart, but if you don't want my help that's OK too. I feel like the following:

When in trouble,
Or in doubt;
Run in circles,
Scream and shout.

9. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
Sorry guys, im still stressing over this. You input two numbers for example into the marie simulator for example 3 and 3. The solution that would be expected would be 3 x 3 x 3 (27) which is the code i am trying to create

10. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
The best place to start with low-level stuff like this is to make sure that you know how you would do it by hand. So if asked to evaluate, say, 7^11 how would you do it? Keep in mind that the next question, at least in general, would be how to do 1453^2896 by hand.

We still need to know the constraints? Are the two numbers integers? How many bits? Can they be signed? What is the allowed representation for the result?

11. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
no constraints, numbers have to be integers, unclear on rest, sorry i'm a newb at this kinda stuff

12. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
Okay,

So what should your code produce if the two numbers I give it are -3 and -3? Both of those are integers.

The most important step in solving a problem is to fully understand the problem.

13. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
The grading isn't too picky, as long as two positive integers work it would be fine, thanks in advance

14. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
Okay. So, once again, how would you do 7^11 by hand?

15. ### CSITNERD Thread Starter New Member

Dec 16, 2014
7
0
7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7

16. ### WBahn Moderator

Mar 31, 2012
18,087
4,917
That's what I thought. And maybe for this assignment that's good enough -- I don't know. But think about how you would extend this to 1453^2896. Would you want to tackle that using your approach? If you are SURE that repeated multiplication is acceptable for this assignment, then the next step is to write an algorithm (step-by-step procedure) to perform a^b. An option would be to write (and preferably test) an implementation in a high-level language you are familiar with. By developing the algorithm separate from the assembly language (and a particular assembler) you are able to focus on the logic first and then, once that is polished, to focus on the details of the implementation.