FPGA-Based Digital Filters Using Bit-Serial Arithmetic

Similar documents
Tirupur, Tamilnadu, India 1 2

A Survey on Power Reduction Techniques in FIR Filter

REALIZATION OF FPGA BASED Q-FORMAT ARITHMETIC LOGIC UNIT FOR POWER ELECTRONIC CONVERTER APPLICATIONS

Design of a Power Optimal Reversible FIR Filter ASIC Speech Signal Processing

FIR Filter Design on Chip Using VHDL

An area optimized FIR Digital filter using DA Algorithm based on FPGA

Implementing Logic with the Embedded Array

Design of Area and Power Efficient FIR Filter Using Truncated Multiplier Technique

A New High Speed Low Power Performance of 8- Bit Parallel Multiplier-Accumulator Using Modified Radix-2 Booth Encoded Algorithm

Problem Point Value Your score Topic 1 28 Filter Analysis 2 24 Filter Implementation 3 24 Filter Design 4 24 Potpourri Total 100

Reduced Complexity Wallace Tree Mulplier and Enhanced Carry Look-Ahead Adder for Digital FIR Filter

IMPLEMENTATION OF DIGITAL FILTER ON FPGA FOR ECG SIGNAL PROCESSING

Using Soft Multipliers with Stratix & Stratix GX

EECS 452 Midterm Exam Winter 2012

Techniques for Implementing Multipliers in Stratix, Stratix GX & Cyclone Devices

A DSP IMPLEMENTED DIGITAL FM MULTIPLEXING SYSTEM

VLSI IMPLEMENTATION OF MODIFIED DISTRIBUTED ARITHMETIC BASED LOW POWER AND HIGH PERFORMANCE DIGITAL FIR FILTER Dr. S.Satheeskumaran 1 K.

FIR Filter for Audio Signals Based on FPGA: Design and Implementation

Design of FIR Filter on FPGAs using IP cores

Implementation of FPGA based Design for Digital Signal Processing

JDT LOW POWER FIR FILTER ARCHITECTURE USING ACCUMULATOR BASED RADIX-2 MULTIPLIER

On-Chip Implementation of Cascaded Integrated Comb filters (CIC) for DSP applications

Design of Multiplier Less 32 Tap FIR Filter using VHDL

CHAPTER 4 ANALYSIS OF LOW POWER, AREA EFFICIENT AND HIGH SPEED MULTIPLIER TOPOLOGIES

Implementation and Comparison of Low Pass FIR Filter on FPGA Using Different Techniques

Design of a High Speed FIR Filter on FPGA by Using DA-OBC Algorithm

DIGITAL SIGNAL PROCESSING WITH VHDL

Area Efficient and Low Power Reconfiurable Fir Filter

Multiplierless sigma-delta modulation beam forming for ultrasound nondestructive testing

Resource Efficient Reconfigurable Processor for DSP Applications

An Optimized Design for Parallel MAC based on Radix-4 MBA

ATA Memo No. 40 Processing Architectures For Complex Gain Tracking. Larry R. D Addario 2001 October 25

Low Power Approach for Fir Filter Using Modified Booth Multiprecision Multiplier

Globally Asynchronous Locally Synchronous (GALS) Microprogrammed Parallel FIR Filter

SIGNED PIPELINED MULTIPLIER USING HIGH SPEED COMPRESSORS

Design and Performance Analysis of a Reconfigurable Fir Filter

A New Architecture for Signed Radix-2 m Pure Array Multipliers

Channelization and Frequency Tuning using FPGA for UMTS Baseband Application

Digital Integrated CircuitDesign

An Optimized Implementation of CSLA and CLLA for 32-bit Unsigned Multiplier Using Verilog

Design A Redundant Binary Multiplier Using Dual Logic Level Technique

PE713 FPGA Based System Design

Performance Analysis of a 64-bit signed Multiplier with a Carry Select Adder Using VHDL

