- As a polynomial character vector as ‘z^16 + z^15 + z^2 + 1’ as you specified.
- As a binary row vector containing the coefficients in descending order of powers.For example, for a polynomial x3 + x2 + 1 is represents as [1 1 0 1]
- As an integer row vector containing the powers of nonzero terms in the polynomial, in descending order. For example, [3 2 0] represents the polynomial x3 + x2 + 1
Communication Toolbox General CRC Generator
4 次查看(过去 30 天)
显示 更早的评论
Hello,
I would like to use the General CRC Generator block to generate a CRC16 ANSI.
- It appears that the block is expecting binary input for the message but I am working with messages assembled from uint8 (1 byte). I did not think that binary is a data type in Simulink. How would I manage this?
- How do I set the block for CRC16 ANSI? Anything else other than specifying the polynomial: ?
Any guidance would be appreciated.
Thank you.
0 个评论
回答(2 个)
Ajay Pattassery
2019-8-5
Since your data is an array of integers and the General CRC Generator block expects binary, you could use an integer to bit converter block. You can refer to the following link: Integer to bit
You can set the generator polynomial parameter field to CRC 16 by any of these following ways.
0 个评论
Wess Gates
2019-8-5
1 个评论
Ajay Pattassery
2019-8-6
Hello Wess,
- Yes. Just defining the corresponding polynomial is enough for setting CRC ANSI16.
- https://www.mathworks.com/help/comm/ref/comm.crcgenerator-system-object.html you could refer the MATLAB implementation for more details.
- Unfortunately, there is no built-in block to convert from float to binary in Simulink as of now. You have to create a custom block to accomplish the same. You could refer to the following link for a similar implementation.https://www.mathworks.com/matlabcentral/fileexchange/39113-floating-point-number-conversion (Please keep in mind that this is a 3rd party implementation and may not be tested for all the cases.)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!