LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller

Similar documents
INTERNATIONAL JOURNAL OF PURE AND APPLIED RESEARCH IN ENGINEERING AND TECHNOLOGY

Individual Project Report

VLSI System Testing. BIST Motivation

Design of Fault Coverage Test Pattern Generator Using LFSR

Product Obsolete/Under Obsolescence

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

Why FPGAs? FPGA Overview. Why FPGAs?

Modeling Latches and Flip-flops

Design and FPGA Implementation of 100Gbit/s Scrambler Architectures for OTN Protocol Chethan Kumar M 1, Praveen Kumar Y G 2, Dr. M. Z. Kurian 3.

CSE 352 Laboratory Assignment 3

Prototyping an ASIC with FPGAs. By Rafey Mahmud, FAE at Synplicity.

CS150 Fall 2012 Solutions to Homework 4

International Journal of Scientific & Engineering Research, Volume 5, Issue 9, September ISSN

Using on-chip Test Pattern Compression for Full Scan SoC Designs

Digital Systems Laboratory 1 IE5 / WS 2001

MC-ACT-DVBMOD April 23, Digital Video Broadcast Modulator Datasheet v1.2. Product Summary

Comparative Analysis of Stein s. and Euclid s Algorithm with BIST for GCD Computations. 1. Introduction

Faculty of Electrical & Electronics Engineering BEE3233 Electronics System Design. Laboratory 3: Finite State Machine (FSM)

Field Programmable Gate Arrays (FPGAs)

Design and Implementation OF Logic-BIST Architecture for I2C Slave VLSI ASIC Design Using Verilog

TEST PATTERN GENERATION USING PSEUDORANDOM BIST

Tutorial 11 ChipscopePro, ISE 10.1 and Xilinx Simulator on the Digilent Spartan-3E board

CSCB58 - Lab 4. Prelab /3 Part I (in-lab) /1 Part II (in-lab) /1 Part III (in-lab) /2 TOTAL /8

Design and Implementation of Encoder for (15, k) Binary BCH Code Using VHDL

EECS150 - Digital Design Lecture 19 - Finite State Machines Revisited

FPGA Design. Part I - Hardware Components. Thomas Lenzi

Lecture 6: Simple and Complex Programmable Logic Devices. EE 3610 Digital Systems

DEPARTMENT OF ELECTRICAL &ELECTRONICS ENGINEERING DIGITAL DESIGN

Registers and Counters

PROCESSOR BASED TIMING SIGNAL GENERATOR FOR RADAR AND SENSOR APPLICATIONS

ECE 715 System on Chip Design and Test. Lecture 22

Logic Design. Flip Flops, Registers and Counters

Design for Test. Design for test (DFT) refers to those design techniques that make test generation and test application cost-effective.

A Modified Design of Test Pattern Generator for Built-In-Self- Test Applications

Static Timing Analysis for Nanometer Designs

VLSI Technology used in Auto-Scan Delay Testing Design For Bench Mark Circuits

Synthesis Techniques for Pseudo-Random Built-In Self-Test Based on the LFSR

Memory Interfaces Data Capture Using Direct Clocking Technique Author: Maria George

Performance Evolution of 16 Bit Processor in FPGA using State Encoding Techniques

LFSR Counter Implementation in CMOS VLSI

Advanced Devices. Registers Counters Multiplexers Decoders Adders. CSC258 Lecture Slides Steve Engels, 2006 Slide 1 of 20

Counters

Synchronous Sequential Logic

Implementation of UART with BIST Technique

Modeling Latches and Flip-flops

Memory Interfaces Data Capture Using Direct Clocking Technique Author: Maria George

VID_OVERLAY. Digital Video Overlay Module Rev Key Design Features. Block Diagram. Applications. Pin-out Description

hochschule fu r angewandte wissenschaften hamburg Prof. Dr. B. Schwarz FB Elektrotechnik/Informatik

Programmable Logic Design I

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

FPGA Laboratory Assignment 4. Due Date: 06/11/2012

2.6 Reset Design Strategy

Logic Design II (17.342) Spring Lecture Outline

