Home / Learn Verilog / Project 12: FIR Low-Pass Filter

Project 12: FIR Low-Pass Filter

A 4-tap moving-average and weighted filter on a signal.

In shortA 4-tap moving-average and weighted filter on a signal.

What's actually going on

FIRx[n]delay linemultiply/addy[n]
FIR

What it is

Implement a small FIR filter (shift register + multipliers + adder) and see it smooth a noisy step.

Why it matters

Projects turn knowledge into skill: you design, simulate, debug and finally see real hardware react.

Mechanically speaking

Simulate in the browser, then build for your board following the steps.

Shows up in

  • Portfolio
  • Interviews
  • Learning by doing

What you will build

Implement a small FIR filter (shift register + multipliers + adder) and see it smooth a noisy step.

LevelTimeWorks in simulation only?
Intermediate4 hoursSimulation is enough

What you need (equipment and tools)

Read this table once and you will know exactly what to buy or prepare. You can do the simulation part with only a computer and the free tools.

ItemWhat it is (in simple words)Why you need itApprox. cost
Computer (Windows, Linux or macOS)Your normal laptop or desktop. You write Verilog here and run the free tools.Simulator, synthesis and programmer all run on it.you have it
Free software: Icarus Verilog + GTKWave (simulation), Yosys + nextpnr or the vendor IDE (build), openFPGALoader (program)The programs that compile and simulate your design.Everything in this course can be simulated with only these free tools.free
FPGA development board (e.g. Tang Nano 9K, Basys 3, iCEBreaker, Arty A7)A small circuit board with an FPGA chip, an oscillator (clock), LEDs, buttons and a USB port. The FPGA is the "blank hardware" that your Verilog turns into a real circuit.This is where your design actually runs. Without it you can only simulate.about $15 (Tang Nano 9K) to $150 (Arty A7)
LEDs (5 mm) + 330 ohm resistorsAn LED lights when current flows through it. The resistor limits that current so the LED and the FPGA pin do not burn.Visible output. Many boards already have LEDs built in; external ones are for bigger demos.$2 for a pack
I2S audio DAC module (PCM5102) + headphones or small speaker ampDigital-to-analog converter: turns numbers into audio voltage.Lets the synthesizer actually make sound.$4

Connections

SignalDirectionGoes toNote
din[7:0]inputswitches or ADC data
dout[7:0]outputLEDs or R-2R DACR-2R ladder to see an analog output

Step 1: simulate the design

4-tap FIRVerilog: edit and run

The average smooths the jumps. Divide the sum by 4 with a shift.

Step by step

  1. Simulate with a noisy step.
  2. Change taps to weights (1, 2, 2, 1) using shifts and adds.
  3. Add saturation so the output never overflows.
  4. Send output to LEDs or an R-2R DAC.
  5. Measure the smoothing with a scope.

If it does not work

SymptomLikely causeFix
Board not detectedCharge-only cable or no driverUse a data cable, install the vendor driver
Nothing happensWrong pin constraintsRecheck every pin against the board manual
Output too largeMissing shift after the sumShift right by log2(taps)
Output delayedRegisters add latencyExpected: 1 clock per stage
Tip:Keep your first board test tiny: if the LED blinks, the toolchain, cable and clock are fine. Then add your project piece by piece.

Check yourself

1. FIR means...