多功能波形发生器VHDL程序与仿真

[11-20 16:14:56]   来源:http://www.88dzw.com  FPGA   阅读:8518

文章摘要: end if; end if; else count0:=count0+1; end if; end if;end if;end if;end process;a<=amp; --将幅值输出。cov_a:process(clk,amp,amp0) --主要实现各波形幅度值到BCD码的转化,由于方波和其他三种波形的幅度调节方式、精--度不同,因此对幅度的处理方式分两种:“sss="00010" or sw='1'”

多功能波形发生器VHDL程序与仿真,标签:fpga是什么,fpga教程,http://www.88dzw.com

            end if;

          end if;

        else count0:=count0+1;

        end if;

      end if;

end if;

end if;

end process;

a<=amp;                        --将幅值输出。

cov_a:process(clk,amp,amp0)        

--主要实现各波形幅度值到BCD码的转化,由于方波和其他三种波形的幅度调节方式、精

--度不同,因此对幅度的处理方式分两种:“sss="00010" or sw='1'”是判断输出波形是否为

--方波(A或B),bcd00,bcd10,bcd20,bcd30是本进程的输出。

variable count : integer range 0 to 50004225;

variable counter : integer range 0 to 500055;

variable count1,count0 : integer range 0 to 4999999;

begin

if rising_edge(clk) then

    if sss="00010" or sw='1' then count0:=0;                                   --方波

      if count1=4999999 then count1:=0; bcd0<=0; bcd1<=0; bcd2<=0; bcd3<=0;

count:=(conv_integer(amp))*(conv_integer(amp0))*769; --幅值运算

      elsif count1=4999900 then count1:=count1+1;

bcd00<=bcd0; bcd10<=bcd1; bcd20<=bcd2; bcd30<=bcd3;  --数据输出

      else count1:=count1+1;                         --二进制码到BCD码的数据转换

        if count>9999999 then count:=count-10000000; bcd0<=bcd0+1;

        elsif count>999999 then count:=count-1000000; bcd1<=bcd1+1;

        elsif count>99999 then count:=count-100000; bcd2<=bcd2+1;

        elsif count>9999 then count:=count-10000; bcd3<=bcd3+1;

        else null;

        end if;

      end if;

    else count1:=0;                                        --正弦波、三角波、锯齿波

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]  下一页


Tag:FPGAfpga是什么,fpga教程FPGA

《多功能波形发生器VHDL程序与仿真》相关文章

分类导航
最新更新
热门排行