[Krishna*, 4.(12): December, 2015] ISSN: (I2OR), Publication Impact Factor: 3.785

2e 23-1 Peta Bits Per Second (Pbps) PRBS HDL Design for Ultra High Speed Applications/Products

Optimization of Multi-Channel BCH Error Decoding for Common Cases. Russell Dill Master's Thesis Defense April 20, 2015

Midterm Exam 15 points total. March 28, 2011

Dynamic Power Reduction in Sequential Circuits Using Look Ahead Clock Gating Technique R. Manjith, C. Muthukumari

FPGA IMPLEMENTATION AN ALGORITHM TO ESTIMATE THE PROXIMITY OF A MOVING TARGET

Lecture 23 Design for Testability (DFT): Full-Scan

CAD for VLSI Design - I Lecture 38. V. Kamakoti and Shankar Balachandran

Overview: Logic BIST

Inside Digital Design Accompany Lab Manual

EECS150 - Digital Design Lecture 15 Finite State Machines. Announcements

CHAPTER 4: Logic Circuits

Design of BIST with Low Power Test Pattern Generator

Single Channel LVDS Tx

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

Flip-flop and Registers

Hardware Implementation of Viterbi Decoder for Wireless Applications

ELCT201: DIGITAL LOGIC DESIGN

problem maximum score 1 28pts 2 10pts 3 10pts 4 15pts 5 14pts 6 12pts 7 11pts total 100pts

A Novel Low Power pattern Generation Technique for Concurrent Bist Architecture

FPGA Based Implementation of Convolutional Encoder- Viterbi Decoder Using Multiple Booting Technique

L11/12: Reconfigurable Logic Architectures

Logic. Andrew Mark Allen March 4, 2012

Chapter 5 Flip-Flops and Related Devices

Chapter 4. Logic Design

Jin-Fu Li Advanced Reliable Systems (ARES) Laboratory. National Central University

Laboratory 4. Figure 1: Serdes Transceiver

Bit Swapping LFSR and its Application to Fault Detection and Diagnosis Using FPGA

FSM Implementations. TIE Logic Synthesis Arto Perttula Tampere University of Technology Fall Output. Input. Next. State.

Design and Implementation of High Speed 256-Bit Modified Square Root Carry Select Adder

Chapter 2. Digital Circuits

Universal Asynchronous Receiver- Transmitter (UART)

Available online at ScienceDirect. Procedia Computer Science 46 (2015 ) Aida S Tharakan a *, Binu K Mathew b

CHAPTER 4: Logic Circuits

VHDL Design and Implementation of FPGA Based Logic Analyzer: Work in Progress

Final Exam CPSC/ECEN 680 May 2, Name: UIN:

LogiCORE IP Spartan-6 FPGA Triple-Rate SDI v1.0

HDL & High Level Synthesize (EEET 2035) Laboratory II Sequential Circuits with VHDL: DFF, Counter, TFF and Timer

EFFICIENT IMPLEMENTATION OF RECENT STREAM CIPHERS ON RECONFIGURABLE HARDWARE DEVICES

SRAM Based Random Number Generator For Non-Repeating Pattern Generation

Main Design Project. The Counter. Introduction. Macros. Procedure

March 13, :36 vra80334_appe Sheet number 1 Page number 893 black. appendix. Commercial Devices

A High- Speed LFSR Design by the Application of Sample Period Reduction Technique for BCH Encoder

VLSI Test Technology and Reliability (ET4076)

Using the Quartus II Chip Editor

FPGA Design with VHDL

Laboratory 1 - Introduction to Digital Electronics and Lab Equipment (Logic Analyzers, Digital Oscilloscope, and FPGA-based Labkit)

Transcription:

