如題所示!
請問有哪位大佬知道該怎么寫FPGA實現函數信號發生器的報告嗎?
慕蓋茨4494581
2021-09-19 13:10:45
TA貢獻1788條經驗 獲得超4個贊
鋸齒波VHDL編程源程序:
library ieee;
use ieee.std_logic.1164.all;
entity jvchi2 is
potr(clk2,up_down: in std_logic;
dd2:buffer integer range 255 downto 0);
end;
architecture one of jvchi2 is
signal d,temp:integer range 255 downto 0;
begin
process(clk2)
begin
if(clk2’event and clk2=’1’) then
if temp<198 then temp<=temp+2;
else temp<=0;
end if;
end if;
end process;
process(temp,up_down)
begin
if up_down=’0’ then d<=temp;
else d<=198-temp;
end if;
end process;
dd2<=d;
end;
舉報