Keywords: CIC Filter, Field Programmable Gate Array (FPGA), Decimator, Interpolator, Modelsim and Chipscope.

Design Implementation Description for the Digital Frequency Oscillator

Appendix B. Design Implementation Description For The Digital Frequency Demodulator

Mahendra Engineering College, Namakkal, Tamilnadu, India.

Computer Architecture Laboratory

AREA EFFICIENT DISTRIBUTED ARITHMETIC DISCRETE COSINE TRANSFORM USING MODIFIED WALLACE TREE MULTIPLIER

LLRF4 Evaluation Board

Stratix Filtering Reference Design

Design and Implementation of Parallel Micro-programmed FIR Filter Using Efficient Multipliers on FPGA

Using FPGA. Warin Sootkaneung Department of Electrical Engineering. and

Signal Processing Using Digital Technology

Keywords: Adaptive filtering, LMS algorithm, Noise cancellation, VHDL Design, Signal to noise ratio (SNR), Convergence Speed.

A Review on Implementation of Digital Filters on FPGA

High-speed Multiplier Design Using Multi-Operand Multipliers

DESIGN OF LOW POWER MULTIPLIERS

Design and Implementation of Digital Butterworth IIR filter using Xilinx System Generator for noise reduction in ECG Signal

Exploring Decimation Filters

The Comparative Study of FPGA based FIR Filter Design Using Optimized Convolution Method and Overlap Save Method

IJMIE Volume 2, Issue 5 ISSN:

Area Power and Delay Efficient Carry Select Adder (CSLA) Using Bit Excess Technique

Innovative Approach Architecture Designed For Realizing Fixed Point Least Mean Square Adaptive Filter with Less Adaptation Delay

High-Speed Hardware Efficient FIR Compensation Filter for Delta-Sigma Modulator Analog-to-Digital Converter in 0.13 μm CMOS Technology

Problem Point Value Your score Topic 1 28 Discrete-Time Filter Analysis 2 24 Improving Signal Quality 3 24 Filter Bank Design 4 24 Potpourri Total 100

Performance Analysis of FIR Filter Design Using Reconfigurable Mac Unit

Multiplier Design and Performance Estimation with Distributed Arithmetic Algorithm

Study on Digital Multiplier Architecture Using Square Law and Divide-Conquer Method

Block Diagram. i_in. q_in (optional) clk. 0 < seed < use both ports i_in and q_in

MULTIRATE IIR LINEAR DIGITAL FILTER DESIGN FOR POWER SYSTEM SUBSTATION

FPGA Implementation of High Speed FIR Filters and less power consumption structure

Design and Analysis of RNS Based FIR Filter Using Verilog Language

INTERNATIONAL JOURNAL OF ELECTRONICS AND COMMUNICATION ENGINEERING & TECHNOLOGY (IJECET) STUDY ON COMPARISON OF VARIOUS MULTIPLIERS

AREA AND DELAY EFFICIENT DESIGN FOR PARALLEL PREFIX FINITE FIELD MULTIPLIER

An Efficient Baugh-WooleyArchitecture forbothsigned & Unsigned Multiplication

International Journal of Advanced Research in Computer Science and Software Engineering

Performance Analysis of an Efficient Reconfigurable Multiplier for Multirate Systems

Hardware Implementation of BCH Error-Correcting Codes on a FPGA

On the design and efficient implementation of the Farrow structure. Citation Ieee Signal Processing Letters, 2003, v. 10 n. 7, p.

Finite Word Length Effects on Two Integer Discrete Wavelet Transform Algorithms. Armein Z. R. Langi

SCUBA-2. Low Pass Filtering

HIGH SPEED FINITE IMPULSE RESPONSE FILTER FOR LOW POWER DEVICES

EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2. ELEC 3004/7312: Signals Systems & Controls EXPERIMENT 1: INTRODUCTION TO THE NEXYS 2

