aliases | author | created | modified | tags | title |
---|---|---|---|---|---|
Maneesh Sutar |
2023-09-01 |
2024-09-28 |
Error Detection |
Number of bit-errors which are detectable = MHD - 1
Repeat data multiple times during tranmission
Waste of resources
Parity of a binary data is whether the data contains odd number of 1s or an even number of 1s.
A single parity bit provides MHD of 2
So only 1 bit of error detection possible
Image Ref: Ben Eater's video on Checksum
In above example, the whole data is grouped into streams of 8 bits
In VRC, the parity is calculated in the direction of stream of the data
In LRC, the parity is calculated along a bit position of the data
==Hamming distance in both cases is 2==, since that's the best a parity bit can do
If we combine both techniques, hamming distance ==increases to 4 bits==
As the name suggest, we ==check the sum of the data==
- Group all your data into groups of 8 bits
- Add all the groups together
- If the answer has more than 8 bits, roll over the extra bits from MSB till the 8th bit, and add them back into the rest of the answer e.g. if answer of summation is 111010101100, perform ( 10101100 + 00001110 = 10111010 )
- Find 1's complement of the checksum. In above e.g. , its 01000101
- Simply append the checksum to the rest of the message and send.
At receiving end, follow all the steps till step 3.
Since 1's complement of the checksum is present in the message itself, ==the final checksum after step 3, at receiving end, should be all 1==
If it is not, that means there is some error in the message itself, and we need to re-transmit the message
More on this in CRC
CRCs are more robust than checksums.
More on this in Hashing.