For a FFT function I need to permutate or shuffle the elements within an array in a bit-reversed way. That's a common task with FFTs because most power of two sized ... |
I'm trying to take a 16 bit unsigned integer from a structure, mask the first 8 bits of it, and use it as an index to an array with the function ... |
I'm trying to generate a random 160bit string which is supposed to be stored in a character array named str[20]. It's obvious that the array holds 20 characters. How can I ... |
I want to create a very large array on which I write '0's and '1's. I'm trying to simulate a physical process called random sequential adsorption, where units of length 2, ... |
Our OS professor mentioned that for assigning a process id to a new process, the kernel incrementally searches for the first zero bit in a array of size equivalent to the ... |
Am implementing Sieve of Eratosthenes in CUDA and am having a very weird output. Am using unsigned char* as the data structure and using the following macros to manipulate the bits.
#define ...
|
Once again, I have a problem for which I would like to shave off nanoseconds. I have a small, constant array and I would like to search it to see ... |
|
Current direction:
Start with and unsigned char which is 1 Byte on my system using sizeof. Range is 0-255.
If length is the number of bits I need then elements is the ... |
I was reading the C-FAQ question no: 20.8 which basically deals with bit arrays:
http://c-faq.com/misc/bitsets.html
One of the macros defined looks something like:
#define BITNSLOTS(nb) ((nb + CHAR_BIT - 1) / CHAR_BIT)
Is ... |
Hello I have got 2 variabeles in an application the type; typedef guint32 data[8]; -> so 256 bits Now i have a load of data of this type derrived from fileheaders. I want to compare these and get a number of how many bits are set to 1 on the same place. So for Ex with 8 bits data1 : 00110011 ... |
Lets say i have array unsigned long X[4]; Now, i want to shift right bits in the array by 5. that is the lowest 5 bits of element N will become the highest 5 bits of element N-1. the lowest 5 bits of 0th element are lost. what is the best way to do this? My C reference book does not ... |
"ballpointpenthief" wrote in message news:1150845778.357712.283090@b68g2000cwa.googlegr oups.com...[color=blue] > Hello, > I don't seem to be allowed to have arrays of bit fields?[/color] That's right. Not in C. In C++ you can do it by operator overloading. [color=blue] > Are there any ways round this? And what about good ways?[/color] No. But bit sets can give approximately the same functionality: From the ... |
Printing out contents of bit array Hi am trying to read out the contents of my bit array but for some reason it only works for the first byte index. Code: int letterToIndex(char c){ int index=(int)c - (int)'a'; return index; } // a method that converts an integer representation to an alphabet char indexToAlpha(int index){ char c= (char)( (int)('a')+ index); return ... |
No, implemented as you describe, bitwise operators cannot help you. They work on integer types, not arrays of 1s and 0s. You may be able to compact the array so that instead of storing 1s and 0s as presumably whole chars or ints, you could store them as bits that are part of ints or longs, or do similar to the ... |
|
|
|
I am using C with a limited compiler. I am trying store in memory a 2-D array of 64 bit values by 64 bit values - for instance bitArray[64][64]. When I say "64 bit values", I literally mean individual bits '1' and '0'. I can use bit masking on a char (for 8 bits) or int (for 16 bits) on this ... |
Hi, please help in coding for the below requirement: i have an array say 1 to n. i have to allocate my first bit whn required[ through request] thn increment bit again allocate as per requirement[here always it will be 1 bit requirement]. once when my first bit is deallocated after the process again i should allocate the first bit not ... |
Hi! Im doing a GPS application in C using Linux gcc and Eclipse as my developing tool. My problem is to store the ephemerid data transmitted by the satellites and converted by my GPS receiver (Novatel Superstar II) into 30 words, 30 bits/word. I want to store these words in 3 uint32_t arrays, each with 10 "places" so that I later ... |
#include void printbits(char); int main(void) { unsigned char x='B'; printbits(x); return 0; } void printbits(char character) { unsigned char mask =0x80; /*fixed size of mask ; 10000000 */ int i, size; size = (8*sizeof(character) - 1) ; for (i= 0; i<= size ; i++) { printf("%1u", (int)((character & mask) >> (size-i))); /*Shifting this right to make this bit the LSB ... |