FPGA Implementation of Digital Modulation Techniques BPSK and QPSK using HDL Verilog

Design of a Power Optimal Reversible FIR Filter for Speech Signal Processing

DA based Efficient Parallel Digital FIR Filter Implementation for DDC and ERT Applications

High Speed Vedic Multiplier Designs Using Novel Carry Select Adder

Design of Digital FIR Filter using Modified MAC Unit

ACIIR IP CORE IIR FILTERS

A Comparative Study on Direct form -1, Broadcast and Fine grain structure of FIR digital filter

EE 470 Signals and Systems

Single Chip FPGA Based Realization of Arbitrary Waveform Generator using Rademacher and Walsh Functions

An Efficient and Flexible Structure for Decimation and Sample Rate Adaptation in Software Radio Receivers

Design and Characterization of 16 Bit Multiplier Accumulator Based on Radix-2 Modified Booth Algorithm

CHAPTER 2 FIR ARCHITECTURE FOR THE FILTER BANK OF SPEECH PROCESSOR

Lecture 3. FIR Design and Decision Feedback Equalization

II Year (04 Semester) EE6403 Discrete Time Systems and Signal Processing

An Analysis of Multipliers in a New Binary System

[Devi*, 5(4): April, 2016] ISSN: (I2OR), Publication Impact Factor: 3.785

Transcription:

FPGA-Based Digital Filters Using Bit-Serial Arithmetic Mónica Arroyuelo Jorge Arroyuelo Alejandro Grosso Departamento de Informatica Universidad Nacional de San Luis Republica Argentina {mdarroyu,bjarroyu,agrosso}@unsl.edu.ar Abstract This paper presents an efficient method for implementation of digital filters targeted FPGA architectures. The traditional approach is based on application of general purpose multipliers. However, multipliers implemented in FPGA architectures do not allow to construct economic Digital Filters. For this reason, multipliers are replaced by Lookup Tables and Adder-Substractor, which use Bit-Serial Arithmetic. Lookup Tables can be of considerable size in high order filters, thus interconnection techniques will be used to construct high order filters from a set of low order filters. The paper presents several examples confirming that these techniques allow a reduction in logic cells utilization of filters implementation based on Bit-Serial Arithmetic concept. Keywords: Digital Filter, FIR-Filter, FPGA, IIR-Filter, Lookup Tables. 1 INTRODUCTION A Digital Filter is a Linear Time Invariant (LTI) system, which performs numerical calculations on sampled values of the signal. The analog input signal must first be sampled and digitized using an Analog to Digital Converter (ADC). The resulting binary numbers, representing successive sampled values of the input signal, are transferred to the filter, which carries out numerical calculations on them. These calculations typically involve multiplying the input values by constants and adding the products together. If necessary, the results of these calculations, which now represent sampled values of the filtered signal, are output through a Digital to Analog Converter (DAC) to convert the signal back to analog form. In the last years digital filters have been recognized as primary digital signal processing (DSP) operation. There are two basic types of digital filters, Finite Impulse Response (FIR) and Infinite Impulse Response (IIR) filters. FIR and IIR filters are used in many digital signal processing systems to perform a variety of signal filtering and conditioning functions. An IIR filter is capable of emulating the transfer functions of analog continuous-time filters, such as low-pass, band-pass, high-pass, and allpass (phase-shifting) types of filtering. IIR filters exhibit similar phase characteristics as their analog counterparts. For arbitrary transfer functions with linear-phase response, FIR filters are utilized and have no equivalent in the analog domain. 113

On the other hand, the advances in Field Programmable Gate Arrays (FPGA) technology have enabled these devices to be applied to a variety of applications traditionally reserved for Application Specific Integrated Circuits (ASICs). The advantages of the FPGA approach to digital filter implementation include: higher samples rates than those that are available form traditional DSP chips, lower costs than an ASIC for moderate volume applications, and are more flexible than the alternate approaches. A filtering function is usually carried out by a number of multiplication operations, which are expensive in terms of time and space. Therefore, several techniques are used to minimize the hardware needed to implement a filter. A technique widely used is to replace Bit-Parallel by Bit-Serial structures. Bit-Parallel structures process all the bits of input data simultaneously at a significant hardware cost. Bit-Serial, by comparison, process the input one bit at a time. The advantage of the last one is that all the bits pass through the same logic, resulting in a huge reduction in the required hardware. Typically, the Bit-Serial approach requires 1/n th of the hardware required for the equivalent n-bit parallel design. The price of this logic reduction is that serial hardware take n clock cycles to execute, while the equivalent parallel structure executes in one clock cycle. Since for certain classes of applications, FPGA utilization is high, performance goals are achieved while using economically attractive FPGA devices. For applications that require high speed performance, Bit-Parallel structures yields the highest performance. This paper illustrates a new approach to the design of digital filters using Bit-Serial Arithmetic, which will reduce the logic cells utilization in an FPGA considerably, it allow us to construct high order filters (FIR-filters require a large number of coefficients to produce adequate frequency response, so these filters can occupy all the FPGA), or have others applications running on our FPGA simultaneously. Although this approach degrades the performance of filters, this degradation is not considerable for the practical purposes since the most applications do not require high speed performance. Others approaches can be see in [1],[2],[3],[4] and [5], which keep high performance but do not reduce the logic cells utilization significantly due to the fact that these try a balance between time and space. 2 IIR-DIGITAL FILTERS IIR-Digital Filters are widely used in digital signal processing applications. They compute an output from a set of input samples and a set of previous outputs, which are multiplied by a set of coefficients and then added together to produce the output. The digital filter behaviour is determined by the filter coefficients. A general IIR-filter is characterized by the following equation: y n = a 0 x n + a 1 x n 1 + + a p x n p + b 1 y n 1 + + b p y n p (1) where p is the filter order, the a p s and b p s are coefficients, x n is the filter input at the time step n, and y n is the filter output at the time step n. 114

Expanding the equation 1 for y n in terms of the individual bits for the two-complements (2 C) operands x = (x (0).x ( 1) x ( 2)...x ( l) ) 2 and y = (y (0).y ( 1) y ( 2)...y ( l) ) 2 we get [6]: ( ) ( ) ( ) 1 y n =a 0 x n (0) + 1 1 2 j x n (j) + a 1 x n 1 (0) + 2 j x n 1 (j) + + a p x n p (0) + 2 j x n p (j) + b 1 ( y n 1 (0) + 1 2 j y n 1 (j) ) + + b p ( x n p (0) + 1 2 j y n p (j) Define f(s, t,...,u, v,..., w) = a 0 s+a 1 t+ +a p u+b 0 v+ +b p w, where s,t,...,u,v,..., and w are single-bit variables. If the coefficients are m-bits constants, then each of the 2 2p+1 possible values for f is representable in (m+ log 2 (2p + 1) ) bits, as it is the sum of (2p+1) m-bit operands. These values can be precomputed and stored in a ((2 2p+1 ) (m + log 2 (2p + 1) ))-bit table. Using the function f, we can rewrite the expression for y n of the equation 2 as follows: ( 1 ) y n = 2 j f(x n (j), x n 1 (j),..., xn p (j), yn 1 (j),...,yn p (j) ) ) f(x n (0), x n 1 (0),...,xn p (0), yn 1 (0),..., yn p (3) Figure 1 shows the filter architecture (using Bit-Serial Arithmetic) to compute the equation 3, where the mapping f is presented as a Lookup Table (LUT) that includes all the possible linear combinations of the filter coefficients, as was mentioned previously. (2) (0) ) serial input Shift Reg x(1) Shift Reg x(p) x(n) x(n 1) x(n p) f ROM (LUT) 2 1 y(n p) y(n 1) + S Shift Reg y(1) Shift Reg y(p) serial output Figure 1: IIR-Digital Filter Architecture. The architecture shown in Figure 1 has bit serial input and output. The ROM memory is addressed by the Least Significant Bits (LSB) of the x s and y s shift registers, and its output together with the S register value are fed to the adder-substractor where are processed. Then the adder-substractor result is accumulated in the S register again. After l + 1 cycles the obtained value is the filter output, which is stored into the y(1) shift register for future computations. Then, the S register is reset in 0 and a new accumulation cycle begins. 115

