![]() |
|
#1
|
|||
|
|||
Hexadecimal Checksum CharactersHi,
I'm currently writing a program that will command a peripheral device by receiving a sentence. In order for it to interpret the sentence it must end with two hexadecimal checksum charaters . The checksum is the hexadecimal representation of the exclusive-or of all the remaining characters in the sentence. At the moment i'm exclusive ORing the remaining characters in the sentence, however, this only gives me a result of one character, i'm unsure what to do. Any guidance would be appreciated. Regards, Andrew |
|
#2
|
|||
|
|||
Re: Hexadecimal Checksum CharactersQuote:
One byte consists of eight bits, which contains two hexadecimal digits. Regards, Dave Last edited by cable_guy_67 : 17-Aug-2006 at 17:07.
Reason: Fixed broken quote tag
|
|
#3
|
||||
|
||||
Re: Hexadecimal Checksum CharactersQuote:
__________________
Gravitation is not responsible for people falling in love. -Albert Einstein |
|
#4
|
|||
|
|||
Re: Hexadecimal Checksum CharactersQuote:
Well, the C and C++ standards say that a char is at least eight bits (they don't talk about bytes). I think the term "byte" originated at IBM a little after the middle of the 20th century. By the time it got into common usage (with the release of the IBM 360, as I recall) it designated an eight-bit quantity. Non-IBM (maybe anti-IBM) people are persnickety about referring to "octets" instead of bytes, and maybe I should have used that term. (But would it have been more clear to the Original Poster? By the same token, instead of hexadecimal digit I could have used the term "semioctet" for the 4-bit thingie that is half of an octet. Some people used to call them "nybbles". Really.) I assume that a byte is always eight bits and has been since about 1964, and it is so commonly used that way that I didn't feel it necessary to define it in-line. Sometimes I think my posts are too wordy anyhow. No, really! Maybe I was a little lax in not defining the terminology, and the fact that the statement that I made is (almost certainly) correct in the context of any computer system that the Original Poster is likely to run across these days is not an excuse for not being more precise. Sometimes I need a little help. (DId I just say "almost certainly correct"? That just doesn't sound right, does it? If it's not always correct, it's not correct. Period.) Thanks for posting. Regards, Dave Last edited by davekw7x : 17-Aug-2006 at 23:12.
|
|
#5
|
||||
|
||||
Re: Hexadecimal Checksum CharactersQuote:
__________________
Age is unimportant -- except in cheese |
|
#6
|
|||
|
|||
Re: Hexadecimal Checksum CharactersQuote:
Regards, Dave |
Recent GIDBlog
Developing GUIs with wxPython (Part 3) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| BIOS checksum error | mohammad | Computer Hardware Forum | 19 | 18-Feb-2008 18:24 |
| Re: Things to Avoid in C/C++ -- gets() , Part 1 | WaltP | C Programming Language | 5 | 21-Jun-2007 12:13 |
| What practical use of Bits and Hexadecimal for C programmer? | Shrikharan | C Programming Language | 1 | 26-Dec-2005 21:29 |
| fast characters in console | svhb | C Programming Language | 10 | 22-Jun-2005 07:13 |
| How to hide characters from being displayed on screen as they are keyed in? | nkhambal | C++ Forum | 8 | 10-Aug-2004 09:22 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The