ECE 448: Lab 4 FIR Filters.

Slides:



Advertisements
Similar presentations
Arbitrary Waveform Discussion 5.5 Example 34.
Advertisements

1 VLSI DESIGN USING VHDL Part II A workshop by Dr. Junaid Ahmed Zubairi.
Ring Counter Discussion D5.3 Example 32. Ring Counter if rising_edge(CLK) then for i in 0 to 2 loop s(i)
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
FPGAs and VHDL Lecture L12.1. FPGAs and VHDL Field Programmable Gate Arrays (FPGAs) VHDL –2 x 1 MUX –4 x 1 MUX –An Adder –Binary-to-BCD Converter –A Register.
SM Charts and Microprogramming
4-Bit Binary-to-BCD Converter: case Statement
Lecture #5 In this lecture we will introduce the sequential circuits.
ECE 448: Lab 4 FIR Filters.
Designing with FPGAs ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
System Arch 2008 (Fire Tom Wada) /10/9 Field Programmable Gate Array.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
CprE / ComS 583 Reconfigurable Computing
VHDL in 1h Martin Schöberl. AK: JVMHWVHDL2 VHDL /= C, Java,… Think in hardware All constructs run concurrent Different from software programming Forget.
ECE 448: Spring 11 Lab 3 Part 1 Sequential Logic for Synthesis.
ECE 448: Lab 6 DSP and FPGA Embedded Resources (Digital Downconverter)
Copyright(c) 1996 W. B. Ligon III1 Getting Started with VHDL VHDL code is composed of a number of entities Entities describe the interface of the component.
CPE 626 Advanced VLSI Design Lecture 6: VHDL Synthesis Aleksandar Milenkovic
ECE 448: Lab 5 DSP and FPGA Embedded Resources (Signal Filtering and Display)
Generate Statements Instructors: Fu-Chiung Cheng ( 鄭福炯 ) Associate Professor Computer Science & Engineering Tatung University.
Design Examples ELEC 418 Advanced Digital Systems Dr. Ron Hayne Images Courtesy of Thomson Engineering.
George Mason University Simple Testbenches ECE 545 Lecture 4.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
 Seattle Pacific University EE Logic System DesignCounters-1 Shift Registers DQ clk DQ DQ ShiftIn Q3Q3 Q2Q2 DQ Q1Q1 Q0Q0 A shift register shifts.
1 Part III: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
04/26/20031 ECE 551: Digital System Design & Synthesis Lecture Set : Introduction to VHDL 12.2: VHDL versus Verilog (Separate File)
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
Fundamentals of Digital Signal Processing יהודה אפק, נתן אינטרטור אוניברסיטת תל אביב.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Combinational logic circuit
Registers and Counters
ENG2410 Digital Design “Combinational Logic Design”
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Part III: SYSTEM DESIGN
Part IV: VHDL CODING.
ENG6530 Reconfigurable Computing Systems
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Programmable Logic Memories
Field Programmable Gate Array
Field Programmable Gate Array
Field Programmable Gate Array
Cryptol aided formal verification of VHDL code
Introduction to ModelSim Implementing Sequential
Programmable Logic Memories
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
CPRE 583 Reconfigurable Computing
ECE 448 Lecture 7 FPGA Devices
ECE 545 Lecture 17 RAM.
Lecture #5 In this lecture we will introduce the sequential circuits.
Behavioral Modeling of Sequential-Circuit Building Blocks
Sequntial-Circuit Building Blocks
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
Data Flow Description of Combinational-Circuit Building Blocks
Sequential Logic for Synthesis Based on Aldec Active-HDL
Modeling of Circuits with a Regular Structure
Figure 8.1. The general form of a sequential circuit.
UNIT 6: Mixed-Type Description
Implementing Combinational and Sequential Logic in VHDL
Data Flow Description of Combinational-Circuit Building Blocks
Based on Xilinx ISE & ModelSim
Modeling of Circuits with a Regular Structure
ECE 545 Lecture 5 Simple Testbenches.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
디 지 털 시 스 템 설 계 UP2 Kit를 이용한 카운터 설계
Digital Logic with VHDL
(Sequential-Circuit Building Blocks)
Presentation transcript:

ECE 448: Lab 4 FIR Filters

Agenda for today Part 1: Introduction to Experiment 4: FIR Filter Part 2: Hands-on Session: FPGA Design Flow Based on Xilinx ISE/WebPack and ModelSim 2

Filters Keep the green, block the red. Blue is a Low Pass Filter (LPF) Multiplication in frequency domain Convolution in time domain ωs -ωs ωp -ωp |·| ω -ω

Convolution

Convolution Equations Continuous time Discrete time

Convolution Problems The function g[n] is called the “filter taps” Infinite number of taps is impossible to implement. Not enough space to store taps! Not enough time to compute output! For this reason, we take a finite number of taps (normally centered at n=0)

Finite Convolution Example

Direct Form FIR Filter FIR = Finite Impulse Response x(n) Z-1 h0 h1 h2 hM-1 y(n) FIR = Finite Impulse Response Simple to implement in VHDL Very long critical path (1 mults + M-1 adds)

Direct Form Transform FIR Filter x(n) Z-1 hM-1 hM-2 hM-3 h0 y(n) Greatly reduced critical path 1 Multiply and 1 Add Constant regardless of filter length Taps are reversed Still a problem?

Bit growth bit_length(a*b) = bit_length(a) + bit_length(b) bit_length(a+b) = max(bit_length(a),bit_length(b))+1 If filter has “unity gain”, adders do not cause growth x(n) Z-1 hM-1 hM-2 hM-3 h0 y(n) p 2p Q

Serial FIR Filter Reuse Multiplier and Accumulator (MACC) Z-1 hold x(n) for M samples Cycle through h(M-1) through h(0) y(n) valid after M samples Reuse Multiplier and Accumulator (MACC) M cycles to compute Hardware reduced by factor of M

Optimal Hardware All hardware can be made out of LUT/FF Combination Possibly the best solution, maybe not Might be better, optimal hardware Three (3) ways to use optimal hardware Inference Usually best Faster Simulation No extra libraries Not FPGA specific Instantiation CoreGen

Inference library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity mult18x18 is generic ( word_size : natural := 18; signed_mult : boolean := true); port ( clk : in std_logic; a : in std_logic_vector(1*word_size-1 downto 0); b : in std_logic_vector(1*word_size-1 downto 0); c : out std_logic_vector(2*word_size-1 downto 0)); end entity mult18x18; architecture infer of mult18x18 is begin process(clk) if rising_edge(clk) then if signed_mult then c <= std_logic_vector(signed(a) * signed(b)); else c <= std_logic_vector(unsigned(a) * unsigned(b)); end if; end process; end architecture infer;

Instantiation -- Component Declaration for MULT18X18 should be placed -- after architecture statement but before begin keyword component MULT18X18 port ( P : out STD_LOGIC_VECTOR (35 downto 0); A : in STD_LOGIC_VECTOR (17 downto 0); B : in STD_LOGIC_VECTOR (17 downto 0)); end component; -- Component Attribute specification for MULT18X18 -- should be placed after architecture declaration but -- before the begin keyword -- Attributes should be placed here -- Component Instantiation for MULT18X18 should be placed -- in architecture after the begin keyword MULT18X18_INSTANCE_NAME : MULT18X18 port map (P => user_P, A => user_A, B => user_B);

CoreGen For more complicated hardware (like FIFOs) Use Xilinx tools to generate the instantiation with particular settings Will not use until future lab

Extra Information Entity declaration entity fir_filter is port( clk : in std_logic; reset : in std_logic; -- Input signals samp_i : in std_logic; data_i : in std_logic_vector(15 downto 0); -- Output signals samp_o : out std_logic; data_o : out std_logic_vector(15 downto 0)); end entity fir_filter;

Extra Information (2) samp_i is a one-cycle clock enable samp_o is a one_cycle “calculation finished” signal data_in is 16 bits (or 18 bits if you feel ambitious) data_out is 16 bits (quantized)

Extra Information (3) Nested types Used for multidimensional arrays Also used for ROM/RAM interfaces Usually enough to infer such memory units type word_vector is array (natural range <>) of signed(15 downto 0); constant taps : word_vector(0 to 31) := ( x"0001", x"0002", x"0003", x"0004", x"0005", x"0006", x"0007", x"0008", x"0009", x"000A", x"000B", x"000C", x"000D", x"000E", x"000F", x"0010", x"0011", x"0012", x"0013", x"0014", x"0015", x"0016", x"0017", x"0018", x"0019", x"001A", x"001B", x"001C", x"001D", x"001E", x"001F", x"0020");

Extra Information (4) Test filter with Impulse …,zero, zero, zero, one, zero, zero, zero… Test Circuit with ‘ramp’ taps taps <= (x”0001”,x”0002”,x”0003”,… Testing with ‘ramp’ helps test filter function Replace ‘ramp’ with ‘sinc’ taps Sinc taps are used because rectangle in freq domain is sin(x)/x=sinc(x) in time domain Make sure ‘sinc’ comes out of filter

FPGA Design Flow Based on Xilinx ISE/WebPack & ModelSim Part 2 Hands-on Session FPGA Design Flow Based on Xilinx ISE/WebPack & ModelSim 20