GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com โ€” GitHub - AloRno/Differential-Filter-VHDL: VHDL/FPGA differential filter with fixed-point normalization and saturation, implemented as a memory-mapped FSMD - final project for Reti Logiche @ Politecnico di Milano

BranchesTags
Open more actions menu

Latest commit

 

History

2 Commits
2 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
testbench
testbench
 
 
README.md
README.md
 
 
project_reti_logiche.vhd
project_reti_logiche.vhd
 
 

Repository files navigation

๐Ÿ”Œ Differential Filter - VHDL Project

Memory-mapped hardware module in VHDL that applies a differential filter (order 3 or order 5) to a sequence of signed 8-bit samples read from RAM, built from a finite-state machine with datapath (FSMD).

๐Ÿ“„ Overview

This project implements a synchronous HW component that interfaces with an external memory to read a sequence of K signed 8-bit values, apply a differential filter, and write the filtered (and saturated) results back to memory.

Developed as the final project ("Prova Finale") for the Reti Logiche (Logic Networks / Digital Systems) course at Politecnico di Milano, in pairs with Mirco Poma, following a specification provided by the course.

Documentation:

  • Project Report โ€” architecture, FSM design, design choices, and test results (Italian)
  • Full Specification โ€” official assignment provided by the course (Italian)

๐Ÿงฉ The Challenge

  • Memory-mapped interface: the component has no data ports besides a start address (ADD); every input (sequence length, filter type, coefficients, samples) must be fetched byte-by-byte from RAM via o_mem_addr/i_mem_data, and results written back via o_mem_data/o_mem_we.
  • Two selectable filters: a 1-bit flag read from memory selects between an order-3 filter (5 coefficients, normalization n=12) and an order-5 filter (7 coefficients, n=60), each with its own coefficient block layout in memory.
  • Fixed-point division without a divider: normalization (1/12, 1/60) must be approximated using only right shifts and additions, with an explicit rounding correction for negative operands (specified bit-exactly by the assignment).
  • Saturation arithmetic: filtered results outside [-128, 127] must be clamped to the range instead of overflowing/wrapping.
  • Boundary handling: samples before the start and after the end of the sequence are treated as 0 (zero-padding), so edge elements are filtered correctly without extra branching in the datapath.

โš™๏ธ Architecture

The module is implemented as an 11-state Moore-style FSM (S0โ€ฆS9, DONE) driving a small datapath, described over three cooperating processes:

  • funzione_stato_prossimo โ€” combinational next-state logic and memory control signals (o_mem_addr, o_mem_en, o_mem_we, o_done).
  • gestione_stati โ€” synchronous datapath registers: sequence length K, filter-type flag, coefficient array, sliding input window, and read/write address counters.
  • filtro โ€” synchronous combinational-style process that computes the weighted sum of coefficients ร— samples, applies the shift-based normalization with sign-aware rounding, and saturates the result to 8 bits.

Control flow: read header (K1, K2, filter-type S) โ†’ read the filter's coefficient block โ†’ for each output sample, load the 3 or 5 needed input samples (zero-padded at the boundaries) โ†’ compute and write the normalized, saturated result โ†’ repeat until K outputs have been produced โ†’ assert o_done.

๐Ÿงช Verification

Validated against the official course-provided testbench (testbench/tb2425.vhd), which models the memory, drives i_clk/i_rst/i_start/i_add, and checks both the order-3 and order-5 filter paths against precomputed reference outputs. See docs/Report.pdf for the full simulation and post-synthesis results.

๐Ÿš€ Tech Stack

  • Language: VHDL (synthesizable, IEEE std_logic_1164 / numeric_std)
  • Toolchain: Xilinx Vivado (WebPACK), target-agnostic FPGA (e.g. Artix-7)
  • Design style: Finite State Machine with Datapath (FSMD), fully synchronous except for the asynchronous reset

๐Ÿ› ๏ธ Build & Run

Prerequisites

  • Xilinx Vivado

Simulation

  1. Add project_reti_logiche.vhd and testbench/tb2425.vhd to a new project/simulation.
  2. Set tb2425 as the simulation top module.
  3. Run the simulation and inspect tb_done / the scenario pass-fail report in the console.

About

VHDL/FPGA differential filter with fixed-point normalization and saturation, implemented as a memory-mapped FSMD - final project for Reti Logiche @ Politecnico di Milano

Topics

differential-filterdigital-desigdigital-filterdigital-logicfpgafsmdhardware-designpolitecnico-di-milanosignal-processinuniversity-projecvhdxilinx-vivad

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 โ€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800ร—600. No cookies required.