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
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.
| Level | Time | Works in simulation only? |
|---|---|---|
| Intermediate | 4 hours | Simulation 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.
| Item | What it is (in simple words) | Why you need it | Approx. 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 resistors | An 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 amp | Digital-to-analog converter: turns numbers into audio voltage. | Lets the synthesizer actually make sound. | $4 |
Connections
| Signal | Direction | Goes to | Note |
|---|---|---|---|
| din[7:0] | input | switches or ADC data | |
| dout[7:0] | output | LEDs or R-2R DAC | R-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
- Simulate with a noisy step.
- Change taps to weights (1, 2, 2, 1) using shifts and adds.
- Add saturation so the output never overflows.
- Send output to LEDs or an R-2R DAC.
- Measure the smoothing with a scope.
If it does not work
| Symptom | Likely cause | Fix |
|---|---|---|
| Board not detected | Charge-only cable or no driver | Use a data cable, install the vendor driver |
| Nothing happens | Wrong pin constraints | Recheck every pin against the board manual |
| Output too large | Missing shift after the sum | Shift right by log2(taps) |
| Output delayed | Registers add latency | Expected: 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...
No feedback.