0% found this document useful (0 votes)
82 views7 pages

LFSRs

Linear feedback shift registers (LFSRs) are efficient designs used for test pattern generation and output response analysis. They use flip-flops and XOR gates rather than counters. There are two types: external feedback LFSRs and internal feedback LFSRs. An LFSR generates periodic sequences defined by its characteristic polynomial. Maximum-length LFSR sequences have a length of 2n - 1 and are generated using primitive characteristic polynomials.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views7 pages

LFSRs

Linear feedback shift registers (LFSRs) are efficient designs used for test pattern generation and output response analysis. They use flip-flops and XOR gates rather than counters. There are two types: external feedback LFSRs and internal feedback LFSRs. An LFSR generates periodic sequences defined by its characteristic polynomial. Maximum-length LFSR sequences have a length of 2n - 1 and are generated using primitive characteristic polynomials.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Linear Feedback Shift Registers (LFSRs)

Efficient design for Test Pattern Generators & Output Response Analyzers (also used in CRC)
FFs plus a few XOR gates better than counter
fewer gates higher clock frequency External Feedback LFSR

D Q CK

D Q CK

D Q CK

D Q CK

Two types of LFSRs


External Feedback Internal Feedback
higher clock frequency

Internal Feedback LFSR


D Q CK D Q CK D Q CK D Q CK

Characteristic polynomial

defined by XOR positions P(x) = x4 + x3 + x + 1 in both examples


C. Stroud, Dept. of ECE, Auburn Univ. 10/04

LFSRs (cont)
Characteristic polynomial of LFSR n = # of FFs = degree of polynomial XOR feedback connection to FF i coefficient of xi
coefficient = 0 if no connection coefficient = 1 if connection coefficients always included in characteristic polynomial:
xn (degree of polynomial & primary feedback) x0 = 1 (principle input to shift register)

Note: state of the LFSR polynomial of degree n-1 1x 0x 1x Example: P(x) = x3 + x + 1 1x


0 1 2 3

D Q
1

D Q
2

D Q
3

CK C. Stroud, Dept. of ECE, Auburn Univ. 10/04

CK

CK

LSFRs (cont)
An LFSR generates periodic sequence
must start in a non-zero state,

The maximum-length of an LFSR sequence is 2n -1


does not generate all 0s pattern (gets stuck in that state)

The characteristic polynomial of an LFSR generating a maximum-length sequence is a primitive polynomial A maximum-length sequence is pseudo-random:
number of 1s = number of 0s + 1 same number of runs of consectuive 0s and 1s 1/2 of the runs have length 1 1/4 of the runs have length 2 (as long as fractions result in integral numbers of runs)
C. Stroud, Dept. of ECE, Auburn Univ. 10/04

Example: Characteristic polynomial is P(x) = x3 + x + 1 Beginning at all 1s state


7 clock cycles to repeat maximal length = 2n-1 polynomial is primitive
1x0
D Q
1

LFSRs (cont)

1x1
D Q
2

0x2
3

1x3
D Q CK

CK

CK

Properties:
four 1s and three 0s 4 runs:
2 runs of length 1 (one 0 & one 1) 1 run of length 2 (0s) 1 run of length 3 (1s)

1 1 1 0 0 1 0 1

1 0 0 1 0 1 1 1

1 1 0 0 1 0 1 1

1 2 3 4 5 6 7

Note: external & internal LFSRs with same primitive polynomial do not generate same sequence (only same length)
C. Stroud, Dept. of ECE, Auburn Univ. 10/04

LFSRs (cont)
Reciprocal polynomial, P*(x)
P*(x) = xn P(1/x)
example: P(x) = x3 + x + 1 then: P*(x) = x3 (x-3 + x-1 +1) = 1 + x2 + x3 = x3 + x2 +1

if P(x) is primitive, P*(x) is also primitive


same for non-primitive polynomials

Polynomial arithmetic
modulo-2 (xn + xn = xn - xn = 0)
Addition/Subtraction (x5 + x2 + 1) + (x4 + x2) x5 x2 1 + x4 x2 x5 x4 1 = x5 + x4 + 1 Multiplication (x2 + x + 1) (x2 + 1) x2 + x + 1 x2 + 1 x2 + x + 1 x4 + x3 + x2 = x4 + x3 + x + 1
C. Stroud, Dept. of ECE, Auburn Univ. 10/04

Division x2 + x + 1 x2 + 1 x4 + x3 + x + 1 x4 + x2 x3 + x2 + x + 1 x3 +x x2 + 1 x2 + 1 0

LFSRs (cont)
Non-primitive polynomials produce sequences < 2n-1
Typically primitive polys desired for TPGs & ORAs

Example of non-primitive polynomial


P(x) = x3 + x2 + x + 1
External Feedback LFSR Internal Feedback LFSR

DQ DQ CK 0 0 0 0 0 0 1 1 1 1 1 1 DQ CK 1 1 0 0 1 0 1 1 0 0 0 0 1 1 0 DQ CK 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 0 0 1 1 0 1 0 1 1 0 0 1 1 CK

DQ CK

DQ CK

1 1 0 0 1 1 1 1 0

1 0 1 1 0 1

C. Stroud, Dept. of ECE, Auburn Univ. 10/04

LFSRs (cont)
Primitive polynomials with minimum # of XORs
Degree (n) 2,3,4,6,7,15,22 5,11,21,29 8,19 9 10,17,20,25,28 12 13,24 14 16 18 23 26,27 30 Polynomial xn + x + 1 xn + x2 + 1 xn + x6 + x5 + x + 1 xn + x4 + 1 xn + x3 + 1 xn + x7 + x4 + x3 + 1 xn + x4 + x3 + x + 1 xn + x12 + x11 + x + 1 xn + x5 + x3 + x2 + 1 xn + x7 + 1 xn + x5 + 1 xn + x8 + x7 + x + 1 xn + x16 + x15 + x + 1

C. Stroud, Dept. of ECE, Auburn Univ. 10/04

You might also like