Electrical – Is it necessary to have a finite state machine for every filter you write in VHDL

filterfpgavhdl

I have recently coded a filter in VHDL to be synthesized for an FPGA and I did it using the conventional method where you first design the finite state machine(FSM) and then implement it in your code. But I realized that when I reduced the number of states in the FSM by combining a few states, the filter worked much faster. So, in an attempt to maximize the speed of computation, if I just write the entire filter inside a process so that all the statements get executed sequentially, will it affect the computation in any way?

Best Answer

Depends on how you want to build your filter. The real questions are these: what sample rate do you need, and how long is your filter? If your sample rate is low, then you can get away with an FSM driven design that can use many clock cycles to produce each output sample. It's certainly a good idea to make the FSM as efficient as possible, though. No sense on wasting extra cycles doing nothing, though it may make sense to do some pipelining so you can run at a high clock speed and get timing closure more easily. If your sample rate is high, then you can't spare the clock cycles and will have to implement more parallelism, probably in the form of some sort of pipelining. If your sample rate is so high that you need to process multiple samples on each clock cycle, then you need to do some pretty careful pipelined design.