473,383 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Bitmask question

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

Jul 19 '07 #1
1 2237
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
Jul 19 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andrey Brozhko | last post by:
Hi I need to represent custom type system (ints, bytes, chars, enums, bitmasks, arrays and some other types) in xml. It is easy to see how to represent enums in xml (using xs:enumeration), the...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
3
by: Mark Allison | last post by:
Hi, Total newbie here, I'm trying to examine a bitmask which is passed into my app as a string. I convert it to int, and try and process it. I got the following code: //dbStatus current is a...
5
by: Andy | last post by:
Sigh... working on it for whole day and got no idea... Basically I want to have a bitmask filtering function, I will throw in 3 parameters: bitMaskValue - current bitmask value filterValue -...
0
by: Xah Lee | last post by:
In this article, i explain how the use of bit masks is a hack in many imperative languages. Often, a function will need to take many True/False parameters. For example, suppose i have a function...
3
by: TD | last post by:
Is there a way to DataBind controls to a specific Bit in Bitmask? Here is some sample code of what I am trying to do ... I am trying to bind the Visible and Enabled properties of a Button to...
10
by: lithiumcat | last post by:
Hi, This question seems to come up quite often, however I haven't managed to find an answer relevant to my case. I often use binary flags, and I have alaways used a "bitmask" technique, that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.