3 most sb\4 least sb | 0000 | 0001 | 0010 | 0011 | 0100 | 0101 | 0110 | 0111 | 1000 | 1001 | 1010 | 1011 | 1100 | 1101 | 1110 | 1111 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
000 | NUL | SOH | STX | ETX | EOT | ENQ | ACK | BEL | BS | HT | LF | VT | FF | CR | SO | SI |
001 | DLE | DC1 | DC2 | DC3 | DC4 | NAK | SYN | ETB | CAN | EM | SUB | ESC | FS | GS | RS | US |
010 | SP | ! | " | # | $ | % | & | ' | ( | ) | * | + | , | - | . | / |
011 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | : | ; | < | = | > | ? |
100 | @ | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
101 | P | Q | R | S | T | U | V | W | X | Y | Z | [ | \ | ] | ^ | _ |
110 | ' | a | b | c | d | e | f | g | h | i | j | k | l | m | n | o |
111 | p | q | r | s | t | u | v | w | x | y | z | { | | | } | ~ | DEL |
Symbol | ASCII | ASCII+odd parity | Bit Count |
B | 1000010 | 11000010 | 3 |
C | 1000011 | 01000011 | 3 |
A slightly more robust technique is called the Checksum.
Assume that the message is a sequence of bytes. Before transmission, a Checksum byte or fixed number of bytes is computed and appended to the message. The receiver performs the same calculation on the received message minus the Checksum byte or bytes. This result is checked against the received Checksum and if they agree then it is assumed that the message is error free.
Example:
The Checksum will be one byte. The Checksum calculation will be,Sum the bytes in the message mod 256.
For example, writing the bytes in decimal form:
The Message | 5 9 17 2 |
With Checksum | 5 9 17 2 33 |
Message Received | 7 9 18 2 33 |
5 + 9 + 17 +2 = 33
but
7 + 9 + 18 +2 = 36 ≠ 33