XAPP22 (v.) January, 2 R Application Note: Virtex Series, Virtex-II Series and Spartan-II family LFSRs as Functional Blocks in Wireless Applications Author: Stephen Lim and Andy Miller Summary Linear Feedback Shift Registers (LFSRs) are commonly used in applications where pseudorandom bit streams are required. LFSRs are the functional building blocks of circuits like the pseudo-random noise (PN) code generator (XAPP2) and Gold code generators (XAPP27) commonly used in Code Division Multiple Access (CDMA) systems. This application note describes two implementations of an LFSR using the SRL6 (Shift Register Look-Up Table) primitive for area-efficient designs. The first LFSR implementation describes the parallel output access and parity calculation; the second describes the multi-cycle output access and sequential parity calculation. This application note covers the Virtex series, the Virtex-II series and the Spartan -II family of devices. Introduction Linear Feedback Shift Registers LFSRs can be used for performance-critical binary counters used to generate sequences of random numbers. LFSRs will often satisfy this requirement, although the generated sequence is pseudo-random in nature. Pseudo-random patterns repeat over time; the longer the LFSR, however, the longer the sequence of random numbers before pattern repetition occurs. When longer sequences are desired, the physical size of the hardware is increased. Conventionally, in the older FPGA architectures, flip-flops would be used. With two flip-flops in each of the older-architecture CLBs, an n-bit LFSR will take up at least n/2 CLBs. In the Virtex, Virtex-E, Virtex-EM, Virtex-II, and Spartan-II architectures, a four-input LUT can also function as a 6-bit shift register with a single output accessed by the LUT s address lines. This 6-bit shift register function can be accessed using the SRL6 primitive. An LFSR implemented using these SRL6 primitives reduces FPGA resource utilization compared to implementations using flip-flops. LFSRs sequence through 2 N states, where N is the number of flip-flops in the LFSR. At each clock edge, the contents of the flip-flops are shifted right by one position. There is a feedback path from predefined flip-flops to the leftmost flip-flop through an exclusive-nor (XNOR) or an exclusive-or (XOR) gate. A value of all " s" is illegal in the case of an XNOR feedback, and a value of all "'s" is illegal for XOR feedback. The illegal state causes the counter to remain in its present state, locking out any further new values from being registered. Because of the pseudo-random nature of LFSRs, they are used as basic functional blocks in Gold code generators (Figure ). The feedback taps are predefined mathematically to assure that the LFSR shifts through the maximum number of possible values. The taps for up to 68 bits are detailed in XAPP2 (Table ). The following section discusses some of these basic concepts in detail. LFSR Length N PN Code Out LFSR 2 Length N X22 Figure : Gold Code Generator Using LFSRs 2 Xilinx, Inc. All rights reserved. All Xilinx trademarks, registered trademarks, patents, and disclaimers are as listed at http://www.xilinx.com/legal.htm. All other trademarks and registered trademarks are the property of their respective owners. All specifications are subject to change without notice. XAPP22 (v.) January, 2 www.xilinx.com -8-255-7778

R LFSRs as Functional Blocks in Wireless Applications LFSR Terminology LFSRs sequence through (2 N ) states, where N is the number of registers in the LFSR. The contents of the registers are shifted right by one position at each clock cycle. The feedback from predefined registers or taps to the leftmost register are XORed together. LFSRs have several variables: The number of stages in the shift register The number of taps in the feedback path The position of each tap in the shift register stage The initial starting condition of the shift register, often referred to as the FILL state NOTE: In the case of LFSRs with an XOR feedback, the FILL value must be non-zero to avoid the LFSR locking up in the next state. Shift Register Length (N ) The shift register length is often referred to as the degree, and the longer the shift register, the longer the duration of the PN sequence before it repeats. For a shift register of fixed length N, the number and duration of the sequences it can generate are determined by the number and position of taps used to generate the parity feedback bit. Shift Register Taps The combination of taps and their location is often referred to as a polynomial, and expressed as: P(x) = X 7 + X 3 + Various conventions are used to map the polynomial terms to register stages in the shift register implementation. The convention used in this application note is consistent with the convention used in the CDMA UMTS specification. In the polynomial P(x) = X 7 + X 3 +, the trailing "" represents X, which is the output of the last stage of the shift register. X 3 is the output of register stage 3 and X 7 the output of the XOR. A few points to note about LFSRs and the polynomial used to describe them: The last tap of the shift register is the leading "" and is always used in the shift register feedback path. The length of the shift register can be deduced from the exponent of the highest order term in the polynomial. The highest order term of the polynomial is the signal connecting the final XOR output to the shift register input. It does not feed back into the parity calculation along with the other taps identified in the polynomial. LFSR Implementation There are two implementation styles of LFSRs, Galois implementation and Fibonacci implementation. Galois Implementation As shown in Figure 2, the data flow is from left to right and the feedback path is from right to left. The polynomial increments from left to right with X term (the "" in the polynomial) as the first term. This is referred to as a Tap polynomial, as it indicates which taps are to be fed back from the shift register. Since the XOR gate is in the shift register path, the Galois implementation is also known as an in-line or modular type (M-type) LFSR. 2 www.xilinx.com XAPP22 (v.) January, 2-8-255-7778

