63 then f<="00000000";
else f<=f+1;
end if;
if sss="00010" then --方波A
if con<=z then dd<=amp0; con<=con+1;
elsif con=63 then con<=0; dd<="00000000";
else con<=con+1; dd<="00000000";
end if;
elsif sss="10000" then dd<=d; --正弦波
elsif sss="00100" then dd<=f(5 downto 0)&"00"; --锯齿波
elsif sss="01000" then --三角波
if f>31 then dd<=("111111"-f(5 downto 0))&"00";
else dd<=f(5 downto 0)&"00";
end if;
elsif sss="00001" then --任意波
if addr<63 then dd<=ram(addr); addr<=addr+1;
elsif addr=63 then dd<=ram(63); addr<=0;
end if;
else --完成5种波形的线形叠加
if sss(1)='1' then
if con<=z then con<=con+1;
dd0:=conv_integer(amp0); --方波波形数据dd0
else con<=con+1; dd0:=0;
end if;
end if;
if sss(4)='1' then dd1:=conv_integer(d); --正弦波波形数据dd1
end if;
if sss(2)='1' then dd2:=conv_integer(f(5 downto 0)&"00");
--锯齿波波形数据dd2
end if;
if sss(3)='1' then
if f>31 then dd3:=conv_integer(("111111"-f(5 downto 0))&"00");
else dd3:=conv_integer(f(5 downto 0)&"00"); --三角波波形数据dd3
end if;
end if;
if sss(0)='1' then
if addr<63 then dd4:=conv_integer(ram(addr)); addr<=addr+1;
elsif addr=63 then dd4:=conv_integer(ram(63)); addr<=0;
end if; --任意波波形数据dd4
end if;
ddd:=conv_std_logic_vector((dd0+dd1+dd2+dd3+dd4),10);
--波形线形叠加输出
dd<=ddd(9 downto 2);
end if;
else count:=count+1;
end if;
end if;
else
if coun0<qqq then coun0<=coun0+tmp; c<=c+1;
else
if count3<=c/2 then count3:=count3+1; dd<=amp0;
elsif count3=c then count3:=1;dd<="00000000";
else count3:=count3+1; dd<="00000000";
&nbs