Complex Digital
                                                                    Waveform Generator
XAPP 008.002                                                        Application Note By BERNIE NEW
    Summary
    Complex digital waveforms are generated without the need for complex decoding. Instead, fast loadable
    counters are used to time individual High and Low periods.
    Specifications                                                  Xilinx Family
    Minimum High/Low Time                   44 ns                   XC3000/XC3100
    Maximum High/Low Time                   >250 µs                 XC4000
    Resolution                              4 ns
                                                                    Demonstrates
    Number of Highs and Lows                32
    Number of CLBs                          40                      Fast Loadable Counters
                                                                    CLB ROMs
Complex digital waveforms with unequally spaced transi-             The values stored in the ROM are used to load a preset-
tions are often generated by decoding a counter that                table counter that times the duration of individual High
cycles with the same period as the waveform. If precise             and Low segments of the complex waveform. A second
placement of edges is required, the counter must be                 counter is enabled whenever the timer is reloaded, and
clocked at high frequency. This increases the burden on             tracks the segment number in the waveform. This is
the decoders; not only must they settle faster, but if the          used to address the ROM and access the length of the
period of the waveform remains constant, they must                  next segment.
become wider. These two requirements are incompati-
                                                                    The least significant bit of the second counter toggles
ble. Decoders typically become slower as they get wider.
                                                                    after each cycle of the timer and thus creates the output
In LCA devices, this problem can be overcome by using               waveform. This output is guaranteed to be glitch free,
high-speed counters in conjunction with data stored in              since it is generated by toggling a flip-flop.
ROM. The data stored in the ROM is not the waveform
                                                                    In an LCA device, the ROM may be implemented in
itself, but a run-length encoded version of it. A block dia-
                                                                    the CLBs. Each function generator may be used as a
gram of the waveform generator is shown in Figure 1.
                                                                                     NUMBER OF
                                           ROM                                      HIGHS & LOWS
                                HIGH/LOW
                                  TIME
                                                         PE                                  PE
                                       PRESETTABLE
                                                               TC              CE    COUNTER       TC
                                         COUNTER
               CLK
                                                                                OUTPUT WAVEFORM
                                                                                      (LSB)
                                                                                                        X1927A
Figure 1. Precision Waveform Generator
                                                           8-163
                                      This document was created with FrameMaker 4 0 2
Complex Digital Waveform Generator
16 x 2-bit ROM or as a 32 x 1-bit ROM. In the XC3000            262 µs. Up to 32 Highs and Lows can be accommodated
series, ROM data may be entered at the schematic level          using 32-word ROMs, for total waveform periods of up to
using 16:1 or 32:1 multiplexers to represent ROM bits.          8 ms.
The ROM values are applied to the data inputs of these
                                                                The 16-bit timer requires 18 CLBs, and a further six are
multiplexers as hard-wired ones and zeros. CLBMAPs
                                                                used in the segment counter. The 32 x 16-bit ROM adds
are used to lock the multiplexers into CLBs. APR incorpo-
                                                                16 CLBs, for a total of 40.
rates the ones and zeros into the logic function, and cre-
ates the desired ROM as 4- or 5-input function generator        ROM values may be used more than once in a waveform.
look-up tables.                                                 To do this, the output of the second counter must be
                                                                encoded to the appropriate ROM address. With this tech-
Using a state-skipping technique, the maximum clock rate
                                                                nique, any waveform length may be accommodated, pro-
for a presettable counter in an XC3100-series LCA device
                                                                vided it comprises a limited number of distinct time
is 270 MHz. This provides for defining the duration of
                                                                intervals.
Highs and Lows in 4-ns increments. In such a counter,
the shortest delay is 11 clocks, giving a minimum High          Multiple waveforms may also be generated using this
or Low time of 44 ns. While some periods longer than            scheme. A single timing counter is used to create a
this are also unavailable, the availability of all periods      super-set of transition times for all the waveforms. Individ-
of 30 clocks or greater (≥120 ns) is guaranteed. The            ual state machines are then used to create the different
16-bit timer allows maximum High and Low times of               waveforms from this timing information.
XAPP 008.002                                            8-164