We can construct high order filters by using the previously mentioned method, but the size required for the LUTs will grow exponentially with the number of filter coefficients. For this reason, a scheme is shown to construct high order IIR-filters making use of the properties of LTI systems such as association and commutation. The associative property means that we may analyze a complicated LTI system by breaking it down into a number of simpler subsystems. The commutative property of LTI systems means that if subsystems are arranged in series, or cascade, then they can be rearranged in any order without affecting overall performance [7]. Therefore, interconnecting low order subfilters appropriately we can make high order filters. This technique permits us to use a set of smaller LUTs instead one huge LUT, which reduces considerably the space occupied in an FPGA. Figure 2 shows the interconnection scheme, where the input, the output and the internal connections (between the filters) are serials, and the (i)-filter output is connect to the (i + 1)-filter input straight forward. serial input IIR IIR IIR IIR (1) (2) (k 1) (k) serial output Figure 2: High Order IIR-Filter Interconnection Scheme. For example, if we need to build a fifth-order IIR-filter we can use two second-order IIR-filters and one first-order IIR-filter. This allows us to use two 32-entry tables and one 8-entry table instead of one 2048-entry table. 3 FIR-DIGITAL FILTERS In a FIR-Digital Filter the output depends only of present and previous input samples, which are multiplied by a set of coefficients and then added together to produce the output. The filter behaviour is determined by the filter coefficients. A general FIR-filter is characterized by the following equation: y n = a 0 x n + a 1 x n 1 + + a q x n p (4) Where p is the filter order, the a p s are the filter coefficients, x n is the input signal at the time step n, and y n is the output signal at the time step n. The major disadvantage of these filters is that usually a large number of coefficients are required to control adequately their frequency response. Practical FIR-Filters typically need between 10 and 150 coefficients. This make them slower in operation than most IIR-filter design. Expanding the equation 4 for y n in terms of the individual bits for the 2 C operands x = (x (0).x ( 1) x ( 2)...x ( l) ) 2 and y = (y (0).y ( 1) y ( 2)...y ( l) ) 2, like it was made for IIR-filter, we get: ( 1 ) y n = 2 j f(x n (j), xn 1 (j),..., xn p (j) ) Figure 3 shows the filter architecture to compute the equation 5. f(x n (0), xn 1 (0),...,xn p (0) ) (5) In the previous section was explained how to build high order IIR-filters from a set of low order filters making use of the properties of LTI systems and interconnecting them appropriately. The same technique will be used for FIR-filters. As we know, the FIR-filters have no feedback coefficients. Due 116

serial input Shift Reg. x(1) x(n) x(n 1) f ROM (LUT) + serial output Shift Reg. y Shift Reg. x(p) x(n p) 2 1 S Figure 3: FIR-Filter Architecture. to this, after l + 1 cycles, the adder-substractor output is only stored into y(n) register. To construct high order FIR-filters we need to interconnect a cascade low FIR sub-filters; in that way the input pass through them serially and the sub-filters outputs are added (by serial adders) to produce the high order FIR-filter output. The interconnection scheme is shown in Figure 4. serial input FIR (1) FIR (2) FIR (k 1) FIR (k) + + Log(k) + serial output Figure 4: High Order FIR-Filter Interconnection Scheme. If we want to construct a high order FIR-filter making use of k sub-filters, its result will have log 2 (k) additional bits due to the fact that the tree adder have depth log 2 (k) and each level may add one bit. Therefore, if the filter input have l bits the filter will produce one result each l+ log 2 (k) clock cycles. Like it was said in the section 2, this technique reduces considerably the space required in an FPGA. For example, if we need to build a eighth-order FIR-filter we can use one fourth-order and one third-order FIR-filter. This allow us to use two small tables, a 32-entry table and a 16-entry table, instead of one 512-entry table. 117

