Shop OBEX P1 Docs P2 Docs Learn Events
32 Bit Math — Parallax Forums

32 Bit Math

ArchiverArchiver Posts: 46,084
edited 2000-09-21 17:30 in General Discussion
Does any one have any examples of how to do 32 bit math on a BS2SX...
We need the following functions:

+, -, >>, <<, ^, &

I am assuming that you would perform high order and low order
functions but the BS2 has no access to a "carry" register that I am
aware of. I greatly appreciate any suggestions that you might have.
If it helps the formula i need to implement (in C) is as follows.

n, z, y, sum, k all being 32 bit words.

while(n-->0)
{
z -= (y << 4 ^ y >> 5) + y ^ sum + k[noparse][[/noparse]sum>>11 & 3];
sum -= delta;
y -= (z << 4 ^ z >> 5) + z ^ sum + k[noparse][[/noparse]sum&3];
}

Thank you again

MH

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-09-21 17:24
    Thank you for the help.

    MH

    Original Message
    From: "Tracy Allen" <emesys@c...>
    To: <basicstamps@egroups.com>
    Sent: Thursday, September 21, 2000 12:30 PM
    Subject: [noparse][[/noparse]basicstamps] 32 Bit Math


    > Maybe this will help:
    >
    > http://www.emesystems.com/bs2math6.htm
    >
    > -- Tracy Allen
    > Electronically Monitored Ecosystems
    > http://www.emesystems.com
    >
    >
    >
    > >Does any one have any examples of how to do 32 bit math on a BS2SX...
    > >We need the following functions:
    > >
    > >+, -, >>, <<, ^, &
    > >
    > >I am assuming that you would perform high order and low order
    > >functions but the BS2 has no access to a "carry" register that I am
    > >aware of. I greatly appreciate any suggestions that you might have.
    > >If it helps the formula i need to implement (in C) is as follows.
    > >
    > >n, z, y, sum, k all being 32 bit words.
    > >
    > >while(n-->0)
    > > {
    > > z -= (y << 4 ^ y >> 5) + y ^ sum + k[noparse][[/noparse]sum>>11 & 3];
    > > sum -= delta;
    > > y -= (z << 4 ^ z >> 5) + z ^ sum + k[noparse][[/noparse]sum&3];
    > > }
    > >
    > >Thank you again
    > >
    > >MH
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2000-09-21 17:30
    Maybe this will help:

    http://www.emesystems.com/bs2math6.htm

    -- Tracy Allen
    Electronically Monitored Ecosystems
    http://www.emesystems.com



    >Does any one have any examples of how to do 32 bit math on a BS2SX...
    >We need the following functions:
    >
    >+, -, >>, <<, ^, &
    >
    >I am assuming that you would perform high order and low order
    >functions but the BS2 has no access to a "carry" register that I am
    >aware of. I greatly appreciate any suggestions that you might have.
    >If it helps the formula i need to implement (in C) is as follows.
    >
    >n, z, y, sum, k all being 32 bit words.
    >
    >while(n-->0)
    > {
    > z -= (y << 4 ^ y >> 5) + y ^ sum + k[noparse][[/noparse]sum>>11 & 3];
    > sum -= delta;
    > y -= (z << 4 ^ z >> 5) + z ^ sum + k[noparse][[/noparse]sum&3];
    > }
    >
    >Thank you again
    >
    >MH
Sign In or Register to comment.