01-06-2006 02:41 PM
Thank you everyone for givining me some ideas. What I have been trying to do is calculate a CRC table and this required shift bits to the right location in a 32bit word. This word then would be put into and array. I have looked at the C code closer and found that it doesn't matter if I increment the For loop. Here is what I'm trying to emulate:
DWORD dwpoly = xxxxxxxx;
int i, j;
DWORD dwCRC;
for(i=0; i<256; i++)
{
dwCRC = i;
for (j=8; j>0; j--)
{
if(dwCRC & 1)
dwCRC=(dwCRC >> 1) ^ dwpoly;
else
dwCRC >> 1;
}
dwCRC32table[i] = dwCRC
}
Anyone delt with CRC's?
Thanks again.
Scott
01-06-2006 02:58 PM
There are quite a few CRC programs written in LabVIEW available. For example, have a look at unclebump's attachment in the following thread:
http://forums.ni.com/ni/board/message?board.id=170&message.id=142902#M142902
Maybe whatever you need is all there already. Good luck!
05-03-2017 01:11 PM
This is the decrementing code in C language
#include <stdio.h>
main()
{
int i, n;
printf("Enter n: ");
scanf("%d", &n);
for (i = n; i>=1; i--)
{
printf("\n%d", i);
}
getch();
}
05-03-2017 01:15 PM
WilliamJwow,
1. This is a LabVIEW board
2. This thread is over 11 years old
Just saying your first post is completely irrelevant. Have a nice day!
05-03-2017 01:16 PM
Hmmmm....
Comparing ....
@WilliamJwow wrote:
This is the decrementing code in C language
#include <stdio.h>
main()
{
int i, n;
printf("Enter n: ");
scanf("%d", &n);
for (i = n; i>=1; i--)
{
printf("\n%d", i);
}
getch();
}
with
I think I will stick with LabVIEW. Thank you for reminding how painful it was to code in C.
Ben