General arithmetic with memory

Interested in Robotics? Here's the place to be.
Post Reply
hlreed
Posts: 349
Joined: Wed Jan 09, 2002 1:01 am
Location: Richmond, TX
Contact:

General arithmetic with memory

Post by hlreed »

We have had Out = Out + In
That can be extended.
Out = Out + In1 f In2 ;where f is any arithmetic operator.<p>MP = MP + I1 + I2
MM = MP + I1 - I2
MO = MO + MAX(I1,I2)
MA = MA + MIN(I1,I2)<p>Interesting to note that MP + MM = 0 and
MO + MA = MP<p>General code, with Out, In and Ref is:<p>BEGIN Marith
1. Out = 0 ; initialize Out
Loop
2. Read In
3. Read Ref
4. Out = Out + In f Ref
5. Write Out
6. Go to Loop ;what makes this work
END Marith<p>Here is a tree:
O1 = O1 + A + B
O2 = O2 + C + D
O3 = O3 + O1 + O2
So O3 = O3 + O2 + O1 <p>These are not conditional. Feed in a one and you get a count. Takes a computer to do these. Have a spread sheet if you ask.
Harold L. Reed
Microbes got brains
Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests