Walsh function for the successful generation of ... Digital conversion using Walsh functions and FPGA. 1. ... specify their design with a schematic or hardware.
Proceedings of the Int. Conf. on Computer and Communication Engineering, ICCCE’06 Vol. II, 9-11 May 2006, Kuala Lumpur, Malaysia
FPGA Based Digital Waveform Generation using Walsh Functions Shuja A. Abbasi, A. R. M. Alamoud, Syed Manzoor Qasim Department of Electrical Engineering, VLSI Research Lab King Saud University, Riyadh, Saudi Arabia 11421 Email: {abbasi,alamoud,smanzoor}@ksu.edu.sa
Abstract This paper describes a technique that utilizes Walsh function for the successful generation of periodic waveforms in their digital form and illustrates its implementation in Field Programmable Gate Array (FPGA) Technology. Waveforms such as sinusoidal, trapezoidal and triangular are generated in their digital form using Very High Speed Integrated Circuit Hardware Description Language (VHDL) and FPGA. Top-down design methodology has been adopted. The proposed design is implemented using Xilinx Spartan3 FPGA chip and the simulation results validate the design methodology. Finally, we conclude that virtually any periodic function can be realized directly in its digital form, without the need of Analog to Digital conversion using Walsh functions and FPGA.
1. Introduction The ability to generate waveforms is central to many commercial and military applications. Waveform generators are used in wide range of applications including communication design and test, pulse generation, high-speed, low-jitter data and clock source, and mixed-signal design [1] and test [2]. Walsh functions which are a set of discrete valued orthogonal functions [3,4] are easy to generate and control using relatively simple hardware and readily lend itself for real-time waveform generation ideal for the synthesis of different waveforms [5,6]. In this paper we study the feasibility of using FPGA for the implementation of digital waveform generators through the use of Walsh functions. FPGAs offer high performance along with the ability to be electrically reprogrammed dynamically to perform other algorithms. The evolution of the fabrication technology has led to the development of FPGAs with exceptional computational power at a lower cost. Finally, the cost, in terms of computational density as well as computational power, is rapidly
Copyright © 2006 IEEE. All rights reserved.
decreasing making the FPGAs a cost-effective solution. Theoretically one can implement any digital logic circuit in FPGA [7]. The rest of the paper is organized as follows. In Section 2, FPGA architecture is discussed in brief. Definitions and basic properties of Rademacher and Walsh functions are then discussed in section 3. In section 4 waveform generation using FPGA is described. Section 5 summarizes the FPGA implementation results of our work. The final section completes the paper with some conclusions.
2. FPGA Architecture An FPGA is a logic chip comprising cells of logic blocks connected with software-configurable interconnections as shown in Figure 1. FPGAs combine the integration of an ASIC with the flexibility of user-programmable logic. Application specific hardware circuits can be created on demand to meet the computing and interconnect requirements of an application.
Figure 1: FPGA Architecture The basic unit of area on a Xilinx FPGA is a slice, which usually consists of two 4-input LUTs, two flipflops, some muxes, and other control logic. Existing state-of-the-art FPGAs contains tens-of-thousands of slices, higher–level logic blocks such as memory, multipliers, even CPUs, and a programmable
ISBN 983-43090-1-5
interconnection network arranged in a rectangular grid pattern. In a typical FPGA design methodology, designers specify their design with a schematic or hardware description language. This design is then synthesized into a vendor-specific netlist files which are essentially text based descriptions of the schematic [7]. Netlists are processed by the place and route (PAR) and bit generation tools to produce a configuration bit-stream.
3. Definitions and Basic Properties In this section, we define the Rademacher and Walsh functions and discuss their basic properties.
3.1. Rademacher Functions We begin with the definition of Rademacher function which for the nth order is defined by [8]: I (n+1, x) = Sgn(sin 2ʌ2n x), n = 0,1,2 … (1) where, I (0, x) = 1 and the signum function Sgn(y) is defined by: yt0 1 , Sgn y ® … (2) 1 , y 0 ¯ Extension of the definition of Rademacher functions over the whole non-negative real line is made possible by the periodicity property of these functions [9]: I (0, x+1) = I (0, x) … (3) Rademacher functions form an orthogonal, but incomplete set. Actually, they form a subset of the Walsh set of functions. Furthermore, the function I n, x is taken right-continuous; i.e. [8],
I n, x
I n, x H lim H
… (4)
o0
N
3>Ii 1, x @
ni
,
ni ^0,1`
(6)
i 0
where the integer n is assumed to have the dyadic (binary) representation [8]: N
n
¦2 n i
(7)
i
i 0
Because the Walsh functions are two-level signals, positive (+1) and negative (-1), they are easy to implement without any complex mathematica1 operations. If we replace the value +1 by binary 0 and –1 by binary 1, then multiplication is the same as the EXOR operation. This greatly simplifies the multiplication of waves and renders them as ideal candidates for high-speed digital computation and implementation. 1
ƶ (0 ,x )
0 1 0 -1 1 0 -1 1 0 -1 1 0 -1 1 0 -1 1 0 -1 1 0 -1
x
1 ƶ (1 ,x ) ½
1
½
1
½
1
½
1
½
1
½
1
½
1
x
ƶ (2 ,x ) x
ƶ (3 ,x ) x
ƶ (4 ,x ) x
ƶ (5 ,x ) x
ƶ ( 6 ,x ) x
ƶ (7 ,x ) x
Figure 2: The First Eight Walsh Functions
3.2. Walsh Functions In 1923, J. L. Walsh proposed a complete set of rectangular functions [8] which have since been named after him. Figure 2 shows the set of first eight Walsh functions defined on the unit interval [0,1). It is well known that any Walsh function can be generated by multiplication of Rademacher functions. Let the set of Walsh functions defined on [0,1) be designated by\ n, x . Then [9],
\ 0, x 1 ,
\n,x
0 d x 1
and
Copyright © 2006 IEEE. All rights reserved.
(5)
4. Waveform Generation using FPGA Generating waveform using Walsh functions is a two stage process: generate the basic Walsh functions, and adjust the coefficients of each function. Constructing waveforms involves weighted addition of various Walsh functions. The addition of more Walsh functions would produce a smoother approximation of a particular waveform, of course at the cost of more hardware. The functionality of the waveform generators are written in VHDL and synthesized into a configuration file that is downloaded into the FPGA. This is done using Xilinx ISE 6.3i software [10]. By
1221
using a single, appropriately sized FPGA, multiple waveforms can be generated thus minimizing the cost. The Walsh series expansion of a function f(x) may be written as [9]: f x | A0\ 0, x A1\ 1, x A2\ 2, x ... … (8)
The MATLAB simulation result using 32 terms for a trapezoidal function is shown in Figure 4.
The number of Walsh functions used decides the precision of the evaluated function. The expansion coefficients may be evaluated using Eq. 9. [8]. 1
An
³ f x \ n, x dx
… (9)
0
For a sinusoidal function f x sin 2Sx , some of the expansion coefficients are as follows: A0 = 0; A1 = 0.6365; A2 = A3 = A4 = A5 = A6 = 0; A7 = 0.2637; A8 = A9 = A10 = 0; A11 = 0.1266; A12 = 0; A13 = 0.0525; A14 = A15 = A16 = A17 = A18 = 0; and so on. There is no need to calculate all the Walsh functions since some of the coefficients turn out to be zero. Approximations to sinusoidal functions can be obtained by adding the first four, eight, sixteen, thirtytwo, and sixty-four terms, respectively, in the corresponding Walsh series expansion. It may be seen that for using 64 terms, only 8 Walsh functions are actually required. The MATLAB simulation result using 64 terms for sinusoidal function is shown in Figure 3.
Figure 4: Trapezoidal waveform using 32 term Walsh function approximation For a triangular function 4x , 0 x 0.25 f(x) = 2 – 4x , 0.25 x 0.75 4(x – 1) , x 0.75
(11)
The MATLAB simulation result using 32 terms for triangular function is shown in Fig.5.
Figure 5: Triangular waveform using 32 term Walsh function approximation
5. FPGA Implementation Results
Figure 3: Sinusoidal waveform using 64 term Walsh function approximation Similar approach is used for the calculation of expansion coefficients of trapezoidal and triangular functions given below. For a trapezoidal function 4x , 0 x 0.25 f(x) = 1, 0.25 x 0.75 (10) – 4x + 4 , x 0.75
1222
The VHDL Synthesis and place and route have been achieved using Xilinx ISE 6.3i. The device selected is Xilinx Spartan-3 XC3S200-4ft256 [11] to exhibit performances over a small and low cost FPGA. The implementation results are summarized in Table 1. Table 1: Spartan-3 Implementation Results
Copyright © 2006 IEEE. All rights reserved.
Waveforms
Sinusoidal
Trapezoidal
Triangular
No. of Slices No. of Slice Flip-Flops No. of 4input LUTs Minimum Period (ns) Max.Freq. (MHz) Total Eq. gate count Power (mW)
65 out of 1920 (3 %) 27 out of 3840 (1%) 106 out of 3840 (2 %)
82 out of 1920 (4 %) 26 out of 3840 (1%) 127 out of 3840 (3 %)
45 out of 1920 (2 %) 17 out of 3840 (1%) 73 out of 3840 (1 %)
17.608
17.616
13.412
56.792
56.767
74.560
1508
1879
1167
215
215
125
Modelsim simulation [12] tool is used for presynthesis and post-synthesis simulation. Figures 6, 7 and 8 show the waveform of 16-bit digital sinusoidal (P0 to P15), 16-bit digital trapezoidal (P1 to P16) and 16bit digital triangular waves (P1 to P16) respectively. As shown in the figures 6, 7 and 8, abb is the clock signal and the first five Rademacher functions are represented by R1, R2, R3, R4 and R5. The Walsh functions are represented by W0 to W7 and W1 to W31 for the sinusoidal and trapezoidal, triangular functions respectively. 2’s complement method is used for negative numbers. However, it is difficult to appreciate these functions in digital form. Hence MATLAB was used to study the analog version and fairly smooth waveforms were observed as shown in Figures 3, 4 and 5 respectively. All the results were verified experimentally after the implementation and the chip was thoroughly tested.
6. Conclusions In this paper we described a technique that utilizes Walsh functions for digital waveform synthesis. Also we used FPGA for the successful generation of sinusoidal, trapezoidal and triangular waveforms in their digital form using top-down design methodology. FPGA is an efficient hardware target and one of the prevailing technologies for fast prototyping and implementation of digital systems. In this work, the circuits were implemented using Xilinx Spartan-3 FPGA chip and the MATLAB simulation results validate the design methodology. The circuit being digital can be easily integrated as an IP core on a System-on-Chip (SoC). Thus, we conclude that virtually any periodic function can be realized directly in its digital form, without the need of Analog to Digital conversion using Walsh functions and FPGA.
Copyright © 2006 IEEE. All rights reserved.
References [1]
A. A. Susin, and G. W. Roberts, Cores for Mixed-Signal Proceedings of International Microelectronics and Packaging August 1998.
“Signal Generator Systems-on-Chip”, Conference on ICMP’98, Brazil,
[2]
T-C. Hsiao and S. C. Seth, “An analysis of the use of Rademacher-Walsh spectrum in compact testing,” IEEE Transaction on Computers, vol. 33, pp. 934-938, Oct. 1984.
[3]
K. G. Beauchamp, Applications of Walsh and Related Functions with an introduction to Sequency theory, Academic Press, London, 1984.
[4]
B. J. Falkowski, and S. Rahardja, “Walsh-like functions and their relations”, IEE Proceedings of Vision Image and Signal Processing, Vol. 143, No. 5, pp. 279–284, 1996.
[5]
W. A. Evans, “Sine Wave Synthesis using Walsh Functions”, IEE Proceedings, Vol. 134, Pt. G, No.1, 1987.
[6]
R. Kitai, “Synthesis of periodic sinusoids from Walsh waves”, IEEE Transactions on Instrumentation and Measurements, Vol. IM 24, No. 4, pp. 313-317, Dec 1975.
[7]
G. R. Morris and V. K. Prasanna, “An FPGA-Based Floating-Point Jacobi Iterative Solver”, Proceedings of 8th International Symposium on Parallel Architectures, Algorithms and Networks, I-SPAN 2005, Las Vegas, NV, Dec 2005.
[8]
B. Golubov, A. Efimov and V. Skvortsov, “Walsh series and transforms: Theory and applications”, Kluwer Academic Publishers, Dordrecht 1991.
[9]
M. Maqusi, “Applied Walsh Analysis”, Heyden & Sons Ltd., London, 1981.
[10] ISE 6.3i Manual, Xilinx Inc., 2004. [11] Spartan-3 Field Programmable Gate Arrays, San Jose, CA: Xilinx Inc., 2005. [12] Modelsim Xilinx Edition, Xilinx Inc. 2004.
1223
Figure 6: Simulation results of Rademacher, Walsh and Sinusoidal function
Figure 7: Simulation results of Rademacher, Walsh and Trapezoidal function
1224
Copyright © 2006 IEEE. All rights reserved.
Figure 8: Simulation results of Rademacher, Walsh and Triangular function
Copyright © 2006 IEEE. All rights reserved.
1225