(a) (b) (c) Figure 5: Removing mains-frequency interference from an electrocardiogram. 4 EXPERIMENTAL RESULTS For experiments, several examples of filters with different order were implemented to analyze their behaviour, performance and logic cells utilization in an FPGA. All filters implemented have 8-bit input samples and their coefficients have 8-bit precision, the FPGA selected was Actel ProAsic250 series, and the ACTEL LIBERO IDE v7.3 tool was used for the synthesis. In addition, AD9102 and DAC1654 chips were used to digitize input signals and convert the output signals in analog form respectively. 118

Table 1: Synthesized Result. Filter Type Filter Order Logic Cell Clock Frequency IIR 2 3.06 % (188) 112.020 MHz IIR 4 6.28 % (386) 102.281 MHz FIR 4 3.22 % (198) 110.156 MHz FIR 8 6.62 % (407) 96.330 MHz FIR 18 13.07% (803) 94.295 MHz To see the good behaviour of the architectures presented in the previous sections we will show the functioning of a digital filter. In particular, we will consider a digital filter for an electrocardiogram. In medicine, the electrical activity of the heart can be recorded using electrodes placed on the chest, a filter can be used to reduces the fluctuations due to electric activity in the resulting electrocardiogram (60 Hz in the USA, 50 Hz in Europe). In this case the needed digital filter is a band-stop IIR-filter, because we must reject the mains supply frequency (60 Hz or 50 Hz). This filter is characterized by the following equation: y n = x n + ( 1.9021)x n 1 + x n 2 + (1.8523)y n 1 + ( 0.94833)y n 2 (6) If the interference is at 60 Hz, the filter is effective at sampling frequency of 1200 samples per second (1.2 khz); if it is at 50 Hz, the filter is effective at 1000 samples per second (1 khz) [7]. The VHDL specification for this can be see in Appendix I. Figure 5 (a) shows a typical EKG waveform, corresponding to several heartbeat. In part (b) of the figure it is badly contaminated by sinusoidal interference of 60 Hz frequency. Figure 5 (c) shows the dramatic effect of this filter on the contaminated signal of part (b). The interference has been greatly reduced, without distorting the signal waveform. Now, we will show the FPGA resources utilization of filters implemented with the techniques described in this paper. Table 1 presents these results. We can note that these techniques allow an important reduction in the logic cells utilization, also we can see that the size of filters grows lineally with the numbers of coefficients, degrading their performance slightly. We must have in mind that the overall performance of each implementation is: its clock frequency divide by the number of bits of its input signal (because this is processes serially). Therefore our implementations work at about 10 MHz, which is adequate for the most applications. These are important results, especially for FIRfilters, since they usually require many coefficients to control adequately their frequency response. In fact, using these techniques, we could synthesize a hundredth-order filter with a performance of 10 MHz approximately, it is not possible using traditional techniques with which we could synthesize sixtieth-order filters only. 5 CONCLUSION The presented results lead to the conclusion that the use of Bit-Serial Arithmetic and Lookup Tables allow us to construct economic IIR and FIR digital filters, degrading slightly their performance. In addition, we could see that by the interconnection techniques we can construct efficient high order filters without use huge Lookup Tables. The results produced by these techniques can be straight forward translated from their schematic representation into VHDL code and then synthesize it on an FPGA. Finally, through all the examples, we could see that the behaviour of digital filters implementation is correct. 119

