Communications Blockset    
General CRC Generator

Generate cyclic redundancy code (CRC) bits according to the generator polynomial and append them to the input data frames.

Library

CRC sublibrary of Error Correction and Detection

Description

The General CRC Generator block generates cyclic redundancy code (CRC) bits for each input data frame and appends them to the end of the frame. You specify the generator polynomial for the CRC algorithm by the Generator polynomial parameter in the block's mask. You represent the polynomial in either of two ways:

For a more detailed description of the CRC algorithm, see the section "Cyclic Redundancy Check Coding."

You specify the initial state of the internal shift register by the Initial states parameter in block's mask. The Initial states parameter is either a scalar or a binary row vector of length equal to the degree of the generator polynomial. A scalar value is expanded to a row vector of length equal to the degree of the generator polynomial. For example, the default initial state of [0] is expanded to a row vector of all zeros.

You specify the number of checksums that the block calculates for each input frame by the Checksums per frame parameter. The Checksums per frame value must divide the size of the input frame. If the value of Checksums per frame is k, the block does the following:

  1. Divides each input frame into k subframes of equal size
  2. Prefixes the Initial states vector to each of the k subframes
  3. Applies the CRC algorithm to each augmented subframe
  4. Appends the resulting checksums at the end of each subframe
  5. Outputs concatenated subframes

If the size of the input frame is m and the degree of the generator polynomial is r, the output frame has size m + k*r.

For example, suppose the size of the input frame is 10, the degree of the generator polynomial is 3, Initial states is set to [0], and Checksums per frame is set to 2. The block divides each input frame into two subframes of size 5 and appends a checksum of size 3 to each subframe, as shown in the following figure. The initial states are not shown in this example, because an initial state of [0] does not affect the output of the CRC algorithm. The output frame then has size 5 + 3 + 5 + 3 = 16.

Signal Attributes

The General CRC Generator block has one input port and one output port. Both ports allow only frame-based binary column vectors.

Dialog Box

Generator polynomial
A binary or integer row vector specifying the generator polynomial, in descending order of powers.
Initial states
Binary scalar or a binary row vector of length equal to the degree of the generator polynomial, specifying the initial state of the internal shift register.
Checksums per frame
Positive integer specifying the number of checksums the block calculates for each input frame.

Pair Block

General CRC Syndrome Detector

See Also

CRC-N Generator, CRC-N Syndrome Detector


  General Block Interleaver General CRC Syndrome Detector