You are on page 1of 3

Bytewise Computation of CRC without LUT

by Kalpana Das

Abstract
Cyclic Redundancy Check (CRC) of a stream of message bytes is usually calculated bytewise with the help of a Look-Up Table (LUT). Presented here is a novel method of computation of Cyclic Redundancy Checks without any Look-Up Table from a programmable
generating polynomial.

Historical Background
The computation of cyclic redundancy check (CRC) is used extensively ever since the evolution
of telecommunications. Sarwate [1] gave us a table look-up algorithm for the bytewise computation of CRC that, made the computation of CRC much faster than the bit-wise counterpart.
Ramabadran & Gaitonde [2] reduced the look-up table size which, led to more memory efficient
implementation. Presently the CRC of a message byte stream can be computed at runtime
without a Look-Up table only if the generating polynomial is known beforehand.

Nomenclature
The following nomenclature is uniformly followed in the entire text :
i. GF(p) is used to represent a Galois Field of base p where, p is prime number.
ii. All the polynomial co-effifients are assumed to be elements from GF(2) having as addition and . as multiplication operators.
iii. Ra(x)[b(x)] = b(x) mod a(x), where mod is the modulo operation defined on the ring of
polynomials on GF(2).

Mathematical Basis
The generating polynomial for the computation of cyclic redundancy check (CRC) is representated by the following equation :g(x) = gnxn + gn1xn1 + + g0 =

n
X

gkxk where gn = 1.

(1)

k=0

The ith data byte is representated by the following polynomial :bi+1(x) =di,7x7 + di,6x6 + +di,1x + di,0 =

7
X

di,kxk

(2)

k=0

The message upto the ith byte is representated by the following polynomial :mi(x) = d0,7x8i1 + + di1,1x + di1,0 = x8i8b1(x) + + bi(x) =

i
X

r=1

x8(ir)br(x)

(3)

Then, iterartively we obtain :mi+1(x) = x8mi(x) + bi+1(x)

(4)

The CRC upto the ith message byte is representated by the following polynomial :pi(x) = pi,n1xn1 + + pi,1x + pi,0 =

n1
X

pi,kxk = R g(x)[xnmi(x)]

(5)

k=0

Then, iteratively we obtain :pi+1(x) = R g(x)[xnmi+1(x)] = R g(x)[x8 pi(x) + xnbi+1(x)] = R g(x)[xnti(x)] + x8 pi(x)

(6)

where,
ti(x) =

7
X

(di,k pi,n8+k)xk =

k=0

7
X

ti,kxk

(7)

k=0

and
pi(x) =

n9
X

pi,kxk

(8)

k=0

Let
ri(x) = R g(x)[xnti(x)] = xnti(x) + qi(x)g(x) =

n1
X

ri,kxk

(9)

k=0

where,
qi(x) = qi,7x7 + qi,6x6 + + qi,0 =

7
X

qi,kxk

(10)

k=0

From Equations (7) & (9) we obtain :ti,k = (di,k pi,n+k8) =

7
M

gn+k l . qi,l 0 6 k 6 7

(11)

l=k

Equation (11) can be written in the following matrix form :[Ti] = [G][Qi]
where,
[Ti] = (ti,0 ti,1 .ti,k ti,7)T
[Qi] = (qi,0 qi,1 qi,l qi,7)T

gn gn1 gn7
0 gn gn6

[G] =


00 gn

(12)

Inverting Equation(12), we get the following Toeplitz matrix :[Qi] = [A][Ti]

(13)

where,

a 0 a1 a7
0a0 a6

[A] = [G]1 =

00 a0

Equation (13) can be linearly represented as :qi,k =

7
M

alk .ti,l 0 6 k 6 7

(14)

l=k

where,
a0 = gn
a1 = gn1
a2 = gn1 gn2
a3 = gn1 gn3
a4 = gn1 gn2 gn4 (gn1.gn2)
a5 = ((gn1 gn2 gn3).gn1) gn5
a6 = ((gn1 gn2 gn4).gn1) gn2 gn3 gn6
a7 = gn1 (gn1. gn5) (gn2. gn3) gn7

(15)

From the values of qi,k obtained in Equation(14), we can write :ri,k =

min(k,7)
M

gk l . qi,l 0 6 k < n

(16)

l=0

From Equations (6), (9) & (16), we can now write :pi+1,k =

pi,k 8 ri,k
ri,k

8 6 k 6 n 1
0 6 k 6 7

(17)

References
1. Sarwate Dilip V. Computation of Cyclic Redundancy Checks via Table Look-Up. Communications of the ACM 31(8) (August 1988), 1008-1013.
2. Ramabadran Tenkasi V., Gaitonde Sunil S. A Tutorial on CRC Computations. IEEE
MICRO 8(4) (August 1988), 62-75.

You might also like