MARIE System - Powering Help

Thread Starter

CSITNERD

Joined Dec 16, 2014
7
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.

Thanks in advance.
 

Papabravo

Joined Feb 24, 2006
21,228
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
 

Thread Starter

CSITNERD

Joined Dec 16, 2014
7
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
 

amilton542

Joined Nov 13, 2010
497
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?
 

WBahn

Joined Mar 31, 2012
30,077
Thanks but thats just the basics of it
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?
 

Papabravo

Joined Feb 24, 2006
21,228
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.
 

Thread Starter

CSITNERD

Joined Dec 16, 2014
7
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
 

WBahn

Joined Mar 31, 2012
30,077
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
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?
 

WBahn

Joined Mar 31, 2012
30,077
no constraints, numbers have to be integers, unclear on rest, sorry i'm a newb at this kinda stuff
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.
 

WBahn

Joined Mar 31, 2012
30,077
7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7 x 7
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.
 
Top