REFERENCES [1] Rawski, Tomaszewicz, Selvaraj and Luba. Efficient Implementation of Digital Filters with Use of Advanced Synthesis Methods Targeted FPGA Architectures. Digital System Design, 2005. Proceedings. 8Th Euromicro Conference on. 30 Aug. - 3 Sept. 2005. Pages 460-466. [2] Knut Arne Vinger and Jim Torrensen. Implementing Evolution of FIR-Filters Efficiently in an FPGA. Evolvable Hardware, 2003. Proceedings. NASA/DoD Conference on. July 9-11, 2003. Pages 26-29. [3] Kalivas, Tsirikos, Bougas and Pekmestzi. 100% Operational Efficient Bit-Serial Programmable FIR Digital Filters. EUSIPCO 2005-13Th European Signal Processing Conference. September 4-8, 2005. Antalya, Turkey. [4] Chi-Jui Chou, Satish Mohanakrishnan and Joseph Evans. FPGA Implementation of Digital Filters. International Conference on Signal Processing Applications and Technology. Berlin, 1993. Pages 251-255. [5] Sang-Hun Yoon, Jong-wha Chong and Chi-Ho Lin. An Area Optimization Method for Digital Filter Design. ETRI Journal, volume 26, Number 6. December 2004. Pages 545-553. [6] behrooz Parhami. Computer Arithmetic: Algorithms ans Hardware Designs. New York: Oxford University Press, 2000. [7] Paul a. Lynn and Wolfgang Fuerst. Introductory Digital Signal Processing with Computer Applications. Revised Edition. John Wiley & Sons. 1994. 120

APPENDIX I (VHDL CODE) library IEEE; use IEEE.std_logic_1164.all; use IEEE.numeric_std.all; entity dig_filtro is port ( x : in unsigned(0 to 7); clk : in std_logic; rst : in std_logic; y : out unsigned(0 to 7)); end; architecture df of dig_filtro is constant cbitsx : integer := 8; constant ccoef : integer := 5; -- number of coeficient constant clognumcoef : integer := 3; -- ciel of ccoef logaritm constant cbitsm : integer := 8; -- number of coeficient bits type TableCoef_type is array(0 to 2**cCoef-1) of unsigned(0 to cbitsm+clognumcoef-1); constant ctablecoef : TableCoef_type :=( "00000000000", "11110000110", "00011101101", "00001110011", "00010000000", "00000000110", "00101101101", "00011110011", "11100001100", "11010010011", "11111111001", "11110000000", "11110001100", "11100010011", "00001111001", "00000000000", "00010000000", "00000000110", "00101101101", "00011110011", "00100000000", "00010000110", "00111101101", "00101110011", "11110001100", "11100010011", "00001111001", "00000000000", "00000001100", "11110010011", "00011111001", "00010000000" ); 121