LFSRs as Functional Blocks in Wireless Applications R X X 4 X 7 Tap Count 2 3 4 5 6 7 8 9 2 3 4 5 6 Data Flow Figure 2: Galois Implementation g(x) = + X 4 + X 7 X22_2_925 Fibonacci Implementation In Figure 3, the data flow is from left to right and the feedback path is from right to left, similar to the Galois implementation. However, the Fibonacci implementation polynomial decrements from left to right with X as the last term in the polynomial. This polynomial is referred to as a Reciprocal Tap polynomial and the feedback taps are incrementally annotated from right to left along the shift register. Since the XOR gate is in the feedback path, the Fibonacci implementation is also known as an out-of-line or simple type (S-type) LFSR. Tap Count 5 4 3 2 9 8 7 6 5 4 3 2 Data Flow X 6 X 4 X 3 X X LFSR polynomial: g(x) = X 4 + X 3 + X + X22_3_7 Figure 3: Fibonacci Implementation Maximal Length Sequences (L) A maximal length sequence for a shift register of length N is referred to as an m-sequence, and is defined as: L = 2 N An eight-stage LFSR, for example, will have a set of m-sequences of length 255. Shift Register LUT Mode for Area-Efficient LFSRs With the SRL6 primitive, it is possible to implement an n-bit LFSR in a fraction of the space used by a flip-flop design. A 6-bit LFSR would take up at least eight slices using flip-flops, since there are just two flip-flops per slice. The same 6-bit LFSR can be implemented in just four slices when using the SRL6s. Virtex-II devices have a new macro, SRLC6 in addition to the SRL6/E. Two outputs of the SRLC6 can be accessed simultaneously. One output is determined by the value of the 4-bit address line (i.e., A[3] A[]) and the other output is the cascadable output (the 6 th bit of the shift register.) XAPP22 (v.) January, 2 www.xilinx.com 3-8-255-7778

R LFSRs as Functional Blocks in Wireless Applications In Virtex devices, only a single tap or output of the SRL6s can be accessed at a time. The SRL6 output to be accessed is determined by the value of the 4-bit address line A[3] A[]. The SRL6 primitive will shift data on every clock cycle. A second primitive (SRL6E) provides the same shift register functionality, but adds a shift register Clock Enable. Both the SRL6 and SRL6E implement area-efficient shift registers in one LUT. It is worth noting, however, that parallel access to multiple taps is not possible, as the primitives have only one data output pin. Thus, for every single output that must be accessed, another SRL6 must be created if that output is in the same 6-bit set as the other. Because the number of taps rarely exceeds four, creating multiple instances of the SRL6 primitive is not a concern. It should be noted that because flip-flop based LFSRs will only consume as many flip-flops as there are stages in the shift register, the size at which it becomes more area efficient to use flipflops is less than or equal to eight. To overcome the loss of parallel access, the following two approaches are reviewed. Multiple Shift Registers with Parallel Tap Access and Parity Calculation Figure 4 demonstrates a 6-stage LFSR with four selectable tap points designed with four SRL6 primitives. An additional 4-input LUT is used to implement a parallel XOR parity calculation (Figure 5) that is fed back into the shift register as the new bit in the sequence. Tap D is the last stage in the shift register and so represents the LFSR output. This circuit is clocked at a frequency known as the chip rate. Tap Tap Tap3 Tap4 Parity Generator LFSR_OUT Q5 Q4 Q3 Q2 Q Q Q9 Q8 Q7 Q6 Q5 Q4 Q3 Q2 Q Q (Tap4) (Tap3) (Tap) (Tap) Q Q Q Q Tap4 Tap3 Tap Tap Q5 Q5 Q5 Q5 SRL6 SRL6 SRL6 SRL6 LFSR polynomial: g(x) = X 4 + X 3 + X + Figure 4: Parity Calculation X22_4_7 4 www.xilinx.com XAPP22 (v.) January, 2-8-255-7778

LFSRs as Functional Blocks in Wireless Applications R SRL6E SRL6E D IN D IN Q Q Q Q Q Q Tap A Tap C CE CLK X2 A A A 2 A 3 DIN Q4 Q5 Q5 SRL6E Q Q Q Tap B CE CLK X4 A A A 2 A 3 D IN Q4 Q5 Q5 SRL6E Q Q Q Tap A Tap B Tap C Tap D Parity Generator CE CLK X3 A A A2 A3 Q4 Q5 Q5 CE CLK A A A2 A3 Q4 Q5 Q5 Slice S X Slice S Figure 5: Four Tap Parallel LFSR Tap D = LFSR Output All SRL6Es are clocked at chip rate. X N = tap point and is selected with A[3:] X22_5_925 Single Shift Register with Multicycle Tap Access and Sequential Parity Calculation Figure 6 demonstrates how a single SRL6E primitive, with some additional logic, implements a 6-stage shift register that is clocked at a frequency called the chip rate. The SRL6 primitive address lines are multiplexed at four times the chip rate allowing four of the 6 shift register taps to be accessed during one chip rate period. The status of each accessed tap is input to a single XOR gate whose output is registered by a flip-flop also clocked at four times the chip rate. During one chip rate period, four taps are read and sequentially XORed to create the parity calculation. The final XOR state is available to the input of the shift register at the chip rate. This circuit enables any four of the sixteen shift register taps to be read, XORed together, and presented to the input of the shift register at the chip rate. Accessing the shift register taps over multiple cycles enables parallel access to four of the shift register taps at the chip rate. The multicycle clock rate should be twice the chip rate if only two taps are required. To access an odd number of taps during one chip rate period, the multicycle clock can be a binary-power-of-two multiple of the chip rate. Multi-cycle clock frequency = chip rate 2 N (where N is an integer) XAPP22 (v.) January, 2 www.xilinx.com 5-8-255-7778

R LFSRs as Functional Blocks in Wireless Applications The FDRE flip-flop can be clock enabled for only as many clock cycles as there are taps to be accessed during the chip rate period. For example, to implement a polynomial with three feedback taps, the FDRE could be clocked with a 4 chip rate clock, and only clock enabled for three of the cycles. One SRL6 implements 6-stage shift register Selected taps are multiplexed to the output at 4 shift register clock rate LUT-based XOR implements a time-shared parity generator Fill Fill_data FDRE D Q D IN SRL6E LUT Chip Rate Clock Enable CE Q Q Q Tap n 4 x Chip rate CLK X 8 X 4 X 3 4 x Chip Rate CLK X 2 A A A2 A3 Q4 Q5 Q5 PN_Sequence_out Figure 6: Multicycle Tap Access and Sequential Parity Calculation X22_6_9 Fill State The fill state is defined as that point in a maximal length sequence at which the LFSR will start generating the subsequent states of that sequence. The fill is required to be completed in one cycle of the chip rate. With a parallel shift register, this requirement is easy to satisfy. It requires that each flip-flop in the chain be preceded by a multiplexer that can select between loading parallel FILL data or the shift-out data from the previous flip-flop. To implement an LFSR with this capability using flip-flops requires a 2: multiplexer at the input of every flip-flop. This means every shift register stage requires a LUT and flip-flop pair. The SRL6 primitive is not a parallel-load shift register, but a solution to the parallel load problem comes through observing exactly what is happening during the last N chip periods of an N-stage LFSR prior to the FILL transition. Consider an eight-stage LFSR that has just reached a condition where it is eight chip rate clock cycles away from a FILL transition. During these last eight clock cycles, the contents of the shift register are shifted out as the last eight states of the sequence prior to the FILL signal. Also during this eight-cycle period, the XOR feedback path will be generating eight new bits to inject into the shift register as the next eight bits of the sequence. 6 www.xilinx.com XAPP22 (v.) January, 2-8-255-7778

