⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lowpassfiltervhdlcord.txt

📁 低通滤波器的VHDL代码
💻 TXT
📖 第 1 页 / 共 5 页
字号:
  sub_temp_21 <= resize(a2sum11 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a3mul11, 39);
  a1sum11 <= resize( shift_right( sub_temp_21(37 DOWNTO 17) + 1, 1), 20);

  -- ------------------ Section 12 ------------------

  numtypeconvert12 <= dentypeconvert11;

  dentypeconvert12 <= resize( a1sum12(15 DOWNTO 0) & '0' & '0' & '0' & '0', 20);

  -- Reusing denominator delays from last section as this section's numerator delays

  dendelay_process_section12 : PROCESS (clk, reset)
  BEGIN
    IF reset = '1' THEN
      dendelay_section12(0 TO 1) <= (OTHERS => (OTHERS => '0'));
    ELSIF clk'event AND clk = '1' THEN
      IF clk_enable = '1' THEN
        dendelay_section12(0) <= dentypeconvert12;
        dendelay_section12(1) <= dendelay_section12(0);
      END IF;
    END IF; 
  END PROCESS dendelay_process_section12;


  a2mul12 <= dendelay_section12(0) * coeff_a2_section12;

  a3mul12 <= dendelay_section12(1) * coeff_a3_section12;

  b1mul12 <= numtypeconvert12 * coeff_b1_section12;

  b2mul12 <= dendelay_section11(0) * coeff_b2_section12;

  b3mul12 <= dendelay_section11(1) * coeff_b3_section12;

  b1multypeconvert12 <= resize( shift_right( (b1mul12(35) & b1mul12(35 DOWNTO 17) + 1), 1), 20);

  add_temp_22 <= resize(b1multypeconvert12 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b2mul12, 39);
  b1sum12 <= resize( shift_right( add_temp_22(37 DOWNTO 17) + 1, 1), 20);

  add_temp_23 <= resize(b1sum12 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b3mul12, 39);
  b2sum12 <= resize( shift_right( add_temp_23(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_22 <= resize(b2sum12 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a2mul12, 39);
  a2sum12 <= resize( shift_right( sub_temp_22(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_23 <= resize(a2sum12 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a3mul12, 39);
  a1sum12 <= resize( shift_right( sub_temp_23(37 DOWNTO 17) + 1, 1), 20);

  -- ------------------ Section 13 ------------------

  numtypeconvert13 <= dentypeconvert12;

  dentypeconvert13 <= resize( a1sum13(15 DOWNTO 0) & '0' & '0' & '0' & '0', 20);

  -- Reusing denominator delays from last section as this section's numerator delays

  dendelay_process_section13 : PROCESS (clk, reset)
  BEGIN
    IF reset = '1' THEN
      dendelay_section13(0 TO 1) <= (OTHERS => (OTHERS => '0'));
    ELSIF clk'event AND clk = '1' THEN
      IF clk_enable = '1' THEN
        dendelay_section13(0) <= dentypeconvert13;
        dendelay_section13(1) <= dendelay_section13(0);
      END IF;
    END IF; 
  END PROCESS dendelay_process_section13;


  a2mul13 <= dendelay_section13(0) * coeff_a2_section13;

  a3mul13 <= dendelay_section13(1) * coeff_a3_section13;

  b1mul13 <= numtypeconvert13 * coeff_b1_section13;

  b2mul13 <= dendelay_section12(0) * coeff_b2_section13;

  b3mul13 <= dendelay_section12(1) * coeff_b3_section13;

  b1multypeconvert13 <= resize( shift_right( (b1mul13(35) & b1mul13(35 DOWNTO 17) + 1), 1), 20);

  add_temp_24 <= resize(b1multypeconvert13 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b2mul13, 39);
  b1sum13 <= resize( shift_right( add_temp_24(37 DOWNTO 17) + 1, 1), 20);

  add_temp_25 <= resize(b1sum13 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b3mul13, 39);
  b2sum13 <= resize( shift_right( add_temp_25(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_24 <= resize(b2sum13 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a2mul13, 39);
  a2sum13 <= resize( shift_right( sub_temp_24(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_25 <= resize(a2sum13 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a3mul13, 39);
  a1sum13 <= resize( shift_right( sub_temp_25(37 DOWNTO 17) + 1, 1), 20);

  -- ------------------ Section 14 ------------------

  numtypeconvert14 <= dentypeconvert13;

  dentypeconvert14 <= resize( a1sum14(15 DOWNTO 0) & '0' & '0' & '0' & '0', 20);

  -- Reusing denominator delays from last section as this section's numerator delays

  dendelay_process_section14 : PROCESS (clk, reset)
  BEGIN
    IF reset = '1' THEN
      dendelay_section14(0 TO 1) <= (OTHERS => (OTHERS => '0'));
    ELSIF clk'event AND clk = '1' THEN
      IF clk_enable = '1' THEN
        dendelay_section14(0) <= dentypeconvert14;
        dendelay_section14(1) <= dendelay_section14(0);
      END IF;
    END IF; 
  END PROCESS dendelay_process_section14;


  a2mul14 <= dendelay_section14(0) * coeff_a2_section14;

  a3mul14 <= dendelay_section14(1) * coeff_a3_section14;

  b1mul14 <= numtypeconvert14 * coeff_b1_section14;

  b2mul14 <= dendelay_section13(0) * coeff_b2_section14;

  b3mul14 <= dendelay_section13(1) * coeff_b3_section14;

  b1multypeconvert14 <= resize( shift_right( (b1mul14(35) & b1mul14(35 DOWNTO 17) + 1), 1), 20);

  add_temp_26 <= resize(b1multypeconvert14 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b2mul14, 39);
  b1sum14 <= resize( shift_right( add_temp_26(37 DOWNTO 17) + 1, 1), 20);

  add_temp_27 <= resize(b1sum14 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b3mul14, 39);
  b2sum14 <= resize( shift_right( add_temp_27(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_26 <= resize(b2sum14 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a2mul14, 39);
  a2sum14 <= resize( shift_right( sub_temp_26(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_27 <= resize(a2sum14 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a3mul14, 39);
  a1sum14 <= resize( shift_right( sub_temp_27(37 DOWNTO 17) + 1, 1), 20);

  -- ------------------ Section 15 ------------------

  numtypeconvert15 <= dentypeconvert14;

  dentypeconvert15 <= resize( a1sum15(15 DOWNTO 0) & '0' & '0' & '0' & '0', 20);

  -- Reusing denominator delays from last section as this section's numerator delays

  dendelay_process_section15 : PROCESS (clk, reset)
  BEGIN
    IF reset = '1' THEN
      dendelay_section15(0 TO 1) <= (OTHERS => (OTHERS => '0'));
    ELSIF clk'event AND clk = '1' THEN
      IF clk_enable = '1' THEN
        dendelay_section15(0) <= dentypeconvert15;
        dendelay_section15(1) <= dendelay_section15(0);
      END IF;
    END IF; 
  END PROCESS dendelay_process_section15;


  a2mul15 <= dendelay_section15(0) * coeff_a2_section15;

  a3mul15 <= dendelay_section15(1) * coeff_a3_section15;

  b1mul15 <= numtypeconvert15 * coeff_b1_section15;

  b2mul15 <= dendelay_section14(0) * coeff_b2_section15;

  b3mul15 <= dendelay_section14(1) * coeff_b3_section15;

  b1multypeconvert15 <= resize( shift_right( (b1mul15(35) & b1mul15(35 DOWNTO 17) + 1), 1), 20);

  add_temp_28 <= resize(b1multypeconvert15 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b2mul15, 39);
  b1sum15 <= resize( shift_right( add_temp_28(37 DOWNTO 17) + 1, 1), 20);

  add_temp_29 <= resize(b1sum15 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b3mul15, 39);
  b2sum15 <= resize( shift_right( add_temp_29(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_28 <= resize(b2sum15 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a2mul15, 39);
  a2sum15 <= resize( shift_right( sub_temp_28(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_29 <= resize(a2sum15 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a3mul15, 39);
  a1sum15 <= resize( shift_right( sub_temp_29(37 DOWNTO 17) + 1, 1), 20);

  -- ------------------ Section 16 ------------------

  numtypeconvert16 <= dentypeconvert15;

  dentypeconvert16 <= resize( a1sum16(15 DOWNTO 0) & '0' & '0' & '0' & '0', 20);

  -- Reusing denominator delays from last section as this section's numerator delays

  dendelay_process_section16 : PROCESS (clk, reset)
  BEGIN
    IF reset = '1' THEN
      dendelay_section16(0 TO 1) <= (OTHERS => (OTHERS => '0'));
    ELSIF clk'event AND clk = '1' THEN
      IF clk_enable = '1' THEN
        dendelay_section16(0) <= dentypeconvert16;
        dendelay_section16(1) <= dendelay_section16(0);
      END IF;
    END IF; 
  END PROCESS dendelay_process_section16;


  a2mul16 <= dendelay_section16(0) * coeff_a2_section16;

  a3mul16 <= dendelay_section16(1) * coeff_a3_section16;

  b1mul16 <= numtypeconvert16 * coeff_b1_section16;

  b2mul16 <= dendelay_section15(0) * coeff_b2_section16;

  b3mul16 <= dendelay_section15(1) * coeff_b3_section16;

  b1multypeconvert16 <= resize( shift_right( (b1mul16(35) & b1mul16(35 DOWNTO 17) + 1), 1), 20);

  add_temp_30 <= resize(b1multypeconvert16 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b2mul16, 39);
  b1sum16 <= resize( shift_right( add_temp_30(37 DOWNTO 17) + 1, 1), 20);

  add_temp_31 <= resize(b1sum16 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) + resize(b3mul16, 39);
  b2sum16 <= resize( shift_right( add_temp_31(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_30 <= resize(b2sum16 & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0' & '0', 39) - resize(a2mul16, 39);
  a2sum16 <= resize( shift_right( sub_temp_30(37 DOWNTO 17) + 1, 1), 20);

  sub_temp_31 <= resize(a2sum16 & '0' & '0' & '0' & '0' & '0' 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -