CORR-8BIT-SC-U2

www.latticesemi.com
1
ip1039_01.0
April 2005 IP Data Sheet
© 2005 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal. All other brand
or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
The product described herein is subject to continuing development, and applicable specifications and information are subject to change without notice. Such specifica-
tions and information are provided in good faith; actual performance is not guaranteed, as it is dependent on many factors, including the user's system design.
Correlator IP Core
Features
Supports 1- to 8-Bit Input Data Width
Supports 1 to 256 Channels
Supports a Correlation Window from 8 to
2048 Taps
Supports Oversampled Input Data from 2x
to 8x
Supports Real Correlations for Either
Signed or Unsigned Data
Supports Complex Correlations for Signed
Data
Allows the User to Tune the Performance of
the Design by Specifying the Values of
Several Parameters
Provides a Selectable Input FIFO for
Maximum Data Throughput
Allows the User to Specify the Number of
Coefficient Sequences Desired, from 1 to
256
Introduction
The function of this core is to correlate an incoming data
stream to a stored binary pattern called a code
sequence or coefficient sequence. The data stream
may be binary or multi-valued, either signed or
unsigned, and is provided to the core one sample at a
time. The core can be configured to perform either a
real correlation with a single data input stream and a
single coefficient sequence, or a complex correlation
with two input data streams representing the real and
imaginary input terms, and two coefficient sequences
representing the real and imaginary coefficients.
The core provides multiple channel capability and can
support up to 256 channels. Correlations for each chan-
nel operate independently from each other. Also, up to
256 different coefficient sequences may be stored in the
core, and each channel can select which coefficient
sequence is correlated to that channel, so one coeffi-
cient sequence could be used for all 256 channels if
desired.
Figure 1. Correlator IP Core External Interface Diagram
decim_r[n:0]
Correlator
rst
clk
din[n:0]
din_im[n:0]
numtaps_r[n:0]
code_sel_in[n:0]
coeffaddr[n:0]
crdy
coeffwdat[n:0]
coeffwdat_im[n:0]
coeffwr
ordy
chan_in[n:0]
dout[n:0]
chan_out[n:0]
block_start_out
dout_im[n:0]
block_start_in
irdy
seq_err
Lattice Semiconductor Correlator IP Core
2
General Description
A correlation function determines how closely a data sequence matches a reference, or “coefficient” sequence. A
high correlation value means that the data sequence closely matches the coefficient sequence. A low correlation
value means that the data sequence is dissimilar to the coefficient sequence. The basic correlator equation is given
by:
(1)
The terms of the equation are:
d
i
– Input data sequence. The Correlator IP core allows the input sequence to be from 1 to 8 bits wide, and either
signed (two’s complement) or unsigned data.
c
i
– Coefficient (or code) sequence. In the Correlator IP core, this sequence must be loaded into internal memory
prior to a correlation operation. This sequence is always binary {1,0}; however, the coefficient sequence may rep-
resent either an unsigned sequence {1,0} or a signed sequence {+1,-1}. In the case of a signed coefficient
sequence, a 1 in the sequence represents a value of +1 and a 0 in the sequence represents a value of -1. The d
i
and c
i
inputs must both be of the same type, either signed or unsigned.
r
k
– Correlation result output sequence (correlation between d
i
and c
i
inputs).
corr_win
– Correlation window. This is the number of elements in the input data sequence over which the corre-
lation function is calculated. This is also referred to as the number of “taps. For the Correlator IP core this num-
ber is determined by the user when configuring the core. Once selected, the number of data elements (and
coefficient terms) is then fixed at this number for all correlation operations. The number of terms in the coefficient
sequence is always equal to the number of taps (corr_win) specified.
num_lags
Total number of lags for which the correlation is performed. This is also the length of the correlation
result sequence, r
k.
From Equation 1, a correlation operation takes an input data sequence d
i
of length “corr_win” and multiplies each
term in the sequence against the terms of the reference coefficient sequence c
i
, summing the results of all of the
multiplications to produce the result r
k
. The input data sequence is then shifted by one element and the operation is
repeated to produce the next term in the r
k
sequence. This is done “num_lags” times.
In the Correlator IP core, each time a new data term is input to the core, one correlation operation is performed
across “corr_win” data and coefficient terms, producing one result, r. The “k” index in Equation 1 does not apply
since the Correlator always produces one new result when it receives one new data value. Old data beyond the
defined correlation window size is not held in memory.
In addition to the basic correlation function described above, the Correlator IP core can be configured to perform
complex correlations, defined by the equation:
(2)
In this case, the data and coefficient input sequences are both complex and each contains a real input sequence
and an imaginary input sequence. For the Correlator IP core, the input data sequence is a sequence of signed
(two’s complement) numbers from 1 to 8 bits wide, and the coefficient sequence is a binary sequence where a
coefficient value of 1 represents +1 and a coefficient value of 0 represents a -1. Equation 2 represents the complex
conjugate of c
i
. The complex conjugate multiplication expressed in Equation 2 is given as:
(3)
=
+
=
1_
0
wincorr
i
ikik
cdr
k = 0,1,…,num_lags-1
=
+
=
1_
0
wincorr
i
ikik
cdr
k = 0,1,…,num_lags-1
dc = (d
re
c
re
+ d
im
c
im
) + j(d
im
c
re
- d
re
c
im
)
Lattice Semiconductor Correlator IP Core
3
Since the coefficients in a complex correlation are restricted to the values {+1,-1}, the multiplications in Equation 3
simplify to inversions of the d
re
and d
im
terms, and the whole equation reduces to a series of additions and subtrac-
tions. The Correlator IP core performs these inversions and sums the results to produce a new result value r for
each new d
re
and d
im
term input to the core. In this case, the result sequence will have two terms, a real term and
an imaginary term.
Functional Description
The Correlator IP core is composed of the following functional blocks:
State Machine
– Controls the flow of data received from the user. Generates the starting pointer values neces-
sary to read/write the Tap Memory and stores the pointer values in the Channel Memory. Stores the starting
pointer values for the next correlation operation in the input FIFO. Generates the “shiftby” value for the aligner.
Channel Memory
– Stores the pointer to the location in Tap Memory to write the next data value.
Input FIFO
– Stores the pointer to the starting point in Tap and Coefficient Memories for the next correlation.
Tap Memory
– Stores the data terms (d
i
).
Coefficient Memory
– Stores the coefficient terms (c
i
).
Aligner
– Aligns data and coefficients read from memory for the correlation operation.
Correlator
– Performs the equivalent of the multiplication operations in Equations 1 and 2.
Adder/Accumulator
– Performs the addition and subtraction operations in Equations 1 and 2.
Correlator Input and Output Data
The Correlator IP core accepts a new input data value for a channel and writes that value into Tap Memory. When it
is ready to perform the next correlation operation for that channel, the new data value will be included in the corre-
lation, along with enough “old” data already in memory to completely fill the correlation window. The Tap Memory is
a circular buffer which contains a correlation window’s worth of data. As each new value is added to Tap Memory
for a particular channel, a correlation operation needs to be run and completed before the next new value is added
to memory for that channel. New data can be written into Tap Memory for channels other than the one the Correla-
tor is operating on, however it is the user’s responsibility to insure that a correlation operation is done for a particu-
lar channel before new data is written into memory for that same channel. This is easy to do for a large number of
channels where new data is written to channels in a round-robin sequence, or if the Correlator throughput is not
stressed to its limit (i.e. unused cycles appear between correlations), but the problem can be difficult to manage for
small numbers of channels. The Correlator IP core will automatically prevent new data being written into Tap Mem-
ory and corrupting a correlation as long as the input FIFO depth (parameter 9) is set to 1.
Figures 2 and 3 show the timing of the user interface. The state machine accepts one new data value from the user
interface at a time. When the state machine is ready to accept a new input data word from the user interface it
asserts the
crdy
signal. The user interface then inputs
din
,
chan_in
,
code_sel_in
,
block_start_in
, and
asserts the
irdy
signal. When the state machine sees
irdy
go active, it will take the new data value from the user
interface. If the design has been configured for multiple channels, the state machine reads the pointer for that chan-
nel from the Channel Memory. This pointer value tells the state machine where in Tap Memory to write the data
value just received from the user interface. This pointer value will also be the starting point for the next correlation
operation, so this pointer value is stored in the Input FIFO until the next correlation operation is ready to start. Once
the present correlation operation finishes, or if no correlation operation was in progress when a new data value was
received, then the Input FIFO is read to determine the starting pointer for the next correlation. The state machine
begins reading the Tap and Coefficient Memories at the starting pointer location, and it reads until it has read an
entire correlation window’s worth of data and coefficients.
Figure 2 shows at time 173.5µs that
crdy
went active. The user provided a value of 0x3 for channel 0, and set the
code_sel_in
to 1 which indicates which coefficient sequence is to be used for the correlation of channel 0 data.

CORR-8BIT-SC-U2

Mfr. #:
Manufacturer:
Lattice
Description:
Development Software Correlator IP Core User Config
Lifecycle:
New from this manufacturer.
Delivery:
DHL FedEx Ups TNT EMS
Payment:
T/T Paypal Visa MoneyGram Western Union