LFSRs as Functional Blocks in Wireless Applications R However, the eight feedback bits calculated during the last eight cycles of the current sequence will not be shifted out as part of the sequence because they will be overwritten by the FILL bits. So rather than shift these eight feedback bits into the shift register, the eight clock cycles preceding the FILL command can be used to serially shift in the eight bits of new FILL data. This enables the SRL6 primitive to be used in LFSR applications where the LFSR has to be parallel loaded in one cycle of the chip rate clock. Note that this implementation is only applicable to instances where an occurrence of the FILL command can be predicted. Implementing the serial load is achieved with a 2: multiplexer that routes either feedback data or new FILL data into the shift register at the chip rate. The multiplexer select line should be pulled high N chip rate clock cycles before the last sequence. This multiplexer arrangement is shown in Figure 7. HDL Code Implementation of LFSRs LFSRs with Parallel Tap Access and Parity Calculation One method of creating an LFSR is creating multiple parallel SRL6s for each tap. The different outputs are then XNORed simultaneously using a single LUT and the output is then fedback into each SRL6. Examples of a 6-bit LFSR implemented using the SRL6 primitives in both VHDL and Verilog are available (xapp22.zip). It is important to note that this code infers the SRL6 primitives, and thus is portable to any architecture. Because these SRL6s are inferred, they cannot be initialized to a known state on power-up (other than all zeros), nor can the shift registers be dynamically changed to a different length by altering the address lines. In this design, a single bit 2: multiplexer is inserted in order to enable the user to shift in the initial sequence. DIN SRLE6 SRLE6 Addr QOUT clock SRLE6 SRLE6 Fill Figure 7: 6-bit, 4-tap Parallel LFSR Fill_En X22_7_9 This implementation can be cascaded in order to implement larger designs. It is important to note that a LFSR which is more than twice as long will not necessarily use twice as many SRL6s. For example, a 32-bit LFSR which has bus taps on bits 32, 22, 2, and will not use XAPP22 (v.) January, 2 www.xilinx.com 7-8-255-7778

R LFSRs as Functional Blocks in Wireless Applications eight SRL6s even though the 6-bit implementation uses four as shown in Figure 7. In the 32- bit LFSR it will only use five SRL6s (Figure 8). Likewise a 64-bit LFSR will not use ten SRL6s, it will only use seven. Thus the marginal cost of using SRL6s to implement LFSRs decreases with the size of the LFSR and the location of the taps. Fill Fill_En SRLE6 TAP6 SRLE6 TAP SRLE6 TAP2 clk clk clk SRLE6 TAP22 SRLE6 TAP32 clk clk X22_8_9 Figure 8: 32-bit, 4-tap Parallel LFSR The code has been tested on the following synthesis tools: FPGA Express 3.4 Synplicity 6. Leonardo Spectrum 2a2.7s FPGA Express FPGA Express may not infer an SRL6 when the length of the shift register is two or less. Thus a tap on the first or second bit will be implemented using two flip-flops. When a tap on a shift register follows immediately after another tap, the tool will use a flip-flop instead of creating another SRL6 unless the Preserve Hierarchy option is checked. Synplicity As in FPGA Express, Synplicity may not infer an SRL6 when the length of the shift register is two or less. Leonardo Spectrum Leonardo Spectrum by default will not merge two SRL6s into a single slice, even if they share a common input and clock. In order to get this feature disabled, set the following environment variable to false: set virtex_map_srl_pack FALSE When a tap on a shift register follows immediately after another tap, the tool will use a flip-flop instead of creating another SRL6 unless the Preserve Hierarchy option is checked. 8 www.xilinx.com XAPP22 (v.) January, 2-8-255-7778

