nickagian
Member level 4
- Joined
- Mar 19, 2009
- Messages
- 71
- Helped
- 2
- Reputation
- 4
- Reaction score
- 2
- Trophy points
- 1,288
- Location
- Zurich, Switzerland
- Activity points
- 2,001
Hi to everyone!
I am currently implementing a Gigabit Ethernet Controller and I am quite confused about the order that the data are transmitted, how to compute the CRC and how to transmit it. So, I will give an example so that we have something concrete to talk with.
Suppose that we want to transmit the following data in hex format (they are just dummy, but let's say that they include everything: the header and the real data), represented MSB first:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
First question: Does the transmission follow the above byte order? MS-Byte of the above word is transmitted first and also within bytes the most-significant bit is also transmitted first?
Now if I put the above data in one of the on-line tools for the CRC-32 I get 0xCECEE288
Now comes the second question: Is the above value correct? Because I have read in some websites that for the CRC I should put as input to the crc-generator not "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F" but "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 00 00 00" aka adding 4 bytes of 0x00 at the end of my data. Is that correct? In that case the CRC would be 0x8A6A5071
But now comes also my third question: When I pass my data to the crc-generator, what is the correct order to do it? First should come the MS-Byte or the LS-Byte? Because i.e. here from what I understand the default is to reverse the data bytes first and then compute the CRC. An also this tool gives the same result as the other website.
And lastly: When we come to transmit the crc, we should transmit it as is or LS-Byte first? So essentially "71 50 6A 8A"?
Could anyone help me clarify these things?
I am currently implementing a Gigabit Ethernet Controller and I am quite confused about the order that the data are transmitted, how to compute the CRC and how to transmit it. So, I will give an example so that we have something concrete to talk with.
Suppose that we want to transmit the following data in hex format (they are just dummy, but let's say that they include everything: the header and the real data), represented MSB first:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
First question: Does the transmission follow the above byte order? MS-Byte of the above word is transmitted first and also within bytes the most-significant bit is also transmitted first?
Now if I put the above data in one of the on-line tools for the CRC-32 I get 0xCECEE288
Now comes the second question: Is the above value correct? Because I have read in some websites that for the CRC I should put as input to the crc-generator not "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F" but "00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 00 00 00 00" aka adding 4 bytes of 0x00 at the end of my data. Is that correct? In that case the CRC would be 0x8A6A5071
But now comes also my third question: When I pass my data to the crc-generator, what is the correct order to do it? First should come the MS-Byte or the LS-Byte? Because i.e. here from what I understand the default is to reverse the data bytes first and then compute the CRC. An also this tool gives the same result as the other website.
And lastly: When we come to transmit the crc, we should transmit it as is or LS-Byte first? So essentially "71 50 6A 8A"?
Could anyone help me clarify these things?
Last edited: