For an SRL16, it is jsut a matter of modulating the address. You data shifts in on each
clock in forward order, so you want to change the address to read the data out in the
reverse order. In order to get a reversed sequence, you have to advance the read address
by 2 on each clock the while the input is shifting by 1. In order to accommodate a
continuous input stream, the length of the SRL16 register has to be twice the length of
your sequence, so you may have to cascade more than one SRL16.
Take the case of an 8 sample sequence
in 0 1 2 3 4 5 6 7
8 9 10 11 12 13 14 15
S0 0 1 2 3 4 5 6
7 8 9 10 11 12 13 14 15
S1 0 1 2 3 4 5
6 7 8 9 10 11 12 13 14
S2 0 1 2 3 4
5 6 7 8 9 10 11 12 13 14
S3 0 1 2 3
4 5 6 7 8 9 10 11 12 13 14
S4 0 1 2
3 4 5 6 7 8 9 10 11 12
13
S5 0 1
2 3 4 5 6 7 8 9 10 11
12
S6 0
1 2 3 4 5 6 7 8 9 10
11 12
S7
0 1 2 3 4 5 6 7 8 9
10 11
S8
0 1 2 3 4 5 6 7 8 9
10 11
S9
0 1 2 3 4 5 6 7 8 9
10
S10
0 1 2 3 4 5 6 7 8 9
10
S11
0 1 2 3 4 5 6 7 8 9
S12
0 1 2 3 4 5 6 7 8 9
S13
0 1 2 3 4 5 6 7 8
S14
0 1 2 3 4 5 6 7 8
addr
0 2 4 6 8 10 12 14 0 2
4 6 8 10 12 14 0
out
7 6 5 4 3 2 1 0 15 14
13 12 11 10 9 8
All you need is an SRL16 and a small counter, plus muxes if you are cascading SRL16's to
get a long enough sequence buffer.
You can also do other address sequences, for example you could use the sequence: 3 0 3 0 6
3 6 3 to get a 3 bit bit-reversed address ordering (output is ordered 0,4,2,6,1,5,3,7 ).
Putting a LUT ROM between a binary counter and the SRL16 address makes it easy to generate
an arbitrary address sequence, and for speed, register the LUT ROM outputs too.
I have also used SRL16's in sorting applications to do the position swaps. In that case,
the address is modulated based on a compare that happens between samples before the SRL16.
--
--Ray Andraka, P.E.
President, the Andraka Consulting Group, Inc.
401/884-7930 Fax 401/884-7950
email (e-mail address removed)
http://www.andraka.com
"They that give up essential liberty to obtain a little
temporary safety deserve neither liberty nor safety."
-Benjamin Franklin, 1759