Communications Blockset | ![]() ![]() |
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:
[1 1 0 1]
represents the polynomial x3 + x2 + 1.
[3 2 0]
represents the polynomial x3 + x2 + 1.
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:
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
Pair Block
See Also
CRC-N Generator, CRC-N Syndrome Detector
![]() | General Block Interleaver | General CRC Syndrome Detector | ![]() |