Bitmask question

P

Patrick

Hi

I have a basic question concerning rotations and bitmasking.

Assume the following code fragement.

uint32 p_lo[] = { 0x00, 0x00};

for (j = 0; j < 64; j++ )

p_lo[0] <<= (j % 32);

p_lo[1] <<= (j % 32);

p_lo[1] |= (p_hi[0] >> (32 - (j % 32)));
}

I itend to do the following. In each iteration shift each element of
the array by an amount of
n. Additionally, the n-bits that are shifted out of each word should
be the least significant bits of the next higher
word. This I try to do by shifting the lower word by 32 - n positions
to the left and OR then the result
with the next higher word. Unfortunately the output does not make
sense.

Has anyone an idea what I am missing?

Many thanks,
Patrick
 
P

Patrick

Sorry for the multiple posting, I just figured out that there is
something wrong with the google newsgroup interface. Got access
to a newsserver in the meantime!

Cheers,
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Simple Bitmask problem 4
Simple Rotation and bitmasking problem 1
Bitmask vs bitfields 6
First time question 1
TF-IDF 1
Bitmask vs bitfields 10
Minimum Total Difficulty 0
Santa Time : was: Time accuracy in browser 21

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top