0% found this document useful (0 votes)
8 views

Java Programs

The document discusses error detecting codes using CRC-CCITT (16-bits). It explains how CRC calculations work by treating data as a binary number, dividing it by a value, and using the remainder as the CRC. The CRC can detect multiple bit errors and is fast to calculate, especially with dedicated hardware. It also provides an example of calculating the CRC remainder for the character 'm' divided by 19 and discusses how CRC works by appending zeros and dividing the message by a generator polynomial to get the checksum remainder.

Uploaded by

nuhayd.m.k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Java Programs

The document discusses error detecting codes using CRC-CCITT (16-bits). It explains how CRC calculations work by treating data as a binary number, dividing it by a value, and using the remainder as the CRC. The CRC can detect multiple bit errors and is fast to calculate, especially with dedicated hardware. It also provides an example of calculating the CRC remainder for the character 'm' divided by 19 and discusses how CRC works by appending zeros and dividing the message by a generator polynomial to get the checksum remainder.

Uploaded by

nuhayd.m.k
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Write a program for error detecting code using

CRC-CCITT (16- bits).


Whenever digital data is stored or interfaced, data corruption might occur. Since the
beginning of computer science, developers have been thinking of ways to deal with this type
of problem. For serial data they came up with the solution to attach a parity bit to each sent
byte. This simple detection mechanism works if an odd number of bits in a byte changes, but
an even number of false bits in one byte will not be detected by the paritycheck. To
overcome this problem developers have searched for mathematical sound mechanisms to
detect multiple false bits. The CRC calculation or cyclic redundancy check was the result of
this. Nowadays CRC calculations are used in all types of communications. All packets sent
over a network connection are checked with a CRC. Also each data block on your hard disk
has a CRC value attached to it. Modern computer world cannot do without these CRC
calculations. So let's see why they are so widely used. The answer is simple; they are
powerful, detect many types of errors and are extremely fast to calculate especially when
dedicated hardware chips are used.

The idea behind CRC calculation is to look at the data as one large binary number. This number is
divided by a certain value and the remainder of the calculation is called the CRC. Dividing in the CRC
calculation at first looks to cost a lot of computing power, but it can be performed very quickly if we
use a method similar to the one learned at school. We will as an example calculate the remainder for
the character 'm'—which is 1101101 in binary notation— by dividing it by 19 or 10011. Please note
that 19 is an odd number. This is necessary as we will see further on. Please refer to your
schoolbooks as the binary calculation method here is not very different from the decimal method
you learned when you were young. It might only look a little bit strange. Also notations differ
between countries, but the method is similar.

With decimal calculations you can quickly check that 109 divided by 19 gives a quotient of 5 with 14
as the remainder. But what we also see in the scheme is that every bit extra to check only costs one
binary comparison and in 50% ofthe cases one binary subtraction. You can easily increase the
number of bits ofthe test data string—for example to 56 bits if we use our example value
"Lamme"r—t and the result can be calculated with 56 binary comparisons and an average of 28
binary subtractions. This can be implemented in hardware directly with only very few transistors
involved. Also software algorithms can be very efficient. All of the CRC formulas you will encounter
are simply checksum algorithms based on modulo-2 binary division where we ignore carry bits and in
effect the subtraction will be equal to an exclusive or operation. Though some differences exist in the
specifics across different CRC formulas, the basic mathematical process is always the same: ∙ The
message bits are appended withc zero bits; this augmented message is the dividend ∙
Apredetermined c+1-bit binary sequence, called thegenerator polynomial , is the divisor ∙ The
checksum is the c-bit remainder that results from the division operation

Table 1 lists some of the most commonly used generator polynomials for 16- and 32-bit CRCs.
Remember that the width of the divisor is always one bit wider than the remainder. So, for example,
you’d use a 17-bit generator polynomial whenever a 16-bit checksum is required

You might also like