Simulation files of Polyphase Filter in VHDL for FPGA.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.1KB

  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE ieee.numeric_std.ALL;
  4. USE work.POLY_FIR_PKG.ALL;
  5. ENTITY MULT_BLK IS
  6. PORT(i_clk : IN std_logic;
  7. i_data : IN vect_fir_data_in;
  8. i_coeffs : IN vect_fir_coeffs_in;
  9. o_data : OUT vect_mult_data_out
  10. );
  11. END MULT_BLK;
  12. ARCHITECTURE Mult_Path OF MULT_BLK IS
  13. SIGNAL data_mult_signed : vect_mult_data_out_signed;
  14. SIGNAL coeffs_signed : vect_mult_coeffs_signed;
  15. SIGNAL data_signed : vect_data_mult_in_signed;
  16. BEGIN
  17. -- purpose: wiring: cast the i_data and i_coeffs into signed
  18. cast : FOR i IN 0 TO cst_nb_coeffs_subfilter_in-1 GENERATE
  19. data_signed(i) <= signed(i_data(i));
  20. coeffs_signed(i) <= signed(i_coeffs(i));
  21. END GENERATE cast;
  22. -- purpose: calculate and send cast result to output
  23. mult : PROCESS(i_clk)
  24. BEGIN
  25. IF rising_edge(i_clk) THEN
  26. FOR i IN 0 TO cst_nb_coeffs_subfilter_in-1 LOOP
  27. data_mult_signed(i) <= data_signed(i) * coeffs_signed(i);
  28. o_data(i) <= std_logic_vector(unsigned(data_mult_signed(i)));
  29. END LOOP;
  30. END IF;
  31. END PROCESS;
  32. END Mult_Path;