CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

CRC calculate

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
ertansuluagac



Joined: 13 Jul 2017
Posts: 135
Location: IZMIR

View user's profile Send private message Send e-mail

CRC calculate
PostPosted: Thu May 23, 2019 4:18 am     Reply with quote

Hello there;
How's the CRC calculation? Does anyone knows?
So the result of this process is, how 16 turns out.
Code:

0x01^0x03^0x52^0x4B^0D = 0x16

_________________
Es
temtronic



Joined: 01 Jul 2010
Posts: 9099
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu May 23, 2019 4:48 am     Reply with quote



Last edited by temtronic on Thu May 23, 2019 8:18 pm; edited 1 time in total
gaugeguy



Joined: 05 Apr 2011
Posts: 288

View user's profile Send private message

PostPosted: Thu May 23, 2019 5:59 am     Reply with quote

This cannot overflow. ^ is XOR, which returns the same size it takes.

When I run through this on the calculator using hex values and XOR I get 0x16 as the result.
gaugeguy



Joined: 05 Apr 2011
Posts: 288

View user's profile Send private message

PostPosted: Thu May 23, 2019 6:07 am     Reply with quote

0x01 ^ 0x03 = 0x02
0x02 ^ 0x52 = 0x50
0x50 ^ 0x4B = 0x1B
0x1B ^ 0x0D = 0x16
dluu13



Joined: 28 Sep 2018
Posts: 395
Location: Toronto, ON

View user's profile Send private message Visit poster's website

PostPosted: Thu May 23, 2019 9:16 am     Reply with quote

I'm not sure if you are just trying to "understand" CRC calculation, or to implement CRC calculation. However, if you only want to implement it, there is a crc calculator in the drivers folder from CCS.
Ttelmah



Joined: 11 Mar 2010
Posts: 19216

View user's profile Send private message

PostPosted: Thu May 23, 2019 10:46 am     Reply with quote

and (of course), simple XOR, is not a terribly 'good' CRC. A proper CRC
calculation is always trying to make the resulting number unlikely to 'repeat'.
Ideally a 16bit CRC want to have only a 1 in 65536 chance of giving the
same value for a different incoming sequence.
XOR is a 'cheap' CRC used on some basic transmissions. Usually involving
only a few bytes.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group