Boost logo

Boost :

From: Daryle Walker (darylew_at_[hidden])
Date: 2001-02-23 15:09:12


on 2/22/01 11:20 AM, Joel Young at jdy_at_[hidden] wrote:

> Question on the usage of the crc:
>
> I run the following code:
>
> {
> boost::crc_slow<1> crc_1(1,0,0,false,false);
>
> std::bitset<7> t = 108; //("1101100");
> std::cerr << t << std::endl;
> for (int i=t.size()-1; i>=0; --i)
> crc_1( t.test(i) );
> std::bitset<7> s = *crc_1; //("1101100");
> t |= *crc_1;
> std::cerr << t << std::endl;
> std::cerr << s << std::endl;
> }
>
> And get this result:
>
> 1101100
> 1111100
> 0010000
>
> Indicating that the remainder returned by crc_1 is way to big.
>
> Shouldn't the remainder be only one bit? Or am I misunderstanding the
> process?

It is one bit, but it's not the lowest bit. Since you specified only an
one-bit CRC, the answer should be one or zero. I'll take a look. By the
way, what is the CRC supposed to be?

-- 
Daryle Walker
Mac, Internet, and Video Game Junkie
darylew AT mac DOT com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk