Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help in Verilog Code for FIR Filter

Status
Not open for further replies.

anishsingh

Junior Member level 2
Joined
Feb 27, 2012
Messages
20
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
1,421
Hi

I am trying to implement 8 tap (7th order) Low Pass FIR Filter in ASIC semi custom design by writing its verilog code & testbench .. How do I represent the filter coefficients in the code ( which may be +/- ve and have fractional parts) ..?

Can I write direct statements for addition & multiplication in the code like :

assign P3 = D2 * b3;
or
assign Add5 = P5 + P6; ????

Kindly help !!

---------- Post added at 11:16 ---------- Previous post was at 11:06 ----------

and yes , do I need a memory element to store coefficients ? Does it need special initialization in code or just writing reg command would suffice ??
 

Yes,you can write direct statements for addition & multiplication in the code like that.
But you should change the data into its complement.
 

How do I represent a number such as -0.2 in binary in verilog code ????
 

How do I represent a number such as -0.2 in binary in verilog code ????
Basically the same way that you do on pencil and paper, when required to use integer numbers only.

You need to define fractional number representations for signal and coefficients, according to the required signal dynamic and coefficient accuracy. A fractional number is nothing but an integer with an implicite 2^n scale factor.
 

I'm sorry I don't know how to express a fractional number in verilog.
But when I design a sensor detection circuit, the numbers from ADC are integer. I will make filter coefficients multiplied by 2^n and change them into binary integers in Matlab. And finally I just need shift the result right by n bits.
Generally I'm less concerned about the absolute value of the number in the process.
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top