ECE 448: Lab 4 FIR Filters.

Slides:



Advertisements
Similar presentations
VHDL in digital circuit synthesis (tutorial) dr inż. Miron Kłosowski EA 309
Advertisements

Arbitrary Waveform Discussion 5.5 Example 34.
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)
Generic Multiplexers: Parameters Discussion D2.5 Example 8.
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.
Counters Discussion D5.3 Example 33. Counters 3-Bit, Divide-by-8 Counter 3-Bit Behavioral Counter in Verilog Modulo-5 Counter An N-Bit Counter.
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
SM Charts and Microprogramming
4-Bit Binary-to-BCD Converter: case Statement
Lecture #5 In this lecture we will introduce the sequential circuits.
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
1 Part V: VHDL CODING. 2 Design StructureData TypesOperators and AttributesConcurrent DesignSequential DesignSignals and VariablesState Machines A VHDL.
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.
Graduate Computer Architecture I VHDL Structure and Testing Michael Sorensen.
A VHDL Tutorial ENG2410. ENG241/VHDL Tutorial2 Goals Introduce the students to the following: –VHDL as Hardware description language. –How to describe.
Chapter 10 State Machine Design. 2 State Machine Definitions State Machine: A synchronous sequential circuit consisting of a sequential logic section.
VHDL Project I: Introduction to Testbench Design Matthew Murach Slides Available at:
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
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.
Language Concepts Ver 1.1, Copyright 1997 TS, Inc. VHDL L a n g u a g e C o n c e p t s Page 1.
ECE 448: Spring 11 Lab 3 Part 1 Sequential Logic for Synthesis.
EE3A1 Computer Hardware and Digital Design Lecture 5 Testbenches and Memories in VHDL.
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.
ECE 332 Digital Electronics and Logic Design Lab Lab 6 Concurrent Statements & Adders.
Introduction to FPGA Tools
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)
Data Storage VHDL ET062G & ET063G Lecture 4 Najeem Lawal 2012.
Controllers ENGIN 341 – Advanced Digital Design University of Massachusetts Boston Department of Engineering Dr. Filip Cuckov.
L20 – Register Set. The 430 Register Set  Not exactly a dual ported register set, but a dual drive register set.  Ref: text Unit 10, 17, 20 9/2/2012.
George Mason University ECE 448 – FPGA and ASIC Design with VHDL VHDL Coding for Synthesis ECE 448 Lecture 12.
Algorithmic State Machines Sorting Signed & Unsigned Data Types
VHDL ELEC 311 Digital Logic and Circuits Dr. Ron Hayne Images Courtesy of Cengage Learning.
ECE DIGITAL LOGIC LECTURE 20: REGISTERS AND COUNTERS Assistant Prof. Fareena Saqib Florida Institute of Technology Fall 2015, 11/19/2015.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Case Study: Xilinx Synthesis Tool (XST). Arrays & Records 2.
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 2 Implementing Combinational Logic in VHDL.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
1 Introduction to Engineering Spring 2007 Lecture 19: Digital Tools 3.
Sequential statements (1) process
Registers and Counters
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
Part III: SYSTEM DESIGN
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
Introduction to ModelSim Implementing Sequential
Programmable Logic Memories
Lecture #5 In this lecture we will introduce the sequential circuits.
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
ECE 448: Lab 4 FIR Filters.
Figure 8.1. The general form of a sequential circuit.
Data Flow Description of Combinational-Circuit Building Blocks
디 지 털 시 스 템 설 계 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 mult 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 integer (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 ‘sync’ taps Sync taps are used because rectangle in freq domain is sin(x)/x=sync(x) in time domain Make sure ‘sync’ 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