signal x_n_reg : unsigned(0 to cbitsx-1); signal x_n_input : unsigned(0 to cbitsx-1); signal x_n_1_reg : unsigned(0 to cbitsx-1); signal x_n_1_input : unsigned(0 to cbitsx-1); signal x_n_2_reg : unsigned(0 to cbitsx-1); signal x_n_2_input : unsigned(0 to cbitsx-1); signal y_n_1_reg : unsigned(0 to cbitsx-1); signal y_n_1_input : unsigned(0 to cbitsx-1); signal y_n_2_reg : unsigned(0 to cbitsx-1); signal y_n_2_input : unsigned(0 to cbitsx-1); signal y_input : unsigned(0 to cbitsx-1); signal y_reg : unsigned(0 to cbitsx-1); signal counter_reg : unsigned(0 to cbitsx-1); signal counter_input : unsigned(0 to cbitsx-1); signal s_reg : unsigned(0 to cbitsm+clognumcoef-1); signal s_input : unsigned(0 to cbitsm+clognumcoef-1); signal f : unsigned(0 to cbitsm+clognumcoef-1); signal opndo_1 : unsigned(0 to cbitsm+clognumcoef-1+2); signal opndo_2 : unsigned(0 to cbitsm+clognumcoef-1+2); signal add : unsigned(0 to cbitsm+clognumcoef-1+2); signal address : unsigned(0 to 4); begin -- df counter_input <= counter_reg(counter_reg high) & counter_reg(0 to counter_reg high-1); x_n_input <= x when counter_reg(counter_reg high)= 1 else 0 & x_n_reg(0 to x_n_reg high-1); x_n_1_input <= x_n_reg(x_n_reg high) & x_n_1_reg(0 to x_n_reg high-1); x_n_2_input <= x_n_1_reg(x_n_1_reg high) & x_n_2_reg(0 to x_n_1_reg high-1); y_n_1_input <= add(4 to 4+y_n_1_input high) when counter_reg(counter_reg high) = 1 else 0 & y_n_1_reg(0 to y_n_1_reg high-1); y_n_2_input <= y_n_1_reg(y_n_1_reg high) & y_n_2_reg(0 to y_n_1_reg high-1); y_input <= add(4 to 4+y_n_1_input high) when counter_reg(counter_reg high)= 1 else y_reg; y <= y_reg; opndo_1 <= 0 & s_reg(0) & s_reg(0 to cbitsm+clognumcoef-2) & 1 ; opndo_2 <= 0 &(f xor (0 to (cbitsm+clognumcoef-1) => counter_reg(counter_reg high)))& counter_reg(counter_reg high); add <= opndo_1 + opndo_2; s_input <= (others => 0 ) when counter_reg(counter_reg high) = 1 else add(1 to cbitsm+clognumcoef); address <= (x_n_reg(x_n_reg high), x_n_1_reg(x_n_1_reg high), x_n_2_reg(x_n_2_reg high), y_n_1_reg(y_n_1_reg high), y_n_2_reg(y_n_2_reg high)); with address select f <= ctablecoef(0) when "00000", ctablecoef(1) when "00001", ctablecoef(2) when "00010", 122

ctablecoef(3) when "00011", ctablecoef(4) when "00100", ctablecoef(5) when "00101", ctablecoef(6) when "00110", ctablecoef(7) when "00111", ctablecoef(8) when "01000", ctablecoef(9) when "01001", ctablecoef(10) when "01010", ctablecoef(11) when "01011", ctablecoef(12) when "01100", ctablecoef(13) when "01101", ctablecoef(14) when "01110", ctablecoef(15) when "01111", ctablecoef(16) when "10000", ctablecoef(17) when "10001", ctablecoef(18) when "10010", ctablecoef(19) when "10011", ctablecoef(20) when "10100", ctablecoef(21) when "10101", ctablecoef(22) when "10110", ctablecoef(23) when "10111", ctablecoef(24) when "11000", ctablecoef(25) when "11001", ctablecoef(26) when "11010", ctablecoef(27) when "11011", ctablecoef(28) when "11100", ctablecoef(29) when "11101", ctablecoef(30) when "11110", ctablecoef(31) when others; write: process(clk,rst) begin if rst= 1 then s_reg <= (others => 0 ); x_n_reg <= (others => 0 ); x_n_1_reg <= (others => 0 ); x_n_2_reg <= (others => 0 ); y_n_1_reg <= (others => 0 ); y_n_2_reg <= (others => 0 ); y_reg <= (others => 0 ); counter_reg <= (0 to counter_reg high-1 => 0, counter_reg high => 1 ); elsif clk= 1 and clk event then counter_reg <= counter_input; s_reg <= s_input; x_n_reg <= x_n_input; x_n_1_reg <= x_n_1_input; x_n_2_reg <= x_n_2_input; y_n_1_reg <= y_n_1_input; y_n_2_reg <= y_n_2_input; y_reg <= y_input; end if; end process; end df; 123