A simple vhdl fir description.
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.

36 lines
1.2KB

  1. LIBRARY ieee;
  2. USE ieee.std_logic_1164.ALL;
  3. USE work.GENERAL_INCLUDES.ALL;
  4. ENTITY N_SAMPLES_ADDER IS
  5. GENERIC( log2_nb_stages : natural
  6. );
  7. PORT( i_clk : IN std_logic;
  8. i_data : IN ARRAY (0 TO 2*nb_samples_out) OF std_logic_vector(w_in-1 DOWNTO 0);
  9. o_data : OUT std_logic_vector(w_in+cst_lo2_adder_stages-1 DOWNTO 0)
  10. );
  11. END N_SAMPLES_ADDER;
  12. ARCHITECTURE Adder_Simple OF N_SAMPLES_ADDER IS
  13. SIGNAL data1 : ARRAY (0 TO nb_samples_out) OF signed(w_in-1 DOWNTO 0);
  14. SIGNAL data2 : ARRAY (0 TO nb_samples_out) OF signed(w_in-1 DOWNTO 0);
  15. SIGNAL result : ARRAY (0 TO nb_samples_out) OF signed(w_in DOWNTO 0);
  16. SIGNAL matrix_tree : matrix_adder_generic
  17. BEGIN
  18. stages : FOR i IN 1 TO log2_nb_stages GENERATE
  19. ENTITY N_SAMPLES_partial_ADDER IS
  20. GENERIC( w_in => natural,
  21. nb_samples_out => natural
  22. )
  23. PORT( i_clk => i_clk,
  24. i_data => IN ARRAY (0 TO 2*nb_samples_out) OF std_logic_vector(w_in-1 DOWNTO 0),
  25. o_data => OUT ARRAY (0 TO nb_samples_out) OF std_logic_vector(w_in DOWNTO 0)
  26. );
  27. END GENERATE stages;
  28. END Adder_Simple;