LFSRs as Functional Blocks in Wireless Applications R LFSRs with Multi-cycle Tap Access and Sequential Parity Calculation A second method of creating an LFSR uses a single SRL6E, gaining access to the different taps by changing the address lines on the LUT that implements the SRL6E. An example of a 6-bit LFSR implemented in VHDL and Verilog is available (xapp22.zip). In this case, the output will be delayed by the number of taps needed to implement it. As shown in Figure 9, the output is produced on every rising edge of the chip rate clock, but the SRL6 and the output flipflop are actually clocked at an increased clock rate four times the chip rate for 4-tap LFSRs, and twice the chip rate for 2-tap LFSRs. The individual taps are then XNORed serially using the single output flip-flop. Note that during the last increased chip rate clock cycle, this flip-flop is synchronously reset to prepare it for the next increased clock cycle parity calculation. This method of implementation may use fewer resources in certain extremely long LFSRs; however, for shorter length LFSRs, the parallel LFSR implementation requires fewer resources. In the multicycle implementation, the SRL6E primitives have to be instantiated, since the synthesis tools cannot infer a dynamically changing output on the SRL6E. Out Counter Logic DIN SRL6E At Addr D Q Fill Fill_En Increased Chip Rate Clock Figure 9: Multicycle Tap Access LFSR X22_9_925 HDL Code The reference design was written in both VHDL and Verilog HDL. The files are available on the Xilinx web site at xapp22.zip or xapp22.tar.gz. The code was tested to work with current versions of Express, Exemplar, and Synplify. For both VHDL and Verilog code, the design is in two hierarchical levels. This makes the code readable and produces more efficient debugging and verification. In the reference design, SRL6/E components were inferred to achieve the most efficient implementation results. The XCV5E-8 was the targeted device. The SRL6 is a shift register LUT with four inputs to select the length of the output signal. The SRL6 component can be instantiated in code, but doing so limits the ability to quickly modify the functionality. To ensure that the SRL component is inferred, follow the required syntax. Synthesis tools recognize this syntax and infer the SRL6 component for Virtex series FPGAs. If for any reason the code is written differently, the output netlist (written by the Synthesis tool) should be checked to verify the presence of the SRL6 components. An example of the syntax that will correctly infer the SRL6 component is available on the Xilinx website at http://www.xilinx.com/techdocs/7822.htm. For readability, each LFSR implementation is in a separate block. If there are any problems after following the syntax in the above-listed solution, contact Xilinx Technical Support at http://support.xilinx.com. XAPP22 (v.) January, 2 www.xilinx.com 9-8-255-7778

R LFSRs as Functional Blocks in Wireless Applications The code was simulated on MTI s Modelsim simulator using the TCL interface; therefore, no testbench was used. On a simulator supporting stimulus using HDL code only, create the testbench (HDL) file to verify functionality. The code has been tested on the following synthesis tools: FPGA Express 3.4 Synplicity 6. Leonardo Spectrum 2a2.75 This implementation can also be cascaded to implement longer shift register sequences. Table summarizes the utilization for each synthesis tool. Table : Utilization Summary (Appendix A Code 6 bit length LFSR) Tool Synopsys FPGA Express v3.4 Synplicity Synplify 6. Exemplar Leonardo Spectrum 2a2.75 Slices 4 4 3 LUTs 2 2 2 SRL6s 3 3 4 Flip-flops 2 2 Conclusion Efficient LFSRs can be designed using the Virtex, Virtex-E, Virtex-EM, Virtex-II, and Spartan- II device architectural features like the Shift Register LUTs (SRL6). The FPGA resource saving becomes evident in applications like pseudo-random noise (PN) code generators and Gold code generators used in Code Division Multiple Access (CDMA) systems. The LFSRs are the basic functional blocks in these generators. For example, a 4-stage, two-tap Gold code generator can be implemented in just 5.5 Virtex slices. The example given in this document creates a 4-stage Gold code generator. Each LFSR is a 4-stage, two-tap LFSR implemented using SRL6s. Revision History The following table shows the revision history for this document. Date Version Revision 2//. Initial Xilinx release. //. Added Virtex-II information. www.xilinx.com XAPP22 (v.) January, 2-8-255-7778